TradingView indicators

Waddah Attar Explosion: momentum and volatility thresholds

Waddah Attar Explosion (WAE) compares the change in a MACD line, multiplied by sensitivity, with Bollinger Band width and a dead zone. The histogram gives the direction of that change; the lines set thresholds. A colored bar alone does not confirm a breakout or establish a trading edge.

MACD change × sensitivity → directional bars
Upper BB − lower BB → explosion line
3.7 × RMA(true range, 100) → this example's dead zone

Looking for the published indicator? Open LazyBear's TradingView port or shayankm's V2 [SHK]. Sources reviewed October 17, 2026. Educational material, not investment advice.

Check a qualifying bar against three failed examples

Choose a version before comparing signals

The original method is attributed to Waddah Attar, whose MT4 indicator is available in the MQL5 Code Base. LazyBear's TradingView port documents an entry checklist. Shayankm's V2 description explicitly replaces a fixed dead zone with an ATR-based threshold. That change matters when price scales differ between instruments.

WAE dead-zone versions and comparison limits
VersionDead-zone conventionComparison constraint
Fixed-threshold portsA configured constantConfirm whether the input means price units, points or pips; do not copy the number across symbols.
V2 [SHK]ATR-based, per its authorMatch the source revision, smoothing and multiplier before claiming identical results.
This Pineify example3.7 × RMA(TR, 100)Uses the current Pineify calculation convention plus closed-bar qualification; no MT4 alert-state or power-filter parity is claimed.

The copyable example below is an educational implementation. It names the method and public ports, but does not replace their original publications or establish that every WAE script has the same rules.

Calculate the bars, explosion line and dead zone

  1. Compute M = EMA(close, 20) − EMA(close, 40). This is a MACD line, not the usual MACD-minus-signal histogram.
  2. Compute T = 150 × (M − M[1]). Plot max(T, 0) as the positive bar and max(−T, 0) as the negative-change magnitude. Both appear above zero.
  3. Compute E = upper BB − lower BB = 2 × k × standard deviation(close, n). With n = 20 and k = 2, E = 4 × standard deviation(close, 20).
  4. Compute D = 3.7 × RMA(true range, 100). True range includes gaps relative to the previous close; the RMA needs enough nonmissing history to initialize.

T, E and D are in price units. Sensitivity is dimensionless. E is raw band width, not normalized Bollinger BandWidth expressed as a percentage of the basis. Replacing only E with percentage bandwidth would compare incompatible scales. These calculations do not use volume.

A green bar means M rose since the previous bar. For example, M moving from −0.50 to −0.38 gives T = 18 at sensitivity 150 even though M is still negative. A red bar likewise means M fell, not necessarily that price closed below its open.

One qualifying bar and three near misses

These are independent, synthetic scenarios, not market observations. Each starts with a previous positive histogram of 12 and previous explosion line of 15. Sensitivity is 150. For case A, M rises from 1.20 to 1.32, standard deviation is 4, and RMA(TR, 100) is 14 ÷ 3.7. Therefore T = 0.12 × 150 = 18, E = 4 × 4 = 16 and D = 14.

Synthetic WAE rule checks, all values in price units except sensitivity
CaseMACD changeHistogramBB widthDead zoneRule result
A0.12181614Pass: 18 > 16 > 14, and both increase
B0.10151614Fail: histogram clears dead zone but not BB width
C0.12181617Fail: BB width remains below dead zone
D0.12181413Fail: BB width fell from 15 to 14

Case A satisfies the documented checklist: the selected histogram increases, exceeds E, E increases, and both exceed D. Case C shows why checking only T > E and T > D is incomplete. For negative thrust, apply the same tests to its positive magnitude. Strict comparisons mean equality fails. Passing this checklist describes the indicator state; it does not predict the next price move.

Halving sensitivity to 75 changes case A's histogram from 18 to 9 while E stays 16 and D stays 14. That bar now fails. Increasing sensitivity makes the absolute thresholds easier to clear; it does not make EMA smoothing faster or slower.

Pine Script v6 with explicit close confirmation

Paste this script into TradingView's Pine Editor, save it and add it to the chart. Match symbol, timeframe, session and input values before comparing it with another version. The input defaults are 150 / 20 / 40 / 20 / 2, with a fixed 100 / 3.7 ATR-style dead-zone convention. They are calculation defaults, not optimized settings.

Pine Script v6 · educational indicator
//@version=6
// Waddah Attar method; TradingView port by LazyBear:
// https://www.tradingview.com/script/iu3kKWDI-Waddah-Attar-Explosion-LazyBear/
// ATR dead-zone variant: Waddah Attar Explosion V2 [SHK], shayankm:
// https://www.tradingview.com/script/d9IjcYyS-Waddah-Attar-Explosion-V2-SHK/
// Educational Pineify example, not an exact reproduction of either publication.
// Retain attribution and check original publication terms before redistribution.
indicator("WAE: momentum and volatility thresholds", overlay=false)

sensitivity = input.int(150, "Sensitivity", minval=1)
fastLength = input.int(20, "Fast EMA length", minval=1)
slowLength = input.int(40, "Slow EMA length", minval=2)
bbLength = input.int(20, "BB length", minval=2)
bbMultiplier = input.float(2.0, "BB deviation multiplier", minval=0.1)

if fastLength >= slowLength
    runtime.error("Fast EMA length must be smaller than slow EMA length.")

macdLine = ta.ema(close, fastLength) - ta.ema(close, slowLength)
thrust = sensitivity * (macdLine - macdLine[1])
up = math.max(thrust, 0)
down = math.max(-thrust, 0)
explosion = 2 * bbMultiplier * ta.stdev(close, bbLength)
// Matches Pineify's existing ATR-style dead-zone convention.
// ta.tr is na when the previous close is unavailable; do not replace it with zero.
deadZone = 3.7 * ta.rma(ta.tr, 100)
ready = not na(deadZone) and not na(explosion[1]) and not na(thrust[1])

longQualified = ready and up > up[1] and up > explosion and explosion > explosion[1] and up > deadZone and explosion > deadZone
shortQualified = ready and down > down[1] and down > explosion and explosion > explosion[1] and down > deadZone and explosion > deadZone
// Qualifying bars, not order instructions. Consecutive bars can qualify.
confirmedLong = barstate.isconfirmed and longQualified
confirmedShort = barstate.isconfirmed and shortQualified

plot(up, "Positive MACD change", color=color.teal, style=plot.style_columns)
plot(down, "Negative MACD change (magnitude)", color=color.red, style=plot.style_columns)
plot(explosion, "BB width", color=color.orange, linewidth=2)
plot(deadZone, "Dead zone: RMA(TR, 100) x 3.7", color=color.blue, linewidth=2)
plotshape(confirmedLong, "Qualified positive thrust", shape.triangleup, location.bottom, color.teal, size=size.tiny)
plotshape(confirmedShort, "Qualified negative thrust", shape.triangledown, location.top, color.red, size=size.tiny)
alertcondition(confirmedLong, "WAE positive qualification", "Positive WAE thrust meets all example rules on a closed chart bar.")
alertcondition(confirmedShort, "WAE negative qualification", "Negative WAE thrust meets all example rules on a closed chart bar.")

Markers and alert conditions qualify every closed bar meeting all tests, including consecutive bars. Create an alert in TradingView and choose the relevant condition and once-per-bar-close frequency. Editing inputs or code requires recreating the running alert to use the new configuration. No strategy orders, position sizing or exit management are included.

The plots can move on an open bar. Missing initial data suppresses qualification; it is not treated as zero. The example uses the chart's timeframe and contains no higher-timeframe requests.

Where the interpretation fails

  • A single sharp price change can satisfy every test and then reverse. A qualification is not proof of a sustained breakout.
  • The slow true-range average can stay high after a shock, while Bollinger width contracts. Signals may disappear even when the histogram remains visible.
  • Raw values from differently priced symbols are not comparable strength scores. A fixed dead-zone number may overwhelm a low-priced instrument.
  • Changing sensitivity and choosing the best historical result can fit noise. Freeze rules, include costs and test a later untouched period before drawing performance conclusions.

TTM Squeeze answers a different question: whether Bollinger Bands sit inside Keltner Channels. WAE has no Keltner comparison here. Its BB width may increase without a squeeze-release event, and a squeeze release need not clear WAE's momentum and dead-zone thresholds.

Turn a specified WAE rule into reviewable code

Pineify's Pine Script AI Coding Agent can help write or modify a script from explicit rules. Supply the source version, formula and desired alert timing instead of asking only for a WAE strategy. Ask for a syntax check, then compare the plotted values and markers in TradingView. Syntax success does not validate trading performance.

Use Waddah Attar's method with the ATR-style dead zone shown here. Keep the author links. Require rising directional magnitude above BB width, rising BB width, and both above the dead zone. Confirm at bar close. Add a separate option for the first qualifying bar only, explain how it changes repeated alerts, and check the Pine syntax.
Explore Pine Script AI Coding Agent

Waddah Attar Explosion questions

Sources and related reading

Primary sources reviewed October 17, 2026. The numerical cases are calculated examples, not backtest results.