OPEN-SOURCE SCRIPT
MAD Z Robust Burst [forexobroker]

MAD Z Robust Burst computes a Median Absolute Deviation z-score: MAD-Z = (close - median) / (1.4826 * MAD), where MAD = median(|x - median|). The 1.4826 factor makes MAD a consistent estimator of stdev under normality. Robust to outliers — a single price spike does not inflate the divisor like ordinary stdev does. Visual signature: outlined-only square markers (no fill), MAD bands.
🔶 ALGORITHM
1. window = last N closes.
2. med = median(window).
3. abs_dev[k] = |close[k] - med|.
4. MAD = median(abs_dev).
5. MAD-Z = (close - med) / (1.4826 * MAD).
6. Burst regime when |MAD-Z| > threshold.
7. Return-from-burst entry: signal fires when MAD-Z comes back below the return threshold from a burst.
🔶 SIGNAL LOGIC
- Buy: prior burst-down AND MAD-Z >= -return-threshold AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: prior burst-up AND MAD-Z <= +return-threshold.
- Position-lock state machine.
🔶 INPUTS
- MAD Window (default 40)
- Burst Z entry start (default 2.0)
- Return Z entry fire (default 1.0)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, MAD bands, outlined markers, buy / sell colors
🔶 ALERTS
MZB Buy, MZB Sell, MZB Any Signal, MZB Burst Up, MZB Burst Down, MZB Extreme, MZB Return Up, MZB Return Down, MZB Webhook JSON.
🔶 LIMITATIONS
- MAD is robust but slower-reacting than stdev; bursts may persist a bit longer before being detected.
- The 1.4826 normalisation assumes Gaussian-like distributions; for heavy-tailed assets the conversion is approximate.
- Outlined squares (no glow stack) is a deliberate visual choice — the indicator looks unique but has slightly lower visibility than filled markers.
- Return-from-burst entry is mean-reversion oriented; not for breakout players.
🔶 ALGORITHM
1. window = last N closes.
2. med = median(window).
3. abs_dev[k] = |close[k] - med|.
4. MAD = median(abs_dev).
5. MAD-Z = (close - med) / (1.4826 * MAD).
6. Burst regime when |MAD-Z| > threshold.
7. Return-from-burst entry: signal fires when MAD-Z comes back below the return threshold from a burst.
🔶 SIGNAL LOGIC
- Buy: prior burst-down AND MAD-Z >= -return-threshold AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: prior burst-up AND MAD-Z <= +return-threshold.
- Position-lock state machine.
🔶 INPUTS
- MAD Window (default 40)
- Burst Z entry start (default 2.0)
- Return Z entry fire (default 1.0)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, MAD bands, outlined markers, buy / sell colors
🔶 ALERTS
MZB Buy, MZB Sell, MZB Any Signal, MZB Burst Up, MZB Burst Down, MZB Extreme, MZB Return Up, MZB Return Down, MZB Webhook JSON.
🔶 LIMITATIONS
- MAD is robust but slower-reacting than stdev; bursts may persist a bit longer before being detected.
- The 1.4826 normalisation assumes Gaussian-like distributions; for heavy-tailed assets the conversion is approximate.
- Outlined squares (no glow stack) is a deliberate visual choice — the indicator looks unique but has slightly lower visibility than filled markers.
- Return-from-burst entry is mean-reversion oriented; not for breakout players.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。