Waddah Attar Explosion Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Here is the Waddah Attar Explosion Indicator converted by Syracusepro from Pinescript to ThinkorSwim. I also found this indicator on MQL5 as well.



Some notes I found:

From looking at the code, it looks like an mix between Standard MACD and iBands Displayed as a seperate window flat indicator. So the Green and Red lines correspond with MACD. The Sienna line looks like it indicating the explosive price power. The Blue line indicated the dead zone - no trade. All logic seems to be looking at the Close price. So Green is Buy and Red is Sell. If Green is above Blue and Siena - Signal Buy. If Red is above Blue and Siena - Signal Sell. Exit the Open Buy when Green goes below Blue Dead Zone. Exit the Open Sell when Red goes below Blue Dead Zone.

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

http://tos.mx/BM3O4c
 
Last edited:
T

Topas

New member
This is a Awesome Indicator .... I have seen it on MT4 Platform and lot of Forex Trader use it ...

 
Last edited:
T

Topas

New member
Just try it on my TOS but dont plot anything on FOREX Pair... Only plot it on STOCKS

But it should plot it on anything .... Since i do Binary I need to see it on FOREX PAIR. Thank you

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Topas Glad to hear positive feedback about it. Is it still the same version as the one on MT4? Any differences or anything missing in the ToS version?

 
Last edited:
S

SolidChiken

New member
VIP
Hi Ben... I truly appreciate for this post. May I know is there a way to make the indicator auto-adjust the range instead of fix one ? I'm not sure how to do it. Can't find the setting.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@SolidChiken What do you mean by that? By the way, I don't think this is truly the complete converted version. It's similar to the original version but not to the exact. I do not use it either.
 
S

SolidChiken

New member
VIP
@BenTen The histogram is small (low) on certain ticker. Not visible even after zoom in. It has a fixed scale. When I'm home today will show you the chart what I was talking about.
Btw, is there a chance for you to show the original version?
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@SolidChiken By original I meant the one that works on the MQL5 platform. It’s linked above as well.

If you have trouble seeing the histogram then unplot the deadzone.
 
mc01439

mc01439

Active member
VIP
Warehouse
@BenTen

Looking at the code looks like it does not include the volume part of the indicator. MACD bar height should be determined in part by volume from my understanding of the indicator. Still looks like it works very well though.
 
C

Craighaber71

Member
VIP
Warehouse
Just to be clear....Its only a trade if its above the blue deadzone and the Siena line correct
 
H

horserider

Well-known member
VIP
Warehouse
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 desighned 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 prise 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 hpoe that you will like the indicator


i added some properties so the indicator would be more sesitive 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 helpfil 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 uper 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"
 
C

Craighaber71

Member
VIP
Warehouse
Can this be used on lower T/F....So the bars don't have to be above the yellow line..The yellow line just has to be up....What is the deadzone line for
 
P

poparhon

New member
Here is the Waddah Attar Explosion Indicator converted by Syracusepro from Pinescript to ThinkorSwim. I also found this indicator on MQL5 as well.



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

http://tos.mx/BM3O4c
I had no luck at all with this indicator, did a copy and paste then used shareable link end up with two different colored horizontal lines, have used this on MT4
 
Top