I am a beginner with Ninjascript, so sorry if I am not able to explain the problem well... I'm trying to plot the SMA of some data I calculate on each bar... I tried saving the data into
private Series<double> MySeries
So that I could do something like this:
//assign values
MySeries[0] = A + B; //This isn't the actual calculation, just an example
//store the values after calculating the SMA of MySeries
MySeriesSMA[0] = SMA(MySeries, 20)[0];
//plot
Values[0][0] = MySeriesSMA[0]
I do not get a compiler errors and I can even see the data inside MySeriesSMA using Print() and it seems correct...
But it will not plot... If I do something like switch out SMA(MySeries, 20)[0]; with this SMA(ATR(), 20)[0]; it plots this data, so it means MySeries is causing the problem...
I hope that I am going about this completely wrong and that there is an easier way.
Thanks for any help


Comment