Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate skipped when no data arrives

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

    OnBarUpdate skipped when no data arrives

    Hi

    I'm aware of the design constrains that led to the problem with OnBarUpdate() only firing when a tick arrives within that bar.
    But it's very limitative, as you may agree. I can't, for example, force a position at a specific time of day and be sure it will be posted exactly at that time. Or I may depend on indicators whose value changes even when no new data is present. Here's a good example:
    An EMA's natural behavior is to naturally decay towards the last bar's value when no data arrives. This decay could trigger a position, for example.
    Another good example would be a strategy that depended on external data (a thread launched on Initialize() that regularly retrieves data from the internet and makes it available to be consumed by the next OnBarUpdate()).

    Is there in the works any fix/workaround to this problem?

    Thanks!

    Sergio

    #2
    NT 6.5 due out in beta late this week supports other event driven methods in addition to OnBarUpdate() such as OnPositionUpdate(), OnOrderUpdate(), OnMarketData() etc.... You can also trigger off of user defined events such as a windows timer object.
    RayNinjaTrader Customer Service

    Comment


      #3
      That's SO neat! Will I be able to place / cancel orders even during those events, I mean, outside an OnBarUpdate call?
      On the same note, will I be able to place orders on different instruments than the one being triggered?

      thanks for your time

      Comment


        #4
        Yes to all questions.
        RayNinjaTrader Customer Service

        Comment


          #5
          Hi, I've been trying to use a timer with 6.5 beta, as described in your post below.
          The 1st problem I notice is that I have no way to know whether the strategy is still running or not in order to disable the timer.
          Is there a flag, an event or some overridable method that I can use to check if the strategy is still running?

          TIA!

          Comment


            #6
            See the Dipsose() method.

            RayNinjaTrader Customer Service

            Comment


              #7
              That worked like a charm. Thanks Ray!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              605 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              351 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              561 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X