I really enjoyed using the Waddah Attar Explosion (WAE) indicator posted on this forum here, WAE for TOS, and since several replies to the post for that indicator asked about a WAE with volume, I made this variant incorporating volume in the analysis.
To incorporate volume it uses the following:
Value = (MACD value - Previous MACD value) * Volume
BollingerBandUpper - BollingerBandLower + Average(Volume,VolAvgLength)/sensitivity;
Here is a screenshot showing what it looks like:
Here is the code:
To incorporate volume it uses the following:
Value = (MACD value - Previous MACD value) * Volume
BollingerBandUpper - BollingerBandLower + Average(Volume,VolAvgLength)/sensitivity;
Here is a screenshot showing what it looks like:
Here is the code:
CSS:
#------------- "Waddah Attar Explosion With Volume" ------------#
declare on_volume;
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"
input VolAvgLength = 20;
script calc_macd {
input source = close;
input fastLength = 20;
input slowLength = 40;
def fastMA = ExpAverage(source, fastLength);
def slowMA = ExpAverage(source, slowLength);
plot out = fastMA - slowMA;
}# end script calc_macd{}
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;
}# end script calc_BBUpper{}
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;
}# end script calc_BBLower{}
def e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close,
channelLength, mult)) + Average(Volume,VolAvgLength)/sensitivity;
def t1_ = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1],
fastLength, slowLength))*VOLUME ;
def t1 = if t1_ > 2*e1 then 2*e1 else if t1_ < -2*e1 then -2*e1 else t1_;
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.SetLineWeight(5);
tUp.AssignValueColor(if trendUp < trendUp[1] then Color.LIGHT_GREEN else
Color.GREEN);
plot tDn = trendDown; #"DownTrend"
tDn.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
tDn.SetLineWeight(5);
tDn.AssignValueColor(if trendDown < trendDown[1] then Color.ORANGE else
Color.RED);
plot ex = e1; #"ExplosionLine"
ex.SetDefaultColor(Color.BLACK); #
ex.SetLineWeight(2);
ex.HideBubble();
#plot xLine = deadZone; #"DeadZoneLine"
#xLine.SetDefaultColor(Color.BLUE);
#------------- "Waddah Attar Explosion " ------------#
Attachments
Last edited: