OPEN-SOURCE SCRIPT
Adaptive Expansion Framework

Adaptive Expansion Framework (AEF)
AEF combines six classic volatility/structure concepts into one clean overlay so you can read market structure and expansion potential at a glance, without stacking five separate indicators.
WHAT IT COMBINES
1. Regression channel — a straight linear-regression channel (mid ± stdev) defines the prevailing structure and slope.
2. Equilibrium zone — an inner band around the regression line marks "fair value," helping separate mean-reversion from continuation context.
3. Volatility compression — Bollinger band-width is ranked as a percentile against its own lookback; when volatility coils into the lowest percentiles, the equilibrium band brightens and the chart gets a faint tint.
4. Range vs trend detection — Kaufman-style efficiency ratio plus slope classify the tape as Compression, Trending, or Ranging.
5. Breakout detection — a close beyond a channel wall, confirmed by range expansion (and optional volume), flags a breakout.
6. Expansion projection — on a confirmed break, a measured-move target (full channel height) is projected forward, with a 0–100 breakout-quality grade attached.
BREAKOUT QUALITY SCORE (0–100)
Each breakout is graded from four inputs: range expansion (35%), volume (25%), how compressed volatility was just before the break (25%), and how decisively price pierced the wall (15%). Grades A/B/C/D help filter weak or suspect breaks from clean ones.
DASHBOARD
Shows current regime, efficiency %, compression percentile, price position vs equilibrium, and the last signal with its quality grade.
HOW TO USE
- Use the regime label to pick context: fade extremes inside the channel when Ranging, look for breaks when Compression resolves.
- Treat the projection target as a reference level, not a guarantee.
- Higher-grade breakouts (A/B) that resolve a compression phase tend to be the cleaner setups; low-efficiency C/D breaks are more prone to fade.
KEY INPUTS
- Regression length: structural context window.
- Channel width (stdev x) and Equilibrium band: zone sizing.
- Compression percentile: how tight volatility must get to flag a setup.
- Trend efficiency threshold: range vs trend sensitivity.
- Breakout range x ATR / optional volume: how decisive a break must be.
BEHAVIOR ON THE LAST BAR
The channel, equilibrium band and projection are drawn on the most recent bar and update live. Breakout signals are evaluated on closing crosses, so on the currently forming (real-time) bar a signal can appear and disappear until the bar closes. Always confirm signals on closed bars before acting.
NOTES
This is an analysis tool, not a signal service. It does not predict price and is not financial advice. Test settings on your own instrument and timeframe before relying on it. Defaults are tuned for liquid index instruments on intraday timeframes (volume confirmation is off by default).
AEF combines six classic volatility/structure concepts into one clean overlay so you can read market structure and expansion potential at a glance, without stacking five separate indicators.
WHAT IT COMBINES
1. Regression channel — a straight linear-regression channel (mid ± stdev) defines the prevailing structure and slope.
2. Equilibrium zone — an inner band around the regression line marks "fair value," helping separate mean-reversion from continuation context.
3. Volatility compression — Bollinger band-width is ranked as a percentile against its own lookback; when volatility coils into the lowest percentiles, the equilibrium band brightens and the chart gets a faint tint.
4. Range vs trend detection — Kaufman-style efficiency ratio plus slope classify the tape as Compression, Trending, or Ranging.
5. Breakout detection — a close beyond a channel wall, confirmed by range expansion (and optional volume), flags a breakout.
6. Expansion projection — on a confirmed break, a measured-move target (full channel height) is projected forward, with a 0–100 breakout-quality grade attached.
BREAKOUT QUALITY SCORE (0–100)
Each breakout is graded from four inputs: range expansion (35%), volume (25%), how compressed volatility was just before the break (25%), and how decisively price pierced the wall (15%). Grades A/B/C/D help filter weak or suspect breaks from clean ones.
DASHBOARD
Shows current regime, efficiency %, compression percentile, price position vs equilibrium, and the last signal with its quality grade.
HOW TO USE
- Use the regime label to pick context: fade extremes inside the channel when Ranging, look for breaks when Compression resolves.
- Treat the projection target as a reference level, not a guarantee.
- Higher-grade breakouts (A/B) that resolve a compression phase tend to be the cleaner setups; low-efficiency C/D breaks are more prone to fade.
KEY INPUTS
- Regression length: structural context window.
- Channel width (stdev x) and Equilibrium band: zone sizing.
- Compression percentile: how tight volatility must get to flag a setup.
- Trend efficiency threshold: range vs trend sensitivity.
- Breakout range x ATR / optional volume: how decisive a break must be.
BEHAVIOR ON THE LAST BAR
The channel, equilibrium band and projection are drawn on the most recent bar and update live. Breakout signals are evaluated on closing crosses, so on the currently forming (real-time) bar a signal can appear and disappear until the bar closes. Always confirm signals on closed bars before acting.
NOTES
This is an analysis tool, not a signal service. It does not predict price and is not financial advice. Test settings on your own instrument and timeframe before relying on it. Defaults are tuned for liquid index instruments on intraday timeframes (volume confirmation is off by default).
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.