This setup helps to see the waves clearly. Dark Blue and Red indicate Break out and Break down respectively. Green is an up candle and Brown is a down candle.
color = flatColor; if close > close[1] then color = upColor else if close < close[1] then color = dnColor;
if close < close[1] and close[1] > close[2] then begin sh = close[1]; end; if close > close[1] and close[1] < close[2] then begin sl = close[1]; end; if close > sh and close > close[1] then begin color = boColor; end; if close < sl and close < close[1] then begin color = bdColor; end;
if open >= close then yhigh = open else yhigh = close; if open <= close then ylow = open else ylow = close;
1 comment:
Code
inputs:
upColor(green),
dnColor(darkbrown),
BOcolor(Blue),
BDcolor(Red),
flatColor(white),
BarWidth(1);
variables: color(green),
sl(0),
sh(0);
var: yhigh(0), ylow(0);
color = flatColor;
if close > close[1] then color = upColor
else if close < close[1] then color = dnColor;
if close < close[1] and close[1] > close[2] then begin
sh = close[1];
end;
if close > close[1] and close[1] < close[2] then begin
sl = close[1];
end;
if close > sh and close > close[1] then begin
color = boColor;
end;
if close < sl and close < close[1] then begin
color = bdColor;
end;
if open >= close then yhigh = open else yhigh = close;
if open <= close then ylow = open else ylow = close;
plotPB(yHigh,yLow,open, close, "BoBd",color);
SetPlotWidth(1,BarWidth);
SetPlotColor(1,color);
Post a Comment