candles
candles
Functions:
Name | Description |
---|---|
candles_average |
Averages period of |
candles_sum |
Sum of |
get_candles_period |
Goes through from index-length to index and returns a list of values |
get_candles_timeframe |
Goes through from index and returns candles that are less or equal to timeframe to index candle |
get_readings_period |
Goes through from index-length to index and returns a list of values, removes dict's and None values, validates index, if out of range set to max (-1) |
get_readings_timeframe |
Goes through from index and returns readings that are less or equal to timeframe to index candle |
reading_by_candle |
Simple method to get a reading from the given indicator from a candle |
reading_by_index |
Simple method to get a reading from the given indicator from it's index |
reading_count |
Returns how many instance of the given indicator exist |
reading_period |
Will return True if the given indicator goes back as far as amount, |
candles_average
candles_average(
candles: List[Candle],
indicator: str,
length: int,
index: int = -1,
include_latest: bool = True,
) -> float
Averages period of indicator
for length
bars back.
If not enough Candles, sum's what's available
Source code in hexital/utils/candles.py
candles_sum
candles_sum(
candles: List[Candle],
indicator: str,
length: int,
index: int = -1,
include_latest: bool = True,
) -> float
Sum of indicator
for length
bars back. If not enough Candles, sum's what's available
Source code in hexital/utils/candles.py
get_candles_period
get_candles_period(
candles: List[Candle], length: int, index: int, include_latest: bool = False
) -> List[Candle]
Goes through from index-length to index and returns a list of values Returns from newest at the back (same order)
Source code in hexital/utils/candles.py
get_candles_timeframe
get_candles_timeframe(
candles: List[Candle],
timeframe: timedelta,
index: int,
include_latest: bool = False,
rounded_timeframe: bool = False,
) -> List[Candle]
Goes through from index and returns candles that are less or equal to timeframe to index candle Returns from newest at the back (same order)
Source code in hexital/utils/candles.py
get_readings_period
get_readings_period(
candles: List[Candle],
indicator: str,
length: int,
index: int,
include_latest: bool = False,
) -> List[float | int]
Goes through from index-length to index and returns a list of values, removes dict's and None values, validates index, if out of range set to max (-1) Returns from newest at the back (same order)
Source code in hexital/utils/candles.py
get_readings_timeframe
get_readings_timeframe(
candles: List[Candle],
indicator: str,
timeframe: timedelta,
index: int,
include_latest: bool = False,
rounded_timeframe: bool = False,
) -> List[float | int]
Goes through from index and returns readings that are less or equal to timeframe to index candle removes dict's and None values Returns from newest at the back (same order)
Source code in hexital/utils/candles.py
reading_by_candle
Simple method to get a reading from the given indicator from a candle Uses '.' to find nested reading, E.G 'MACD_12_26_9.MACD
Source code in hexital/utils/candles.py
reading_by_index
Simple method to get a reading from the given indicator from it's index
Source code in hexital/utils/candles.py
reading_count
Returns how many instance of the given indicator exist
Source code in hexital/utils/candles.py
reading_period
reading_period(
candles: List[Candle], period: int, name: str, index: Optional[int] = None
) -> bool
Will return True if the given indicator goes back as far as amount, It's true if exactly or more than. Includes index