Cleanup retired S/R research scaffolding

- Remove unused _gate_eligible_levels filtering logic and its tests (research-only)
- Add prominent RESEARCH/DIAGNOSTIC markers and docs to clear-air/ATR fallback helpers
- Document production vs research BACKTEST_* environment variables in backtest_service
- Minor cleanups: update legacy report text, improve outdated function docstring
This commit is contained in:
2026-07-13 18:52:24 +02:00
parent 9f06304100
commit bddaeb9110
4 changed files with 33 additions and 79 deletions
-32
View File
@@ -56,38 +56,6 @@ def _clamp(value: float, low: float, high: float) -> float:
return max(low, min(high, value))
def _gate_eligible_levels(
sr_levels: list[Any],
*,
confirmed_rounds_only: bool = False,
exclude_standalone_rounds: bool = False,
min_round_rejections: int = 2,
) -> list[Any]:
"""Return structures allowed to influence entry qualification.
Round numbers remain useful visual landmarks, but an untouched standalone
round number is not observed market structure. Research variants can require
either confluence with a pivot/volume source or distinct rejection clusters
before such a level is allowed to manufacture a gate target.
"""
if not confirmed_rounds_only and not exclude_standalone_rounds:
return list(sr_levels)
eligible: list[Any] = []
for level in sr_levels:
sources = set(getattr(level, "sources", None) or [
getattr(level, "detection_method", "unknown")
])
is_round_only = sources == {"round_number"}
rejections = int(getattr(level, "rejection_count", 0) or 0)
if exclude_standalone_rounds and is_round_only:
continue
if confirmed_rounds_only and is_round_only and rejections < min_round_rejections:
continue
eligible.append(level)
return eligible
def _zone_representative_levels(
sr_levels: list[SRLevel],
entry_price: float,