2025-05-26 13:26:07 +08:00
|
|
|
"""
|
|
|
|
|
Incremental Indicator States Module
|
|
|
|
|
|
|
|
|
|
This module contains indicator state classes that maintain calculation state
|
|
|
|
|
for incremental processing of technical indicators.
|
|
|
|
|
|
|
|
|
|
All indicator states implement the IndicatorState interface and provide:
|
|
|
|
|
- Incremental updates with new data points
|
|
|
|
|
- Constant memory usage regardless of data history
|
|
|
|
|
- Identical results to traditional batch calculations
|
|
|
|
|
- Warm-up detection for reliable indicator values
|
|
|
|
|
|
|
|
|
|
Classes:
|
|
|
|
|
IndicatorState: Abstract base class for all indicator states
|
|
|
|
|
MovingAverageState: Incremental moving average calculation
|
2025-05-28 23:18:11 +08:00
|
|
|
ExponentialMovingAverageState: Incremental exponential moving average calculation
|
2025-05-26 13:26:07 +08:00
|
|
|
RSIState: Incremental RSI calculation
|
2025-05-28 23:18:11 +08:00
|
|
|
SimpleRSIState: Incremental simple RSI calculation
|
2025-05-26 13:26:07 +08:00
|
|
|
ATRState: Incremental Average True Range calculation
|
2025-05-28 23:18:11 +08:00
|
|
|
SimpleATRState: Incremental simple ATR calculation
|
2025-05-26 13:26:07 +08:00
|
|
|
SupertrendState: Incremental Supertrend calculation
|
|
|
|
|
BollingerBandsState: Incremental Bollinger Bands calculation
|
2025-05-28 23:18:11 +08:00
|
|
|
BollingerBandsOHLCState: Incremental Bollinger Bands OHLC calculation
|
2025-05-26 13:26:07 +08:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from .base import IndicatorState
|
2025-05-28 23:18:11 +08:00
|
|
|
from .moving_average import MovingAverageState, ExponentialMovingAverageState
|
|
|
|
|
from .rsi import RSIState, SimpleRSIState
|
|
|
|
|
from .atr import ATRState, SimpleATRState
|
2025-05-26 13:26:07 +08:00
|
|
|
from .supertrend import SupertrendState
|
2025-05-28 23:18:11 +08:00
|
|
|
from .bollinger_bands import BollingerBandsState, BollingerBandsOHLCState
|
2025-05-26 13:26:07 +08:00
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
'IndicatorState',
|
|
|
|
|
'MovingAverageState',
|
2025-05-28 23:18:11 +08:00
|
|
|
'ExponentialMovingAverageState',
|
2025-05-26 13:26:07 +08:00
|
|
|
'RSIState',
|
2025-05-28 23:18:11 +08:00
|
|
|
'SimpleRSIState',
|
2025-05-26 13:26:07 +08:00
|
|
|
'ATRState',
|
2025-05-28 23:18:11 +08:00
|
|
|
'SimpleATRState',
|
2025-05-26 13:26:07 +08:00
|
|
|
'SupertrendState',
|
2025-05-28 23:18:11 +08:00
|
|
|
'BollingerBandsState',
|
|
|
|
|
'BollingerBandsOHLCState'
|
2025-05-26 13:26:07 +08:00
|
|
|
]
|