Code:
input BarWanted = 3;
plot IsBarWanted = getTime() - regularTradingStart(GetYYYYMMDD()) - 1 == getAggregationPeriod() * (BarWanted - 1);
IsBarWanted.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
Hi Joshua
I came up with this but it doesnt plot it correctly. I get up arrows on all the bars
plot Data = close;
input BarWanted = 3;
Def IsBarWanted = getTime() - regularTradingStart(GetYYYYMMDD()) - 1 == getAggregationPeriod() * (BarWanted - 1);
#IsBarWanted.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
input price = close;
input displace = 0;
input length = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;
input averageType = AverageType.Simple;
def sDev = stdev(data = price[-displace], length = length);
plot MidLine = MovingAverage(averageType, data = price[-displace], length = length);
plot LowerBand = MidLine + num_Dev_Dn * sDev;
#plot UpperBand = MidLine + num_Dev_Up * sDev;
plot Lowercross = IsBarWanted < LowerBand;
Lowercross.setPaintingStrategy(paintingStrategy.ARROW_UP);
I'm trying to setup a scan that will tell me when there are 3 consecutive bars crossing below or above the Bollinger band