NinjaScript > Language Reference > Data >
The sample code below demonstrates a method named DoubleTheValue that accepts any object that implements the IDataSeries interface as a parameter. This method is then used twice, the first time passing in an array of closing prices and the second time passing in a 20 period simple moving average.
1. When working with IDataSeries objects in your code you may come across situations where you are not sure if the value being accessed is a valid value or just a "placeholder" value. To check if you are using valid values for your logic calculations that have been explicitly set, please use .IsValidPlot(int barIdx) to check.