fix: keep paper trading active without approved model

This commit is contained in:
Курнат Андрей
2026-07-15 00:23:03 +03:00
parent 1f2fb011a7
commit d0869b5d29
10 changed files with 188 additions and 14 deletions
+6
View File
@@ -171,6 +171,7 @@ class Settings:
storage_prune_interval_seconds: int = 3600
bybit_rest_base_url_override: str = ""
bybit_websocket_url_override: str = ""
time_series_fallback_mode: str = "trend_macd"
@property
def rest_base_url(self) -> str:
@@ -354,6 +355,9 @@ def load_settings(env_file: str | Path | None = None) -> Settings:
"" if _bool_env("BYBIT_TESTNET", False) else "https://api.bybit.kz",
).strip(),
bybit_websocket_url_override=os.getenv("BYBIT_WEBSOCKET_URL", "").strip(),
time_series_fallback_mode=os.getenv(
"TIME_SERIES_FALLBACK_MODE", "trend_macd"
).strip().lower(),
)
_validate_settings(settings)
if settings.trading_mode == "live" and not settings.live_ready:
@@ -390,6 +394,8 @@ def _validate_settings(settings: Settings) -> None:
errors.append("LIVE_ORDER_FILL_TIMEOUT_SECONDS must be positive")
if settings.live_reconciliation_interval_seconds <= 0:
errors.append("LIVE_RECONCILIATION_INTERVAL_SECONDS must be positive")
if settings.time_series_fallback_mode not in {"trend_macd", "legacy"}:
errors.append("TIME_SERIES_FALLBACK_MODE must be trend_macd or legacy")
if errors:
raise ValueError("; ".join(errors))