hectorgasm
Member
I'm trying to plot std deviation bands on slow rsi but they always end up at the bottom of the indicator, can someone help me figure out the right code please? 
Code:
declare lower;
input emaLength = 50;
input rsiLength = 200;
input over_bought = 80;
input over_sold = 20;
def ema = ExpAverage(close, emaLength);
def netChgAvg = WildersAverage(close - ema, rsiLength);
def totChgAvg = WildersAverage(AbsValue(close - ema), rsiLength);
def chgRatio = if totChgAvg != 0 then netChgAvg / totChgAvg else 0;
plot SlowRSI = 50 * (chgRatio + 1);
plot OverBought = over_bought;
plot MiddleLine = 50;
plot OverSold = over_sold;
SlowRSI.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(5));
MiddleLine.SetDefaultColor(GetColor(5));
MiddleLine.SetStyle(Curve.LONG_DASH);
OverSold.SetDefaultColor(GetColor(5));
input stdLength = 50;
input stdFactor = 3;
plot updev = stdFactor*StDev(slowRSI, stdLength);
plot downdev = -stdFactor*StDev(slowRSI, stdLength);
