PROTECTED SOURCE SCRIPT
Hemera Regime Switch PRO v1.1

Hemera Regime Switch PRO v1.1
Hemera Regime Switch PRO v1.1 is a market regime classification tool designed to help traders identify the current market environment before selecting execution strategies.
Rather than generating direct trade signals, the script evaluates multiple structural and volatility-based conditions to classify price behavior into distinct regimes. The primary objective is to support decision-making by providing context about market structure.
Design Philosophy — Why Multiple Components Are Combined
Market regimes cannot be reliably identified using a single indicator. Each analytical component measures a different dimension of price action:
EMA(200) positioning defines directional bias.
EMA slope percentage evaluates structural trend momentum over a defined lookback period.
ADX measures trend strength independently from direction.
Bollinger Band Width% identifies volatility compression and expansion phases.
ATR% normalized to price evaluates relative volatility conditions.
The regime classification is produced by combining these factors into a unified framework, allowing the script to distinguish between structural market states rather than isolated signals.
Regime Classification Logic
The script continuously evaluates conditions and assigns one of four regimes:
SQUEEZE
Detected when Bollinger Band Width% falls below a compression threshold. This reflects reduced volatility and consolidation conditions.
EXPANSION
Assigned when Bollinger Band Width% exceeds a defined expansion threshold, indicating increased volatility and directional movement potential.
TREND
Detected when ADX exceeds the trend threshold and EMA slope confirms directional strength, while compression conditions are absent.
RANGE
Assigned when neither trend nor expansion conditions are met, suggesting a more balanced or mean-reverting environment.
Squeeze Box Structure (Non-Repainting Logic)
When compression conditions are detected:
The script builds a dynamic Squeeze Box using confirmed bar data.
The box tracks consolidation boundaries and extends forward after compression ends.
Breakout detection occurs only after confirmed candle closes to reduce false triggers.
This workflow is designed to emphasize structural observation rather than predictive signals.
Breakout and Retest Detection
After a confirmed breakout:
Breakout direction is recorded.
A configurable retest window allows identification of structural retests when price revisits breakout levels and holds.
This provides a structured sequence:
Compression → Breakout → Retest → Continuation evaluation.
Multi-Timeframe Alignment (v1.1)
Version 1.1 introduces higher timeframe alignment:
Current timeframe bias (price relative to EMA)
Higher timeframe bias using EMA comparison via request.security
Alignment states:
STRONG BULL — both timeframes bullish
STRONG BEAR — both timeframes bearish
MIXED — timeframes disagree
This feature is intended to visualize directional context across timeframes.
Confidence Score
A confidence value (0–100) is derived from weighted internal conditions, including regime classification, ADX strength, and volatility state.
The score reflects contextual agreement between internal metrics rather than predictive probability.
Dashboard Panel
The integrated panel displays:
Current regime classification
Directional bias
Strategy context (“playbook” guidance)
Multi-timeframe alignment
ADX and EMA slope
Bollinger Band Width%
ATR-based volatility state
Confidence score
Alerts
Available alert conditions include:
Squeeze breakout events
Breakout retest confirmations
Generic regime changes
Specific regime transitions (e.g., Squeeze → Expansion)
Alerts are generated using confirmed bar logic.
Intended Use
This tool is designed for traders who want to:
Identify market structure before choosing strategy type
Avoid trend-following during range or compression conditions
Observe volatility transitions and structural breakouts.
Disclaimer
This script is provided for educational and informational purposes only. It does not constitute financial advice or guarantee trading results. Trading involves risk and users are responsible for their own decisions and risk management.
Hemera Regime Switch PRO v1.1 is a market regime classification tool designed to help traders identify the current market environment before selecting execution strategies.
Rather than generating direct trade signals, the script evaluates multiple structural and volatility-based conditions to classify price behavior into distinct regimes. The primary objective is to support decision-making by providing context about market structure.
Design Philosophy — Why Multiple Components Are Combined
Market regimes cannot be reliably identified using a single indicator. Each analytical component measures a different dimension of price action:
EMA(200) positioning defines directional bias.
EMA slope percentage evaluates structural trend momentum over a defined lookback period.
ADX measures trend strength independently from direction.
Bollinger Band Width% identifies volatility compression and expansion phases.
ATR% normalized to price evaluates relative volatility conditions.
The regime classification is produced by combining these factors into a unified framework, allowing the script to distinguish between structural market states rather than isolated signals.
Regime Classification Logic
The script continuously evaluates conditions and assigns one of four regimes:
SQUEEZE
Detected when Bollinger Band Width% falls below a compression threshold. This reflects reduced volatility and consolidation conditions.
EXPANSION
Assigned when Bollinger Band Width% exceeds a defined expansion threshold, indicating increased volatility and directional movement potential.
TREND
Detected when ADX exceeds the trend threshold and EMA slope confirms directional strength, while compression conditions are absent.
RANGE
Assigned when neither trend nor expansion conditions are met, suggesting a more balanced or mean-reverting environment.
Squeeze Box Structure (Non-Repainting Logic)
When compression conditions are detected:
The script builds a dynamic Squeeze Box using confirmed bar data.
The box tracks consolidation boundaries and extends forward after compression ends.
Breakout detection occurs only after confirmed candle closes to reduce false triggers.
This workflow is designed to emphasize structural observation rather than predictive signals.
Breakout and Retest Detection
After a confirmed breakout:
Breakout direction is recorded.
A configurable retest window allows identification of structural retests when price revisits breakout levels and holds.
This provides a structured sequence:
Compression → Breakout → Retest → Continuation evaluation.
Multi-Timeframe Alignment (v1.1)
Version 1.1 introduces higher timeframe alignment:
Current timeframe bias (price relative to EMA)
Higher timeframe bias using EMA comparison via request.security
Alignment states:
STRONG BULL — both timeframes bullish
STRONG BEAR — both timeframes bearish
MIXED — timeframes disagree
This feature is intended to visualize directional context across timeframes.
Confidence Score
A confidence value (0–100) is derived from weighted internal conditions, including regime classification, ADX strength, and volatility state.
The score reflects contextual agreement between internal metrics rather than predictive probability.
Dashboard Panel
The integrated panel displays:
Current regime classification
Directional bias
Strategy context (“playbook” guidance)
Multi-timeframe alignment
ADX and EMA slope
Bollinger Band Width%
ATR-based volatility state
Confidence score
Alerts
Available alert conditions include:
Squeeze breakout events
Breakout retest confirmations
Generic regime changes
Specific regime transitions (e.g., Squeeze → Expansion)
Alerts are generated using confirmed bar logic.
Intended Use
This tool is designed for traders who want to:
Identify market structure before choosing strategy type
Avoid trend-following during range or compression conditions
Observe volatility transitions and structural breakouts.
Disclaimer
This script is provided for educational and informational purposes only. It does not constitute financial advice or guarantee trading results. Trading involves risk and users are responsible for their own decisions and risk management.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.