Hello,
So I'm trying to write a script for a stocks current price that is below the lower band of the Bollinger band. So far, every script I've written has never shown an error on this word and I don't know what to do to fix it.
everything is good and accepted except for the word "condition" on the very last line. any idea why its not working? I think it has something to do with the Constant--> Price Type--> (PriceType.Last or PriceType.Bid or PriceType.Ask), which is something I haven't used yet.
Also, I seem to be having trouble adding the code and the above paragraph in the original post, I have to edit my post to add either the body text or the code after I post, Any ideas why this is happening?
So I'm trying to write a script for a stocks current price that is below the lower band of the Bollinger band. So far, every script I've written has never shown an error on this word and I don't know what to do to fix it.
everything is good and accepted except for the word "condition" on the very last line. any idea why its not working? I think it has something to do with the Constant--> Price Type--> (PriceType.Last or PriceType.Bid or PriceType.Ask), which is something I haven't used yet.
Also, I seem to be having trouble adding the code and the above paragraph in the original post, I have to edit my post to add either the body text or the code after I post, Any ideas why this is happening?
Code:
#Hint: stocks that are below the lowerband during the day heading into the close
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;
input currentprice = PriceType.LAST;
def sDev = stdev(data = price[-displace], length = length);
def MidLine = MovingAverage(averageType, data = price[-displace], length = length);
def LowerBand = MidLine + num_Dev_Dn * sDev;
def UpperBand = MidLine + num_Dev_Up * sDev;
plot condition = currentprice < lowerBand;
# The word "condition" above is the only word that shows up with the red box.f