Waddah Attar Explosion Indicator for ThinkorSwim

@swazz Yes, the WAE indicator can be used for all timeframes... The "No Trade Zone Threshold" or "Dead Zone" line has been covered here in the topic... It can be manually adjusted and auto-adjustment has been attempted but there is no perfect solution... In all honesty, I don't even use that line as it requires customization for each symbol traded to be truly effective... I am not currently using the WAE indicator but do toss it back into the mix at times... Hopefully this is helpful... If you have additional questions I'll do my best to answer them...
 
I assume this does not Repaint?. Could someone please confirm. Thanks

Which timeframe this is most effective?
 
Last edited:
I assume this does not Repaint?. Could someone please confirm. Thanks

Which timeframe this is most effective?
This indicator does not repaint... Any timeframe that suits your needs works... I have mainly used it for lower timeframes of 2m, 3m, 5m for scalping...
 
https://usethinkscript.com/threads/waddah-attar-explosion-indicator-for-thinkorswim.83/#post-377
From the author .

"Here is a new indicator which I programed, it gives an explosion signal depending on two indicators (Bollinger & MACD). With this indicator you can discover when the price explosion starts and when it ends

The indicator is designed to work with H1 frame only. How to use the indicator:

1) The yellow line is used to recognize when the explosion starts and when it ends. the explosion starts when the yellow line is low as long as the yellow line is high the explosion is still running on the price explosion ends when the yellow line is back low inside the dots zone the yellow line job is identifying the explosion starts and ends.
2) The green histogram: has three uses: first, gives a signal when price explose upward (bullish move) second, gives the buying signal, when the green histo rises above the yellow line. third, gives the exist signal, when the a green histo slip back into the yellow line
3)The green histogram: has three uses:
  • first, gives a signal when price explose downward (bearish move)
  • second, gives the sell signal, when the red histo rises above the yellow line
  • third, gives the exist signal, when the red histo slip back into the yellow line
I hope that you will like the indicator. I added some properties so the indicator would be more sensitive and can be used with all pairs:

  • sensitive property
  • DeadZonePip property which represents for the pips move inside the dead zone (the zone between the dots line)
  • BandPeriod property which represent the sensitive of the yellow line
  • BandDivision property helpful value for the explosion (for yellow line)
  • showlong property to show or hide the green histo
  • showshort property to show or hide the red histo
  • showexplosion property to show or hide the yellow line
  • showdeadzone property to show or hide the dead zone (dots zone)

Explanation for the Price Explosion indicator:

The indicator depends on two things to show the data and the lines in chart

1) The deference between the upper and lower band of the Bollinger band which tight when the price fluctuates (narrow move) when the difference between the bands expand, the explosion process starts and the yellow line curve upward till the explosion ends and price fluctuate again
2) The difference between the present value of the macd and the last value with one tick for the same candle this deference is represented in the green and the red histogram.

END"
I'm sorry, but I don't see the "new Price Explosion Indicator"
 
Last edited by a moderator:
First post in these forums but have been visiting for some time now... Hoping to contribute when I can...

This issue is caused by the deadzone setting being set too high due to trade instrument pricing differences... When I use this script for day trading options I set the value to 0.2 instead of the default setting of 20... The only other changes I have made to the script posted above, so far, are the ex and xLine colors... Hope this helps someone...

I use a laundry list of indicators to validate or invalidate potential trades... Realistically, I could suffice with Renko Bars, RSI superimposed over the Renko Bars, Trend Reversal Indicator with Signals, and Waddah Attar Explosion...
HI @rad14733 , How do you get the lines on the upper chart? Thanks
 
Last edited by a moderator:
@BenTen Is there way to show the color of Waddah into the chart Candle bar. Ex: if it is Red Buy signal make the candle color Red, if it is Dead Zone make the candle color Hollow candle... so on
 
@BenTen Is there way to show the color of Waddah into the chart Candle bar. Ex: if it is Red Buy signal make the candle color Red, if it is Dead Zone make the candle color Hollow candle... so on
Code:
declare lower;
input APC = 0;
#------------- "Waddah Attar Explosion " ------------#

input sensitivity = 150; #"Sensitivity"
input fastLength = 20; #"FastEMA Length"
input slowLength = 40; #"SlowEMA Length"
input channelLength = 20; #"BB Channel Length"
input mult = 2.0; #"BB Stdev Multiplier"
input deadZone = 20; #"No trade zone threshold"

script calc_macd{

    input source = close;
    input fastLength = 20;
    input slowLength = 40;

    def fastMA = movAvgExponential(source, fastLength);
    def slowMA = movAvgExponential(source, slowLength);

    plot out = fastMA - slowMA;

}

script calc_BBUpper{

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = simpleMovingAvg(source, length);
    def dev = mult * stdev(source, length);

    plot out = basis + dev;

}

script calc_BBLower{

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = simpleMovingAvg(source, length);
    def dev = mult * stdev(source, length);

    plot out = basis - dev;

}

def t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1],
fastLength, slowLength)) * sensitivity;

def t2 = (calc_macd(close[2], fastLength, slowLength) -
calc_macd(close[3], fastLength, slowLength)) * sensitivity;

def e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close,
channelLength, mult));

#//
def e2 = (calc_BBUpper(close[1], channelLength, mult) - calc_BBLower(close[1], channelLength, mult));

def trendUp = if t1 >= 0 then t1 else 0;
def trendDown = if t1 < 0 then (-1 * t1) else 0;

plot tUp = trendUp; #"UpTrend"
#Also try using columns to see how it looks.
tUp.setpaintingStrategy(paintingStrategy.HISTOGRAM);
tUp.assignValueColor(if trendUp < trendUp[1] then color.light_GREEN else
color.green);

plot tDn = trendDown; #"DownTrend"
tDn.setpaintingStrategy(paintingStrategy.HISTOGRAM);
tDn.assignValueColor(if trendDown < trendDown[1] then color.orange else
color.red);

plot ex = e1; #"ExplosionLine"
ex.setdefaultColor(createColor(160, 82, 45));

plot xLine = deadZone; #"DeadZoneLine"
xLine.setdefaultColor(color.blue);

#------------- "Waddah Attar Explosion " ------------#
 AssignPriceColor( if APC == 1 && trendUp < trendUp[1] then color.light_GREEN else if APC ==1  &&  trendUp > trendUp[1] then color.green else
if APC ==1 && trendDown < trendDown[1] then color.orange else if APC ==1 && trendDown > trendDown[1] then
color.red else Color.Current);

set the APC input to 1 to color the bars and 0 ide the colored bars
 
Last edited:
@BenTen Is there way to show the color of Waddah into the chart Candle bar. Ex: if it is Red Buy signal make the candle color Red, if it is Dead Zone make the candle color Hollow candle... so on

This code allows for painted price candles and/or painted arrows

Screen Shot 2024-02-13 at 11.15.59 AM.png
Screen Shot 2024-02-13 at 11.18.06 AM.png

Code:
#_______________________________________________________________________

declare upper;

input paintarrows = Yes;
input paintbar = Yes;

#------------- "Waddah Attar Explosion " ------------#


input sensitivity = 150; #"Sensitivity"
input fastLength = 20; #"FastEMA Length"
input slowLength = 40; #"SlowEMA Length"
input channelLength = 20; #"BB Channel Length"
input mult = 2.0; #"BB Stdev Multiplier"
input deadZone = 20; #"No trade zone threshold"

script calc_macd {

    input source = close;
    input fastLength = 20;
    input slowLength = 40;

    def fastMA = MovAvgExponential(source, fastLength);
    def slowMA = MovAvgExponential(source, slowLength);

    plot out = fastMA - slowMA;

}

script calc_BBUpper {

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = SimpleMovingAvg(source, length);
    def dev = mult * StDev(source, length);

    plot out = basis + dev;

}

script calc_BBLower {

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = SimpleMovingAvg(source, length);
    def dev = mult * StDev(source, length);

    plot out = basis - dev;

}

def t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1],
fastLength, slowLength)) * sensitivity;

def t2 = (calc_macd(close[2], fastLength, slowLength) -
calc_macd(close[3], fastLength, slowLength)) * sensitivity;

def e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close,
channelLength, mult));

#//
def e2 = (calc_BBUpper(close[1], channelLength, mult) - calc_BBLower(close[1], channelLength, mult));

def trendUp = if t1 >= 0 then t1 else 0;
def trendDown = if t1 < 0 then (-1 * t1) else 0;

def tUp = trendUp; #"UpTrend"
#Also try using columns to see how it looks.
#tUp.setpaintingStrategy(paintingStrategy.HISTOGRAM);
#tUp.assignValueColor(if trendUp < trendUp[1] then color.light_GREEN else color.green);

def tDn = trendDown; #"DownTrend"
#tDn.setpaintingStrategy(paintingStrategy.HISTOGRAM);
#tDn.assignValueColor(if trendDown < trendDown[1] then color.orange else color.red);

def ex = e1; #"ExplosionLine"
#ex.setdefaultColor(createColor(160, 82, 45));

def xLine = deadZone; #"DeadZoneLine"
#xLine.setdefaultColor(color.blue);

#------------- "Waddah Attar Explosion " ------------#


AssignPriceColor(if (paintbar and trendDown < trendDown[1]) then Color.ORANGE else if (paintbar and trendDown > trendDown[1]) then Color.RED else if (paintbar and trendUp < trendUp[1]) then Color.LIGHT_GREEN else if (paintbar and trendUp > trendUp[1]) then Color.GREEN else Color.CURRENT);

plot arrows = (paintarrows and trendDown < trendDown[1]) or (paintarrows and trendUp < trendUp[1]);
arrows.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrows.AssignValueColor(if (paintarrows and trendDown < trendDown[1]) then Color.ORANGE else if (paintarrows and trendDown > trendDown[1]) then Color.RED else if (paintarrows and trendUp < trendUp[1]) then Color.LIGHT_GREEN else if (arrows and trendUp > trendUp[1]) then Color.GREEN else Color.CURRENT);
arrows.SetLineWeight(1);

Alert(tUp crosses above ex and ex > xLine, "tUp Alert", Alert.BAR, Sound.Ding);
Alert(tDn crosses above ex and ex > xLine, "tDn Alert", Alert.BAR, Sound.Ding);


#------------- "Waddah Attar Explosion " ------------#
 
@BenTen Is there way to show the color of Waddah into the chart Candle bar. Ex: if it is Red Buy signal make the candle color Red, if it is Dead Zone make the candle color Hollow candle... so on
Hi @sky4blue I noticed a small error in the code I posted. It was sometime coloring candles orange when they should be green. I have fixed this issue in the code below.


Code:
AssignPriceColor(if (paintbar and trendUp > trendUp[1]) then Color.GREEN else if (paintbar and trendDown > trendDown[1]) then Color.RED else if (paintbar and trendDown < trendDown[1]) then Color.ORANGE else if(paintbar and trendUp <= trendUp[1]) then Color.LIGHT_GREEN else Color.gray);

plot arrows = (paintarrows and trendDown < trendDown[1]) or (paintarrows and trendUp < trendUp[1]);
arrows.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrows.SetLineWeight(1);

arrows.AssignValueColor(if (paintarrows and trendUp > trendUp[1]) then Color.GREEN else if (paintarrows and trendDown > trendDown[1]) then Color.RED else if (paintarrows and trendDown < trendDown[1]) then Color.ORANGE else if(paintarrows and trendUp <= trendUp[1]) then Color.LIGHT_GREEN else Color.gray);


Alert(tUp crosses above ex and ex > xLine, "tUp Alert", Alert.BAR, Sound.Ding);
Alert(tDn crosses above ex and ex > xLine, "tDn Alert", Alert.BAR, Sound.Ding);
 
Is there anyway we can get the color to show up on mobile?
Here is the Waddah Attar Explosion Indicator converted by Syracusepro from Pinescript to ThinkorSwim. I also found this indicator on MQL5 as well.

View attachment 4341

Some notes I found:



thinkScript Code

Rich (BB code):
declare lower;

#------------- "Waddah Attar Explosion " ------------#

input sensitivity = 150; #"Sensitivity"
input fastLength = 20; #"FastEMA Length"
input slowLength = 40; #"SlowEMA Length"
input channelLength = 20; #"BB Channel Length"
input mult = 2.0; #"BB Stdev Multiplier"
input deadZone = 20; #"No trade zone threshold"

script calc_macd{

    input source = close;
    input fastLength = 20;
    input slowLength = 40;

    def fastMA = movAvgExponential(source, fastLength);
    def slowMA = movAvgExponential(source, slowLength);

    plot out = fastMA - slowMA;

}

script calc_BBUpper{

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = simpleMovingAvg(source, length);
    def dev = mult * stdev(source, length);

    plot out = basis + dev;

}

script calc_BBLower{

    input source = close;
    input length = 20;
    input mult = 2.0;

    def basis = simpleMovingAvg(source, length);
    def dev = mult * stdev(source, length);

    plot out = basis - dev;

}

def t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1],
fastLength, slowLength)) * sensitivity;

def t2 = (calc_macd(close[2], fastLength, slowLength) -
calc_macd(close[3], fastLength, slowLength)) * sensitivity;

def e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close,
channelLength, mult));

#//
def e2 = (calc_BBUpper(close[1], channelLength, mult) - calc_BBLower(close[1], channelLength, mult));

def trendUp = if t1 >= 0 then t1 else 0;
def trendDown = if t1 < 0 then (-1 * t1) else 0;

plot tUp = trendUp; #"UpTrend"
#Also try using columns to see how it looks.
tUp.setpaintingStrategy(paintingStrategy.HISTOGRAM);
tUp.assignValueColor(if trendUp < trendUp[1] then color.light_GREEN else
color.green);

plot tDn = trendDown; #"DownTrend"
tDn.setpaintingStrategy(paintingStrategy.HISTOGRAM);
tDn.assignValueColor(if trendDown < trendDown[1] then color.orange else
color.red);

plot ex = e1; #"ExplosionLine"
ex.setdefaultColor(createColor(160, 82, 45));

plot xLine = deadZone; #"DeadZoneLine"
xLine.setdefaultColor(color.blue);

#------------- "Waddah Attar Explosion " ------------#

Shareable Link

https://tos.mx/BM3O4c

Hey guys,

@MerryDay @samer800

Is there anyway we can get the color to show up on mobile?
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
371 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top