Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Real time vs OnBarUpdate

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

    Real time vs OnBarUpdate

    Hi,

    is there a way to execute orders in a strategy at the moment it crosses the desired point, as opposed to on the next bar after it has crossed that point? Is there a way to tell the strategy that it doesn't have to wait for the bar update, but rather execute the order immediately when the conditions are met?

    Thanks.

    #2
    Hello werido,

    Yes, this is controlled with CalculateOnBarClose.

    False = Logic is processed with every incoming tick.
    True = Logic is processed at the close of a bar.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hello werido,

      Yes, this is controlled with CalculateOnBarClose.

      False = Logic is processed with every incoming tick.
      True = Logic is processed at the close of a bar.

      Thanks. Now, if I set CalculateOnBarClose to True in the strategy code but set it to False in the option when applying the strategy to the chart, will that False override the "True" that's in the code and calculate it on each in coming tick?

      Thank you

      Comment


        #4
        Yes, the selection made in the gui (false in this case) will override whatever is written in code.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thank you!!

          Comment


            #6
            wait, all my strategy conditions in the code are under OnBarUpdate, so even if I change CalculateOnBarClose to false, do I need to change the OnBarUpdate to OnTickUpdate or something like that to make the strategy execute the moment it meets the conditions and not wait for the the bar to update?

            Comment


              #7
              No, there is only one property that controls this - CalculateOnBarClose
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              27 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              117 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 05-10-2026, 08:12 PM
              0 responses
              69 views
              0 likes
              Last Post CarlTrading  
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              226 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              415 views
              0 likes
              Last Post CaptainJack  
              Working...
              X