https://usethinkscript.com/threads/waddah-attar-explosion-indicator-for-thinkorswim.83/#post-377I'm sorry, but I don't see the "new Price Explosion Indicator"
https://usethinkscript.com/threads/waddah-attar-explosion-indicator-for-thinkorswim.83/#post-377I'm sorry, but I don't see the "new Price Explosion Indicator"
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
HI @rad14733 , How do you get the lines on the upper chart? ThanksFirst 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...
Assuming that you are referring to RSI on the upper chart panel, simply move RSI into the upper indicator section and RSI superimposes over the chart...HI @rad14733 , How do you get the lines on the upper chart? Thanks
@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
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);
@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
#_______________________________________________________________________
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 " ------------#
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.@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
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);
Here is the Waddah Attar Explosion Indicator converted by Syracusepro 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
Start a new thread and receive assistance from our community.
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.
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.