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 DJ888, Today, 10:57 PM
              0 responses
              2 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              158 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Today, 09:29 PM
              0 responses
              7 views
              0 likes
              Last Post Belfortbucks  
              Started by zstheorist, Today, 07:52 PM
              0 responses
              7 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              151 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Working...
              X