Remove legacy LSTM retraining
This commit is contained in:
@@ -66,9 +66,6 @@ def make_settings():
|
||||
time_series_min_edge_percent=0.04,
|
||||
time_series_max_adjustment=0.08,
|
||||
time_series_lstm_enabled=True,
|
||||
time_series_lstm_lookback=32,
|
||||
time_series_lstm_units=6,
|
||||
time_series_lstm_ridge=0.0001,
|
||||
time_series_lstm_model_path=tmp_path / "lstm_forecaster.json",
|
||||
stop_loss_percent=0.02,
|
||||
take_profit_percent=0.035,
|
||||
|
||||
+16
-1
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from crypto_spot_bot.config import load_settings
|
||||
from crypto_spot_bot.config import FIXED_SPOT_SYMBOLS, load_settings
|
||||
|
||||
|
||||
def test_live_mode_requires_explicit_unlock(tmp_path, monkeypatch) -> None:
|
||||
@@ -61,3 +61,18 @@ def test_llm_advisor_is_disabled_by_default(tmp_path, monkeypatch) -> None:
|
||||
settings = load_settings(env_file)
|
||||
|
||||
assert settings.llm_advisor_enabled is False
|
||||
|
||||
|
||||
def test_default_symbols_are_fixed_six_pairs(tmp_path, monkeypatch) -> None:
|
||||
monkeypatch.delenv("AUTO_SELECT_SYMBOLS", raising=False)
|
||||
monkeypatch.delenv("TOP_SYMBOLS_COUNT", raising=False)
|
||||
monkeypatch.delenv("SYMBOLS", raising=False)
|
||||
monkeypatch.setenv("TRADING_MODE", "paper")
|
||||
env_file = tmp_path / ".env"
|
||||
env_file.write_text("TRADING_MODE=paper\nSYMBOLS=\n", encoding="utf-8")
|
||||
|
||||
settings = load_settings(env_file)
|
||||
|
||||
assert settings.auto_select_symbols is False
|
||||
assert settings.top_symbols_count == 6
|
||||
assert settings.symbols == FIXED_SPOT_SYMBOLS
|
||||
|
||||
@@ -76,32 +76,13 @@ def test_time_series_forecaster_blocks_negative_edge(make_settings, tmp_path) ->
|
||||
assert forecast.block_entry is True
|
||||
|
||||
|
||||
def test_time_series_forecaster_includes_lstm_candidate(make_settings, tmp_path) -> None:
|
||||
settings = make_settings(
|
||||
tmp_path,
|
||||
time_series_min_candles=80,
|
||||
time_series_validation_window=20,
|
||||
time_series_lstm_enabled=True,
|
||||
time_series_lstm_lookback=12,
|
||||
time_series_lstm_units=4,
|
||||
)
|
||||
returns = []
|
||||
for index in range(140):
|
||||
seasonal = 0.00018 if index % 5 in {0, 1, 2} else -0.00011
|
||||
returns.append(seasonal + 0.00002 * ((index % 7) - 3))
|
||||
|
||||
forecast = TimeSeriesForecaster(settings).forecast(_candles_from_returns(returns), symbol="BTCUSDT")
|
||||
|
||||
assert forecast.usable is True
|
||||
assert any(candidate["model"] == "lstm" for candidate in forecast.candidates)
|
||||
|
||||
|
||||
def test_time_series_forecaster_reads_lstm_artifact(make_settings, tmp_path) -> None:
|
||||
def test_time_series_forecaster_ignores_legacy_lstm_artifact(make_settings, tmp_path) -> None:
|
||||
artifact_path = tmp_path / "lstm_forecaster.json"
|
||||
artifact_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"version": 1,
|
||||
"type": "lstm_reservoir_ridge_params",
|
||||
"symbols": {
|
||||
"BTCUSDT": {"lookback": 10, "units": 3, "ridge": 0.01},
|
||||
},
|
||||
@@ -121,7 +102,7 @@ def test_time_series_forecaster_reads_lstm_artifact(make_settings, tmp_path) ->
|
||||
forecast = TimeSeriesForecaster(settings).forecast(_candles_from_returns(returns), symbol="BTCUSDT")
|
||||
|
||||
assert forecast.usable is True
|
||||
assert any(candidate["model"] == "lstm" for candidate in forecast.candidates)
|
||||
assert all(candidate["model"] != "lstm" for candidate in forecast.candidates)
|
||||
|
||||
|
||||
def test_time_series_forecaster_reads_torch_gru_artifact(make_settings, tmp_path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user