Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Corollary to OnBarUpdate?

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

    Corollary to OnBarUpdate?

    Is there a method that runs when OnBarUpdate is not running?

    Suppose I have a single time frame, single instrument strategy. Say the bars are 30 minutes. As I understand, at each new bar (so, every 30 minutes), OnBarUpdate is invoked, and my strategy runs the bulk of the algorithm.

    I want to run something in the strategy between each OnBarUpdate between bars. Instead of OnBarUpdate => Downtime => OnBarUpdate => Downtime, I want to do OnBarUpdate => OtherProcessing => OnBarUpdate => OtherProcessing, etc.

    It would be nice if there was a NotOnBarUpdate, or some method that is automatically invoked when OnBarUpdate is not going to be invoked.

    Does this make sense? Poking around in the documentation has methods for multiple time frames. I could do something like this, but it feels like more of a hack. Moreover, I would prefer to run the in-between processing asynchronously, and not necessarily on a period faster than my Input bars.

    Thanks!

    #2
    It sounds as if you are looking for the advanced event driven programming methods, or you could just use another data series at a faster time frame.

    ref: http://www.ninjatrader.com/support/h...n_program2.htm

    Comment


      #3
      Hello,

      Thanks for your forum post.

      We did not design NinjaTrader to operate this way as we did not see the benefit from it not sure of the advantages of doing this or why this would need to be done or most likely their exists an alternate programming method that would fit into the OnBarUpdate() methodology. However you do have another option.if you do not want to use OnBarUpdate(). You can use the following to do some processing on a standard set schedule using a timer.



      If this will not work for you let me know and I will put a recomendation into development on this for you.

      Let me know if I can be of further assistance.
      BrettNinjaTrader Product Management

      Comment


        #4
        Originally posted by Serac View Post
        Is there a method that runs when OnBarUpdate is not running?

        Suppose I have a single time frame, single instrument strategy. Say the bars are 30 minutes. As I understand, at each new bar (so, every 30 minutes), OnBarUpdate is invoked, and my strategy runs the bulk of the algorithm.


        Thanks!
        Not sure exactly what you are looking for.

        If you are working with 30 minutes bars and want to perform some processing before the 30 minute bar is complete then set CalculateOnBarClose = false. This will force processing for each incoming tick inside a 30 minute bar. You will then need to rework your logic to do the bulk of the processing when the 30 minute bar is complete by checking for the First Tick of the new 30 minute bar.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        646 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X