OPEN-SOURCE SCRIPT
Aktualisiert Dynamic Volatility Bull/Bear Threshold

Overview
This indicator builds on Anton Kreil's (POTM) "drawdown-from-high" bull/bear framework and upgrades it into a volatility-adaptive version. It anchors to the rolling high (HH) and derives a dynamic bear level from annualized volatility (σ) and a multiple N: a close below it signals bear; reclaiming it while above the long-term MA signals bull.
Core logic
Rolling High HH: the highest high over the past lookback (default 252) bars — the anchor for every level.
Dynamic Bear Level: HH × (1 − N×σ). The drawdown threshold tightens when volatility is low and loosens when it is high (clamped to 5%~60%), so high-vol instruments never end up with a useless "dead line."
Fixed 20% Line: HH × 0.8, i.e. 20% below the high — the original course definition of a bear market, shown for comparison.
Confirm MA: the maLen (default 200) SMA of close, used to confirm trend recovery.
Signals & colors
🔻 Red triangle: close just broke below the dynamic bear level → Bear (Dynamic)
🟠 Orange circle: close just broke 20% below the rolling high → 20% Line Alert (course bear early-warning)
🟢 Green triangle: close reclaimed the dynamic level and crossed above the confirm MA → Bull Confirm
Background: Red = Bear, Green = Bull, Yellow = Recovering
Inputs
Lookback (default 252): window for σ and the rolling high
Vol multiple N (default 1.2): larger N = deeper bear threshold; 0.81.0 more sensitive, 1.82.0 only on crashes
Bull-confirm MA period (default 200)
Overlay fixed 20% line / Show confirm MA: toggles
How to use
Watch the red dynamic bear line as the primary signal; for the strict course rule "20% below high = bear," watch the orange circle. The yellow "Recovering" zone is often a good watch area for option positioning. This is a trend state machine, not a short-term entry signal.
Disclaimer
For research and education only. Not investment advice. Past performance does not guarantee future results.
This indicator builds on Anton Kreil's (POTM) "drawdown-from-high" bull/bear framework and upgrades it into a volatility-adaptive version. It anchors to the rolling high (HH) and derives a dynamic bear level from annualized volatility (σ) and a multiple N: a close below it signals bear; reclaiming it while above the long-term MA signals bull.
Core logic
Rolling High HH: the highest high over the past lookback (default 252) bars — the anchor for every level.
Dynamic Bear Level: HH × (1 − N×σ). The drawdown threshold tightens when volatility is low and loosens when it is high (clamped to 5%~60%), so high-vol instruments never end up with a useless "dead line."
Fixed 20% Line: HH × 0.8, i.e. 20% below the high — the original course definition of a bear market, shown for comparison.
Confirm MA: the maLen (default 200) SMA of close, used to confirm trend recovery.
Signals & colors
🔻 Red triangle: close just broke below the dynamic bear level → Bear (Dynamic)
🟠 Orange circle: close just broke 20% below the rolling high → 20% Line Alert (course bear early-warning)
🟢 Green triangle: close reclaimed the dynamic level and crossed above the confirm MA → Bull Confirm
Background: Red = Bear, Green = Bull, Yellow = Recovering
Inputs
Lookback (default 252): window for σ and the rolling high
Vol multiple N (default 1.2): larger N = deeper bear threshold; 0.81.0 more sensitive, 1.82.0 only on crashes
Bull-confirm MA period (default 200)
Overlay fixed 20% line / Show confirm MA: toggles
How to use
Watch the red dynamic bear line as the primary signal; for the strict course rule "20% below high = bear," watch the orange circle. The yellow "Recovering" zone is often a good watch area for option positioning. This is a trend state machine, not a short-term entry signal.
Disclaimer
For research and education only. Not investment advice. Past performance does not guarantee future results.
Versionshinweise
bug fixedOpen-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.