sagers2017
New member
Invalid statement error: plot at 11:1 why?
input length = 200;
input fastLength = 50;
input slowLength = 150;
def closePrice = close;
def fastMA = movingAverage(AverageType.SIMPLE, closePrice, fastLength);
def slowMA = movingAverage(AverageType.SIMPLE, closePrice, slowLength);
def averageRange = ((highest(close, 52) - lowest(close, 52)) * 0.25) + lowest(close, 52);
def relativeStrength = 100 * closePrice / closePrice[1];
plot BuySignal = (closePrice > fastMA && closePrice > slowMA && fastMA > slowMA. <-- 11:1 error
&& slowMA > slowMA[63]
&& fastMA > slowMA
&& closePrice > (lowest(close, 52) * 1.75)
&& closePrice >= averageRange
&& relativeStrength >= 75
&& closePrice > fastMA) ? 1 : 0; <--11:1 error
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.AssignValueColor(if BuySignal == 1 then Color.GREEN else Color.RED);
BuySignal.SetLineWeight(3);
input length = 200;
input fastLength = 50;
input slowLength = 150;
def closePrice = close;
def fastMA = movingAverage(AverageType.SIMPLE, closePrice, fastLength);
def slowMA = movingAverage(AverageType.SIMPLE, closePrice, slowLength);
def averageRange = ((highest(close, 52) - lowest(close, 52)) * 0.25) + lowest(close, 52);
def relativeStrength = 100 * closePrice / closePrice[1];
plot BuySignal = (closePrice > fastMA && closePrice > slowMA && fastMA > slowMA. <-- 11:1 error
&& slowMA > slowMA[63]
&& fastMA > slowMA
&& closePrice > (lowest(close, 52) * 1.75)
&& closePrice >= averageRange
&& relativeStrength >= 75
&& closePrice > fastMA) ? 1 : 0; <--11:1 error
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.AssignValueColor(if BuySignal == 1 then Color.GREEN else Color.RED);
BuySignal.SetLineWeight(3);