07.4.4.1.5 — Runtime Window Cleanup & Symbol Lifecycle Isolation

This commit is contained in:
2026-05-11 12:06:00 +03:00
parent 363719cc8e
commit e17f847603
10 changed files with 323 additions and 14 deletions

View File

@@ -22,6 +22,20 @@ class TrendStrategy:
# основной таймфрейм анализа рынка
_market_interval = "5m"
def reset_runtime(self, symbol: str | None = None) -> None:
if symbol is None:
self._price_window.clear()
return
normalized_symbol = symbol.upper()
keys_to_delete = [
key for key in self._price_window.keys()
if key.upper() == normalized_symbol
]
for key in keys_to_delete:
self._price_window.pop(key, None)
def analyze(self, context: StrategyContext) -> SignalResult:
market = MarketAnalysisService().analyze(
context.symbol,