Separate chart S/R from gate target ladder
This commit is contained in:
@@ -942,12 +942,16 @@ def test_window_setups_routes_explicit_range_grid(
|
||||
def test_window_setups_routes_full_explicit_target_ladder(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_detector(*args, **kwargs):
|
||||
captured.update(kwargs)
|
||||
def fake_detector(highs, lows, closes):
|
||||
captured.update({
|
||||
"highs": highs,
|
||||
"lows": lows,
|
||||
"closes": closes,
|
||||
})
|
||||
return []
|
||||
|
||||
monkeypatch.setenv("BACKTEST_SR_VARIANT", bt.EXPLICIT_TARGET_LADDER_VARIANT)
|
||||
monkeypatch.setattr(bt, "detect_sr_levels_legacy", fake_detector)
|
||||
monkeypatch.setattr(bt, "detect_gate_target_ladder", fake_detector)
|
||||
records = [
|
||||
SimpleNamespace(
|
||||
date=date(2024, 1, 1) + timedelta(days=i),
|
||||
@@ -961,7 +965,11 @@ def test_window_setups_routes_full_explicit_target_ladder(monkeypatch):
|
||||
]
|
||||
|
||||
assert bt._window_setups(records, {}, {}) == []
|
||||
assert captured == {"explicit_range_grid": True}
|
||||
assert captured == {
|
||||
"highs": [101.0] * bt.MIN_LOOKBACK,
|
||||
"lows": [99.0] * bt.MIN_LOOKBACK,
|
||||
"closes": [100.0] * bt.MIN_LOOKBACK,
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user