Just to further my understanding as I study ninjascript:
I have seen the MACD indicator written including the price series included in both State.Configure and also in State.DataLoaded
eg
else if (State == State.DataLoaded)
{
fastEma = new Series<double>(this);
slowEma = new Series<double>(this);
}
or
else if (State == State.Configure)
{
constant1 = 2.0 / (1 + Fast);
constant2 = (1 - (2.0 / (1 + Fast)));
constant3 = 2.0 / (1 + Slow);
constant4 = (1 - (2.0 / (1 + Slow)));
constant5 = 2.0 / (1 + Smooth);
constant6 = (1 - (2.0 / (1 + Smooth)));
fastEma = new Series<double>(this);
slowEma = new Series<double>(this);
}
How does this change the behavior of the code written?
thanks
Comment