OPEN-SOURCE SCRIPT
Hurst ALMA Tuned Chandelier Exit

Hurst × ALMA Tuned Chandelier Exit (HurstALMA-CE)
Public Description
Hurst × ALMA Tuned Chandelier Exit (HurstALMA-CE) is an adaptive trend‑following stop and exit indicator. It combines a smoothed price input (ALMA), a regime detector based on the Hurst exponent, and a dynamically tuned Chandelier Exit to automatically adjust its behavior between choppy and trending market conditions.
Instead of using a single fixed Chandelier configuration, the indicator continuously measures whether price action is behaving more like noise or a persistent trend. In choppy markets, it becomes more conservative by using shorter lookbacks and wider ATR multiples to reduce whipsaws. In trending markets, it tightens the stop and extends the lookback to better lock in gains while staying aligned with the trend.
The result is a regime‑aware trailing exit that adapts in real time, helping traders stay in strong trends longer while avoiding over‑sensitivity during sideways price action. HurstALMA‑CE can be used as a visual trailing stop, a trend confirmation overlay, or as an exit engine inside discretionary or systematic strategies.
Quantitative Description
1. Input Series
Price is optionally pre‑filtered using an Arnaud Legoux Moving Average (ALMA), defined by length, offset, and sigma parameters. This smoothed series is used as the input to the Hurst estimator to reduce high‑frequency noise.
2. Hurst Exponent Proxy
The indicator estimates the Hurst exponent using a variance‑scaling method. For fixed lags (8, 16, 32, 64), price differences are computed and their variances are measured over a rolling lookback window. A log‑log regression of variance versus lag produces a slope, which is mapped to a Hurst estimate via:
H ≈ 0.5 × slope.
The raw estimate is smoothed using an EMA to improve stability.
3. Regime Weight Mapping
The smoothed Hurst value is linearly mapped into a normalized weight w ∈ [0, 1] using user‑defined low‑H (choppy) and high‑H (trending) thresholds. Values below the low threshold map to w = 0, values above the high threshold map to w = 1.
4. Adaptive Chandelier Parameters
The Chandelier Exit length and ATR multiplier are interpolated between two parameter sets:
• Chop regime (shorter length, wider multiplier)
• Trend regime (longer length, tighter multiplier)
Interpolation is performed as:
CE_len = CE_len_chop + w × (CE_len_trend − CE_len_chop)
CE_mult = CE_mult_chop + w × (CE_mult_trend − CE_mult_chop)
Before sufficient data is available for the Hurst calculation, fallback Chandelier parameters are used.
5. Output
The final output consists of long and short Chandelier Exit levels computed using the dynamically tuned parameters. Optional status values expose the current Hurst estimate, regime weight, and active Chandelier settings for diagnostics and strategy development.
Public Description
Hurst × ALMA Tuned Chandelier Exit (HurstALMA-CE) is an adaptive trend‑following stop and exit indicator. It combines a smoothed price input (ALMA), a regime detector based on the Hurst exponent, and a dynamically tuned Chandelier Exit to automatically adjust its behavior between choppy and trending market conditions.
Instead of using a single fixed Chandelier configuration, the indicator continuously measures whether price action is behaving more like noise or a persistent trend. In choppy markets, it becomes more conservative by using shorter lookbacks and wider ATR multiples to reduce whipsaws. In trending markets, it tightens the stop and extends the lookback to better lock in gains while staying aligned with the trend.
The result is a regime‑aware trailing exit that adapts in real time, helping traders stay in strong trends longer while avoiding over‑sensitivity during sideways price action. HurstALMA‑CE can be used as a visual trailing stop, a trend confirmation overlay, or as an exit engine inside discretionary or systematic strategies.
Quantitative Description
1. Input Series
Price is optionally pre‑filtered using an Arnaud Legoux Moving Average (ALMA), defined by length, offset, and sigma parameters. This smoothed series is used as the input to the Hurst estimator to reduce high‑frequency noise.
2. Hurst Exponent Proxy
The indicator estimates the Hurst exponent using a variance‑scaling method. For fixed lags (8, 16, 32, 64), price differences are computed and their variances are measured over a rolling lookback window. A log‑log regression of variance versus lag produces a slope, which is mapped to a Hurst estimate via:
H ≈ 0.5 × slope.
The raw estimate is smoothed using an EMA to improve stability.
3. Regime Weight Mapping
The smoothed Hurst value is linearly mapped into a normalized weight w ∈ [0, 1] using user‑defined low‑H (choppy) and high‑H (trending) thresholds. Values below the low threshold map to w = 0, values above the high threshold map to w = 1.
4. Adaptive Chandelier Parameters
The Chandelier Exit length and ATR multiplier are interpolated between two parameter sets:
• Chop regime (shorter length, wider multiplier)
• Trend regime (longer length, tighter multiplier)
Interpolation is performed as:
CE_len = CE_len_chop + w × (CE_len_trend − CE_len_chop)
CE_mult = CE_mult_chop + w × (CE_mult_trend − CE_mult_chop)
Before sufficient data is available for the Hurst calculation, fallback Chandelier parameters are used.
5. Output
The final output consists of long and short Chandelier Exit levels computed using the dynamically tuned parameters. Optional status values expose the current Hurst estimate, regime weight, and active Chandelier settings for diagnostics and strategy development.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。