I am developing a strategy.
I have been building codes for calculations, and have been advancing with no compilations errors.
But now, developing the adition of entries and exits, I see in the Log tab :
"Error on executing DB command: System.InvalidOperationException:There was an error reflecting type
'NinjaTrader.NinjaScript.Strategies.mts66' -> System.InvalidOperationException:
Cannot serialize member'NinjaTrader.Ninjascript.Strategies.mts66.SK _dim0 of type 'NinjaTrader.NinjaScript.Series'...
In this message, mts66 is the name of this strategy,
and SK_dim0 is an ISeries<double>
In my code I have defined :
public Series<double> SK_dim0;
...
SK_dim0= new Series<double>(BarsArray[0],MaximumBarsLookBack.Infinite);
...
In OnBarUpdate() I do:
SK_dim0[0] = Math.Round(S_dim0.K[0],2); // S_dim0 is the StochasticsFast variable
Before adding orders for entries and exits, the code for calculations of this StochasticsFast had no compilation errors, Printing values correctly....
But now, adding orders ( entries and exits code...) I have this error.
I have reset the DB, restart Ninja, but the error appears again....
I donīt find why it happens.
Comment