07.4.4.1.5 — Runtime Window Cleanup & Symbol Lifecycle Isolation
This commit is contained in:
@@ -17,6 +17,27 @@ class StrategyRegistry:
|
||||
"SCALP": ScalpStrategy(),
|
||||
}
|
||||
|
||||
# сбросить runtime-память одной стратегии
|
||||
@classmethod
|
||||
def reset_runtime(
|
||||
cls,
|
||||
name: str | None = None,
|
||||
*,
|
||||
symbol: str | None = None,
|
||||
) -> None:
|
||||
if name:
|
||||
strategy = cls.get(name)
|
||||
strategy.reset_runtime(symbol)
|
||||
return
|
||||
|
||||
for strategy in cls._strategies.values():
|
||||
strategy.reset_runtime(symbol)
|
||||
|
||||
# сбросить runtime-память всех стратегий
|
||||
@classmethod
|
||||
def reset_all_runtime(cls) -> None:
|
||||
cls.reset_runtime()
|
||||
|
||||
# получить стратегию по имени
|
||||
@classmethod
|
||||
def get(cls, name: str | None) -> BaseStrategy:
|
||||
|
||||
Reference in New Issue
Block a user