here is the code from the indicator:
else if (State == State.DataLoaded)
{
stdDev = StdDev(Period);
}
}
protected override void OnBarUpdate()
{
double stdDev0 = stdDev[0];
if (State == State.Historical)
{
Value[0] = Volume[0];
Upper[0] = Value[0] + NumStdDev * stdDev0;
}
else
{
Value[0] = Bars.TickCount;
Upper[0] = Value[0] + NumStdDev * stdDev0;
}
Period= 20;
Attached is an image of the indicator. Even if I put Period at some really high number, it doesn't change the indicator. It looks like "Upper[0]" is just plotting "Value[0]", Upper is the white line on top of the blue bars. Essentially I should be getting a relatively straight line across like the yellow one I have drawn in.
Any idea why this code isn't working?
Thanks

Comment