State.Configure = This state is called only once for the life of the object.
When I Run button in Strategy Analyzer using SampleMACrossOver strategy:
- then State.Configure is invoked 2x (but expected is only once)
It is easily reproducible:
- Just put a debug point on line:50 in file @SampleMACrossOver.cs
- Run backtest (any settings)
- and see, you get stopped there 2x with debugger
Tested it on:
- NT8 v8.0.2.0
- Windows 10
- CQG datafeed (free demo)
Can you explain, how this can happen?
My expectation is, that is should be invoked only once per lifetime of the strategy, not 2x as it happens.
Added later 2016-12-23 13:14):
- I see, that 2 backtest are run sequentially.
- You can confirm it, when you add Print(Times[BarsInProgress][0]); into OnBarUpdate().
- I just clicked Run button once, so I cannot explain, how it is possible, that 2 runs of the same strategy are executed sequentially. You can see evidence in the Output window.If you scroll from start till end, you will see, there are all prints twice, in sequence. It is very strange...
Comment