protected override void Initialize()
{
Add(AdaptiveSuperTrend(0.92,16200,false));
}
It plots OK and the strategy is processed quickly. When I use it in OnBarUpdate() thus:
if (Position.MarketPosition == MarketPosition.Long && aptiveSuperTrend(0.792,16200,false).Oscillator[1] == 0.0 )
{
ExitLong("allLongs","");
}
The strategy takes forever to run. If the numbers of days is say 50 days of 1min bars then Ninja crashes with an out of memory warning.
When I added the plot using Add(AdaptiveSuperTrend(0.92,16200,false)) a dataseries object must have been created. Is there a way I can access it to avoid calling AdaptiveSuperTrend(0.92,16200,false) for each iteration of the backtest.
Here is the message from the log file:
5/21/2013 12:22:35 AM|3|128|Error on calling 'OnBarUpdate' method for strategy 'New/66d0fc7216204c768b0d7749e5b96906': Exception of type 'System.OutOfMemoryException' was thrown.

Comment