PROTECTED SOURCE SCRIPT
OB/OS Environment MTF

This indicator identifies overbought and oversold price environments — not reversal signals — using a multi-timeframe regime filter combined with volatility-adjusted stretch and confluence logic.
The goal is to highlight when price is objectively extended relative to trend, so traders can:
reduce chasing,
size appropriately,
manage risk,
or look for mean-reversion / pause scenarios without assuming a top or bottom.
How it works
1. Higher-Timeframe Regime (Stable)
Intraday charts → Daily regime
Daily charts → Weekly regime
Weekly charts → Monthly regime
Monthly charts → Monthly regime
Regime is determined using HTF close vs HTF EMA (optionally slope-filtered).
This keeps environments stable and avoids intrabar regime flipping.
2. Volatility-Adjusted Stretch
Price extension is measured as:
distance from EMA
normalized by ATR (z = (price − EMA) / ATR)
This allows the same logic to work across:
5m / 30m / 1h
Daily / Weekly / Monthly
3. Confluence Scoring (N-of-M)
An OB/OS environment only triggers when stretch and a minimum number of confirmations are present:
RSI extreme
Bollinger %B excursion
Stretch percentile vs its own history
Large candle relative to ATR
User-configurable confirmation count helps reduce noise.
4. Environment State (Sticky)
Once an overbought or oversold environment is detected:
the state persists until price decompresses or regime breaks
optional background shading visualizes the environment
arrows mark entry into the environment (not exits)
What this is / is not
This is:
an environment/context tool
multi-timeframe aware
volatility-normalized
designed to work across assets and timeframes
This is NOT:
a buy/sell signal
a reversal system
predictive of timing tops or bottoms
Strong trends can remain overbought/oversold for extended periods — by design.
Best use cases:
Risk management in strong trends
Avoiding late entries
Scaling decisions
Mean-reversion setups with confirmation
Context for options traders (IV, spreads, diagonals)
Feedback welcome
This is an early public release.
I’m specifically interested in feedback on:
confluence logic
regime behavior
parameter defaults by timeframe
false positives vs missed environments
If you have ideas or improvements, please comment — especially if you test across multiple markets or higher timeframes.
The goal is to highlight when price is objectively extended relative to trend, so traders can:
reduce chasing,
size appropriately,
manage risk,
or look for mean-reversion / pause scenarios without assuming a top or bottom.
How it works
1. Higher-Timeframe Regime (Stable)
Intraday charts → Daily regime
Daily charts → Weekly regime
Weekly charts → Monthly regime
Monthly charts → Monthly regime
Regime is determined using HTF close vs HTF EMA (optionally slope-filtered).
This keeps environments stable and avoids intrabar regime flipping.
2. Volatility-Adjusted Stretch
Price extension is measured as:
distance from EMA
normalized by ATR (z = (price − EMA) / ATR)
This allows the same logic to work across:
5m / 30m / 1h
Daily / Weekly / Monthly
3. Confluence Scoring (N-of-M)
An OB/OS environment only triggers when stretch and a minimum number of confirmations are present:
RSI extreme
Bollinger %B excursion
Stretch percentile vs its own history
Large candle relative to ATR
User-configurable confirmation count helps reduce noise.
4. Environment State (Sticky)
Once an overbought or oversold environment is detected:
the state persists until price decompresses or regime breaks
optional background shading visualizes the environment
arrows mark entry into the environment (not exits)
What this is / is not
This is:
an environment/context tool
multi-timeframe aware
volatility-normalized
designed to work across assets and timeframes
This is NOT:
a buy/sell signal
a reversal system
predictive of timing tops or bottoms
Strong trends can remain overbought/oversold for extended periods — by design.
Best use cases:
Risk management in strong trends
Avoiding late entries
Scaling decisions
Mean-reversion setups with confirmation
Context for options traders (IV, spreads, diagonals)
Feedback welcome
This is an early public release.
I’m specifically interested in feedback on:
confluence logic
regime behavior
parameter defaults by timeframe
false positives vs missed environments
If you have ideas or improvements, please comment — especially if you test across multiple markets or higher timeframes.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.