MerlinR / Hexital

Hexital - Incremental Technical Analysis Library
MIT License
12 stars 2 forks source link

Added resolution attribute to Candle #18

Closed MerlinR closed 2 months ago

MerlinR commented 4 months ago

Add a "resolution" attribute to the "Candle" class. Can be used to easily define/see the resolution of single candles. Can re-use the "Timeframe" class as values for the attribute. Can likely auto populate resolution on missing field based on time between given candles as an average. Can also auto populate if Hexital/Indicator is given a timeframe

MerlinR commented 4 months ago

Example: class Candle: open: float high: float low: float close: float volume: int timestamp: Optional[datetime] = None resolution: Optional[Timeframe] = None _clean_values: Dict[str, float | int] _tag: Optional[str] = None indicators: Dict[str, float | Dict[str, float | None] | None] sub_indicators: Dict[str, float | Dict[str, float | None] | None]