Difficulty placing an arrow

lee-I-O=coke-A

New member
Must have brain fog, can not see why I can not add an arrow under candle. Can someone kindly point out my mistake, thanks.

Code:
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;

AssignPriceColor(if close < lowerBand then Color.yellow else Color.CURRENT);

plot greenArrow (if close < lowerBand);
greenArrow.SetDefaultColor(Color.white);
 

rad14733

Well-known member
VIP
@lee-I-O=coke-A You were very close... Here is the corrected code...

Ruby:
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;

AssignPriceColor(if close < LowerBand then Color.YELLOW else Color.CURRENT);

plot greenArrow = close < lowerBand;
greenArrow.SetDefaultColor(Color.WHITE);
greenArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
 

lee-I-O=coke-A

New member
@lee-I-O=coke-A You were very close... Here is the corrected code...

Ruby:
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;

AssignPriceColor(if close < LowerBand then Color.YELLOW else Color.CURRENT);

plot greenArrow = close < lowerBand;
greenArrow.SetDefaultColor(Color.WHITE);
greenArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
thanks, I could not see the forest from the trees at 5 o'clock tis morning. thanks again
 
Top