I am running a strategy, that opens based on the latest price a bracket order.
When I start the strategy in live mode then first it loads some old data, and in the Method OnBarUpdate, when I fixate the starting price, I get some old price and the strategy doesn't work.
To prevent that I am checking for the historical state, and only respect the price when the state is not historica.
State != State.Historical
This makes the strategy work fine.
But I have than a problem with the backtest, it has only historical data I assume.
I tried checking BarsInProgress == 0, but it didn't help.
How is it possible to make the strategy using only latest data during live market run and all data during backtesting?
Where do I get a log for the strategy analyzer. When I start the strategy in live mode, it trades. When I backtest it for one year with all test data available, I get an empty result with zero trades.
Thanks and best regards

Comment