The idea to use a liquid instrument as a substitute for timer actually crossed my mind briefly at the start of this thread when I realized NT architecture will only call my code when there is trading activity and I was somewhat reluctant to use a timer at first. I didn't put too much thought into it for a number of reasons, data and other, I waited to see if there was an easier solution in code. Apparently for backtest there isn't, not without some pain involved, so I think I will actually go the liquid instrument way, seeing that you bring it up, not only does it help clear some hesitations I had and gives me the push, I take it also as specific advice to drop the look-ahead solution, which gladly I will.
Really and sincerely many thanks!
I believe ES e-mini is the most liquid instrument and can be used as a substitute for timer with 1-second time frame. It is traded almost around the clock and even going back a couple of decades it was liquid enough. There is still no guarantee that OnBarUpdate will be called every second, but for the times of day of my scheduled tasks I think it should be fine.
This not only will allow for an easier implementation in backtest but will also allow preliminary testing in real time using the same version as in backtest. Once I see that it works I will go ahead and implement a timer, and by then there will be reference to compare to, so I'd know if something doesn't work it's not the strategy, it's because I messed up the code...
I have to say I truly appreciate your kind help, taking the time to write and give advice for no incentive other than simply to help someone else. It's inspiring and sets an example.
May the force be with you!
Comment