Did ninjatrader change the SMA algorithm ever?
I have an indicator that was made years ago to get SMA information and plot it out. It looks very close but there are a couple of spike anomolies. If indicator on the top is reading an SMA indicator from ninjatrader and the indicator on the bottom is reading and SMA indicator from ninjatrader How can I get different information.
secondly i tried to manually make an sma algorithm to see if it gives the same information.
double FindSMA(int nPeriod)
{
double dSMA = 0;
for(int x= 0; x< nPeriod; x++)
{
dSMA = dSMA + Close[nPeriod];
}
dSMA = (double)dSMA/ nPeriod;
return dSMA;
}
This gives totally different information than what Ninjatrader shows. My charts are not the same.
Lastly what are these parameters
double last = Value[1] * Math.Min(CurrentBar, Period);
if (CurrentBar >= Period)
Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
What is Value[1]; ???
What is Input[0]; ???
If the pictures below are both Ninjatrader SMA indicators then why is the plotting anomalies exist
Formula SMA(120)[0];
Comment