diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 18:45:12 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 18:45:12 +0900 |
| commit | cf02d18ea5e3f9357d6a02faac199f57e5daff77 (patch) | |
| tree | f36e0c6347520f6363da45479a80e6aa73ad986e /services/strategy-engine/strategies/indicators/volatility.py | |
| parent | cb55c81dbc43df83ef4d5b717fe22b4d04a93d2e (diff) | |
feat(strategy): Phase 2 complete — strategy infrastructure upgrade
- Technical indicators library (ATR, ADX, RSI, MACD, Bollinger, Stochastic, OBV)
- Signal model: conviction score, stop_loss, take_profit fields
- BaseStrategy: ADX regime filter, volume confirmation, ATR-based stops
- All 8 strategies upgraded with filters, conviction scoring, ATR stops
- Combined strategy uses conviction-weighted scoring
- 334 tests passing
Diffstat (limited to 'services/strategy-engine/strategies/indicators/volatility.py')
| -rw-r--r-- | services/strategy-engine/strategies/indicators/volatility.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/strategy-engine/strategies/indicators/volatility.py b/services/strategy-engine/strategies/indicators/volatility.py index d47eb86..c16143e 100644 --- a/services/strategy-engine/strategies/indicators/volatility.py +++ b/services/strategy-engine/strategies/indicators/volatility.py @@ -1,4 +1,5 @@ """Volatility indicators: ATR, Bollinger Bands, Keltner Channels.""" + import pandas as pd import numpy as np @@ -30,7 +31,7 @@ def atr( for i in range(period, n): atr_vals[i] = (atr_vals[i - 1] * (period - 1) + tr[i]) / period - return pd.Series(atr_vals, index=closes.index if hasattr(closes, 'index') else None) + return pd.Series(atr_vals, index=closes.index if hasattr(closes, "index") else None) def bollinger_bands( @@ -62,6 +63,7 @@ def keltner_channels( Returns: (upper_channel, middle_ema, lower_channel) """ from strategies.indicators.trend import ema as calc_ema + middle = calc_ema(closes, ema_period) atr_vals = atr(highs, lows, closes, atr_period) upper = middle + atr_multiplier * atr_vals |
