Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to ensure a time-based operation is performed when OnBarUpdate is not called

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    In fact in the strategy right now BIP = 0 (daily) is only there for chart display and ignored in the code. Trades are taken on the 7th series... (subject to change)

    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

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    59 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X