Strategy Guardrails/
Range Market Filter
TL;DR
The Range Market Filter is an optional guardrail that detects when an asset is oscillating in a directionless range — bouncing between horizontal support and resistance — rather than trending. In range conditions, breakout trades have a significantly higher failure rate, so the system either raises the minimum ranking threshold required to open a trade or blocks the trade entirely, depending on how severe the ranging behaviour is.
How It Works
- 1
Detection: The system continuously analyses three signals — ATR-based volatility (how small candle ranges are compared to historical average), range structure (how tightly price oscillates within a defined horizontal channel), and Market Cipher B momentum (absence of trending wave crossovers).
- 2
Severity tiers: When all three signals align, the market is classified as NO_RANGE, MODERATE_RANGE, or STRONG_RANGE. MODERATE_RANGE requires a minimum ranking score of B+ (70+). STRONG_RANGE requires A+ (80+).
- 3
Action when ENABLED: At MODERATE_RANGE, the trade ranking threshold is raised and maximum open positions are reduced to 2. At STRONG_RANGE, the trade is fully blocked as a guardrail violation and a notification is sent.
- 4
Action when DISABLED: Range detection still runs in the background for logging and analysis, but it has zero effect on whether a trade is approved or what ranking score is required — the user's own minimum ranking setting (e.g., C = 50+) is the sole threshold.
- 5
Ranking score type: Independently of the Range Market Filter, each user can choose whether the ranking score used for threshold comparisons is the Algo score (pure technical algorithm), the Agent score (AI reasoning), or the Hybrid average of both. This preference is stored per-user and respected throughout all validation checks.
- 6
Breakout signal: Even when the filter is active, a valid breakout above the range top (or below the range bottom) with strong displacement resets the severity back to NO_RANGE in the next cycle, allowing normal trading conditions to resume.
The Range Market Filter is configured individually per user in their strategy settings. The detection engine runs inside `validate_position_opening()` and calls `get_range_adaptive_parameters()` which combines Market Cipher B momentum analysis with ATR volatility and swing-structure metrics. When the filter is disabled, the system still logs the range detection result but explicitly skips any threshold override, applying only the user's own min_ranking setting (e.g., C = 50). When enabled and MODERATE_RANGE is detected, the minimum ranking threshold is raised to 70, and at STRONG_RANGE the trade is blocked outright with a guardrail notification. The ranking score type (agent / algo / hybrid) is resolved from the user's individual profile.