OPEN-SOURCE SCRIPT
Intraday Regime Classifier

Intraday Regime Classifier helps traders identify whether the current market is trending, rotating, or choppy so they can better match strategy to conditions. It is designed as a context and trade-filtering tool for intraday trading, not as a standalone entry system.
The goal is to improve decision-making by matching strategy to conditions. Trend-following setups tend to work better in directional environments, while fade, reversal, or LVN-based setups often work better in rotational or two-sided sessions. This indicator helps traders avoid forcing the wrong setup in the wrong regime.
It is not meant to predict exact highs or lows. It is a context tool. Think of it as a market filter that helps answer a simple question: what kind of day am I dealing with right now?
What the indicator does
The script evaluates intraday price behavior and classifies the market into a regime based on factors such as:
directional movement
trend strength
expansion vs compression
volatility conditions
whether price is behaving more like a breakout market or a rotational market
In practical terms, it helps with three things:
Strategy selection
It helps you decide whether to trade continuation, mean reversion, break-and-retest, or just stay patient.
Trade filtering
It can keep you out of low-quality conditions where your setup usually underperforms.
Expectations
It helps you frame the day correctly. On a trend day, you expect pullbacks to hold. On a rotational day, you expect breakouts to fail more often.
How to use it
The best way to use the indicator is as a market filter, not as a standalone entry signal.
A simple framework:
When the indicator shows a trend regime, favor breakout, pullback, and continuation setups.
When the indicator shows a mean reversion or rotational regime, favor fades, reversals, LVN reactions, and range trades.
When the indicator shows neutral or mixed conditions, reduce size, be more selective, or wait for cleaner structure.
This can be especially useful intraday because market behavior often shifts during the session. The open may trend, mid-session may chop, and the afternoon may expand again. The indicator is there to help you adapt rather than assume the same playbook works all day.
Trend
A trend regime means price is moving directionally with enough strength and consistency to favor continuation-style trades. In this environment, pullbacks are more likely to be pauses than full reversals.
Best suited for:
breakouts, pullbacks, trend continuation, break-and-retest setups
Mean reversion / rotational
A mean reversion regime means price is rotating, trading two-sided, or returning toward value rather than accepting higher or lower prices cleanly. Breakouts are more likely to fail and reversals tend to work better.
Best suited for:
fades, reversals, LVN reactions, support/resistance bounces, scalp-style rotation trades
Neutral / mixed / chop
A neutral regime means the market is not showing a strong directional edge or a clean rotational structure. These conditions often produce false starts and lower-quality setups.
Best suited for:
patience, reduced size, waiting for confirmation, or standing aside
Input settings explained:
Lookback length
This controls how much recent data the indicator uses to classify market conditions.
Lower values make the indicator more responsive, but also more sensitive and noisy.
Higher values make it smoother and more stable, but slower to react.
Use shorter settings if you want faster intraday shifts. Use longer settings if you want a steadier read on the session.
Trend threshold
This controls how strong price movement must be before the market is classified as trending.
Lower threshold = easier to label conditions as trend
Higher threshold = requires stronger directional evidence
If the indicator is flipping into trend mode too often, raise this setting. If it feels too slow to recognize real trend days, lower it slightly.
Mean reversion / chop threshold
This controls how easily the script classifies the market as balanced, rotational, or non-trending.
Lower values may classify more sessions as rotational
Higher values may reduce chop signals and keep the script more selective
This is useful if you want to better separate true trend from noisy two-sided trading.
Volatility filter
This adjusts how much the script accounts for current range or expansion conditions.
Higher volatility settings usually demand more movement before a regime shift
Lower settings usually make the script react faster during quieter sessions
This helps normalize the classifier across different types of days.
Smoothing
Smoothing reduces noise and prevents the classification from changing too quickly.
More smoothing = cleaner output, slower changes
Less smoothing = faster output, more flips
If you are using the indicator for higher-confidence context, more smoothing usually helps. If you want fast adaptation, reduce smoothing.
Session filter
If your script includes a session input, this limits calculations to a specific trading session, such as New York hours.
This is useful because intraday behavior often changes a lot outside the main session. Restricting calculations to the primary session can produce more relevant classifications.
Display options
These settings usually control things like:
background colors
labels
regime text
plots
alerts
These do not change the underlying logic. They only affect how the information is displayed on the chart.
The goal is to improve decision-making by matching strategy to conditions. Trend-following setups tend to work better in directional environments, while fade, reversal, or LVN-based setups often work better in rotational or two-sided sessions. This indicator helps traders avoid forcing the wrong setup in the wrong regime.
It is not meant to predict exact highs or lows. It is a context tool. Think of it as a market filter that helps answer a simple question: what kind of day am I dealing with right now?
What the indicator does
The script evaluates intraday price behavior and classifies the market into a regime based on factors such as:
directional movement
trend strength
expansion vs compression
volatility conditions
whether price is behaving more like a breakout market or a rotational market
In practical terms, it helps with three things:
Strategy selection
It helps you decide whether to trade continuation, mean reversion, break-and-retest, or just stay patient.
Trade filtering
It can keep you out of low-quality conditions where your setup usually underperforms.
Expectations
It helps you frame the day correctly. On a trend day, you expect pullbacks to hold. On a rotational day, you expect breakouts to fail more often.
How to use it
The best way to use the indicator is as a market filter, not as a standalone entry signal.
A simple framework:
When the indicator shows a trend regime, favor breakout, pullback, and continuation setups.
When the indicator shows a mean reversion or rotational regime, favor fades, reversals, LVN reactions, and range trades.
When the indicator shows neutral or mixed conditions, reduce size, be more selective, or wait for cleaner structure.
This can be especially useful intraday because market behavior often shifts during the session. The open may trend, mid-session may chop, and the afternoon may expand again. The indicator is there to help you adapt rather than assume the same playbook works all day.
Trend
A trend regime means price is moving directionally with enough strength and consistency to favor continuation-style trades. In this environment, pullbacks are more likely to be pauses than full reversals.
Best suited for:
breakouts, pullbacks, trend continuation, break-and-retest setups
Mean reversion / rotational
A mean reversion regime means price is rotating, trading two-sided, or returning toward value rather than accepting higher or lower prices cleanly. Breakouts are more likely to fail and reversals tend to work better.
Best suited for:
fades, reversals, LVN reactions, support/resistance bounces, scalp-style rotation trades
Neutral / mixed / chop
A neutral regime means the market is not showing a strong directional edge or a clean rotational structure. These conditions often produce false starts and lower-quality setups.
Best suited for:
patience, reduced size, waiting for confirmation, or standing aside
Input settings explained:
Lookback length
This controls how much recent data the indicator uses to classify market conditions.
Lower values make the indicator more responsive, but also more sensitive and noisy.
Higher values make it smoother and more stable, but slower to react.
Use shorter settings if you want faster intraday shifts. Use longer settings if you want a steadier read on the session.
Trend threshold
This controls how strong price movement must be before the market is classified as trending.
Lower threshold = easier to label conditions as trend
Higher threshold = requires stronger directional evidence
If the indicator is flipping into trend mode too often, raise this setting. If it feels too slow to recognize real trend days, lower it slightly.
Mean reversion / chop threshold
This controls how easily the script classifies the market as balanced, rotational, or non-trending.
Lower values may classify more sessions as rotational
Higher values may reduce chop signals and keep the script more selective
This is useful if you want to better separate true trend from noisy two-sided trading.
Volatility filter
This adjusts how much the script accounts for current range or expansion conditions.
Higher volatility settings usually demand more movement before a regime shift
Lower settings usually make the script react faster during quieter sessions
This helps normalize the classifier across different types of days.
Smoothing
Smoothing reduces noise and prevents the classification from changing too quickly.
More smoothing = cleaner output, slower changes
Less smoothing = faster output, more flips
If you are using the indicator for higher-confidence context, more smoothing usually helps. If you want fast adaptation, reduce smoothing.
Session filter
If your script includes a session input, this limits calculations to a specific trading session, such as New York hours.
This is useful because intraday behavior often changes a lot outside the main session. Restricting calculations to the primary session can produce more relevant classifications.
Display options
These settings usually control things like:
background colors
labels
regime text
plots
alerts
These do not change the underlying logic. They only affect how the information is displayed on the chart.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.