I am trying to convert a price series to an array that I can pass as a parameter to a custom method.. I have tried the approach below but no luck.
List<Series<double>> arrayOfDoubleSeries = new List<Series<double>>();
arrayOfDoubleSeries.Add(new Series<double>(Median));
double[] data = arrayOfDoubleSeries.ToArray();
I get the errors:
MyCustomIndicator.cs Argument 1: cannot convert from 'NinjaTrader.NinjaScript.ISeries<double>' to 'NinjaTrader.NinjaScript.NinjaScriptBase'
MyCustomIndicator.cs Cannot implicitly convert type 'NinjaTrader.NinjaScript.Series<double>[]' to 'double[]'
Is there a way to convert a price series to an array? I'd like to pass that array to a custom method.
Thanks for any suggestions or help. It would be appreciated.
EDIT: Yes, I can use a loop and create the array from the series but I was looking for something more efficient.
Comment