ZackeryE21
New member
This is definitely a noob question, but... Instead of getting a band (a line that changes every period), how do I just get a horizontal line based off the most recent period?
Also, any suggestions on lookback length for the Standard Deviation? How would I calculate ALL previous periods' Standard Deviations if I wanted to?
Thanks so much
Code:
declare once_per_bar;
declare lower;
input price = close;
input aggregationPeriod = AggregationPeriod.DAY;
input length = 200;
def EMA = ExpAverage(price, length);
plot Divergence = Round((EMA / close) * 100, 2);
def SD = StDev(Divergence, length);
plot SingleSDUp = Divergence + SD;
plot SingleSDDown = Divergence - SD;
Also, any suggestions on lookback length for the Standard Deviation? How would I calculate ALL previous periods' Standard Deviations if I wanted to?
Thanks so much