OPEN-SOURCE SCRIPT
MAD Supertrend ~ C H I P A

MAD Supertrend ~ C H I P A is a custom trend-following system that replaces the standard deviation core of a classic Supertrend with Median Absolute Deviation (MAD) — a robust volatility measure that ignores outlier wicks instead of inflating on them. The result is a trail that holds steady through shakeout spikes where stdev-based bands blow out and go blind.
It uses:
A user-selectable source and MAD length
A choice of MAD estimator — true Median-of-deviations for maximum robustness, or Mean for a slightly smoother read
Independent upper and lower MAD multipliers for asymmetric band control
A selectable centerline engine: raw Source for zero lag, Single Median, or a Double Median smoother that kills staircase artefacts without adding meaningful delay
A PSAR-style exit acceleration module — each new closing extreme in the trend tightens the exit trail by a configurable step, down to a user-defined floor
Supertrend ratchet logic with persistent trend state and clean flip detection
The exit acceleration is the key behavioural difference from a standard Supertrend: fresh trends begin at full band width, giving early moves room to survive shakeouts, while mature trends that keep printing new extremes are trailed progressively tighter — so extended runs are exited far closer to their peak. The trail only ever tightens mid-trend and fully resets on each flip.
Alerts fire on confirmed trend flips in both directions.
Note: MAD Supertrend is provided "as is" without formal robustness or optimization testing. Past performance is not indicative of future results; use in live trading only after sufficient back-testing and validation.
It uses:
A user-selectable source and MAD length
A choice of MAD estimator — true Median-of-deviations for maximum robustness, or Mean for a slightly smoother read
Independent upper and lower MAD multipliers for asymmetric band control
A selectable centerline engine: raw Source for zero lag, Single Median, or a Double Median smoother that kills staircase artefacts without adding meaningful delay
A PSAR-style exit acceleration module — each new closing extreme in the trend tightens the exit trail by a configurable step, down to a user-defined floor
Supertrend ratchet logic with persistent trend state and clean flip detection
The exit acceleration is the key behavioural difference from a standard Supertrend: fresh trends begin at full band width, giving early moves room to survive shakeouts, while mature trends that keep printing new extremes are trailed progressively tighter — so extended runs are exited far closer to their peak. The trail only ever tightens mid-trend and fully resets on each flip.
Alerts fire on confirmed trend flips in both directions.
Note: MAD Supertrend is provided "as is" without formal robustness or optimization testing. Past performance is not indicative of future results; use in live trading only after sufficient back-testing and validation.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.