Covenant Regime Register [JOAT]Covenant Regime Register
Introduction
Covenant Regime Register is an open-source market context indicator that classifies whether price is currently behaving like a directional auction or a rotational auction. Instead of treating trend detection as a single yes-or-no output, the script builds two competing probability streams and continuously updates which state has stronger evidence.
The problem this indicator solves is context drift. Many tools are applied the same way in every environment even though trending conditions and ranging conditions reward very different decisions. Covenant Regime Register separates those environments first, then exposes confidence, directional efficiency, and bias so the trader can decide whether to lean into continuation logic or step back into rotation logic.
Core Concepts
1. Multi-factor regime observations
The regime engine does not rely on one input. It blends normalized returns, normalized volatility, directional efficiency, and slope persistence into a two-state regime model:
logReturn = math.log(close / nz(close , close))
realizedVol = ta.stdev(logReturn, volatilityLength)
efficiencyRatio = math.abs(close - close ) / math.sum(math.abs(ta.change(close)), efficiencyLength)
This keeps the classification grounded in both movement quality and volatility behavior.
2. Probabilistic state competition
Directional and rotational states each receive an emission score. Those scores are then smoothed through a persistence-heavy probability engine so the output does not flip on every small fluctuation:
posteriorTrend = emissionTrend * priorTrend
posteriorRange = emissionRange * priorRange
trendProb := trendProb + learningInput * (targetTrend - trendProb)
The result is a stable state register rather than a noisy binary switch.
3. Confidence-aware classification
The script only considers a regime confirmed when the dominant state exceeds the user-defined confidence threshold on a confirmed bar. This helps reduce false transitions during temporary turbulence.
4. Probability spread visualization
Trend probability and range probability are plotted together, while the spread between them is shaded as a separate area. This lets the user see whether the market is decisively one-sided or only marginally biased.
5. Institutional dashboard
The top-right dashboard reports current state, confirmation status, trend probability, range probability, efficiency, and directional bias using a restrained dark palette designed to stay readable on a clean chart.
Features
Two-state regime model: Directional auction versus rotational auction
Multi-factor classification: Uses returns, volatility, efficiency, and slope instead of a single oscillator threshold
Probability outputs: Trend and range are shown as separate probability streams
Confidence gate: Regimes are only considered confirmed above the user-defined threshold
Spread visualization: Shows the separation between the two competing states
Dark institutional dashboard: Compact top-right panel with current state and supporting metrics
Confirmed-bar regime alerts: Alerts only fire when a new regime is confirmed on bar close
Non-repainting design: Uses only current-timeframe information and confirmed-bar state transitions
Input Parameters
Regime Engine:
Return Lookback: Smoothing window for the return series
Volatility Lookback: Window used to normalize realized volatility
Efficiency Length: Measures directional travel versus rotational travel
Probability Learning: Controls how quickly the posterior probabilities adapt
Trend Confirmation Threshold: Minimum dominant probability required before a regime is treated as confirmed
Visual System:
Show Regime Backdrop
Show Probability Spread
Show State Ribbon
Show Dashboard
How to Use This Indicator
Step 1: Read the dominant state
If Trend Probability is above Range Probability and the confidence threshold is met, the market is behaving more directionally. If Range Probability dominates, the market is behaving more rotationally.
Step 2: Check confirmation
Use the confirmation state before treating the output as actionable. Developing readings can still change as the current bar closes.
Step 3: Use efficiency and bias together
High efficiency with strong directional bias supports continuation logic. Low efficiency with range dominance supports mean-reversion or lower-aggression decision making.
Step 4: Apply it as a filter
This indicator is best used as a context layer for other tools. It is not intended to predict the next bar by itself.
Indicator Limitations
Regime models classify the present environment; they do not forecast future direction
Extremely fast reversals can temporarily lower confidence before the new state stabilizes
Range and trend can overlap during transition periods, so marginal readings should be treated cautiously
Originality Statement
Covenant Regime Register is original in how it combines normalized return behavior, normalized volatility, directional efficiency, and slope persistence into a compact two-state probability register with an explicit confidence gate. It is published because:
The script produces competing regime probabilities rather than a single trend flag
The classification emphasizes state persistence and bar-close confirmation instead of hyper-reactive regime flipping
The dashboard surfaces regime context in a compact format suitable for use as a decision filter alongside other indicators
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice and does not guarantee future market behavior. All regime classifications are derived from historical and current price behavior and can produce false or delayed readings. Always use independent judgment and proper risk management.
مؤشر Pine Script®






















