Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7 - CurrentBar internal pointers updated earlier

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

    NT7 - CurrentBar internal pointers updated earlier

    All,

    In relation to the below NT7 Code breaking change, please confirm the change only serves to sync multiple series.

    CurrentBar internal pointers are now updated earlier. This ensures that accessing bars across multiple series will be in sync regardless of which BarsInProgress context you may be working out of.
    o For historical, pointers for all bar series with the same timestamp will be updated before
    OnBarUpdate() will be triggered.
    o For real-time, pointers for all bar series of the same instrument will be updated before
    OnBarUpdate() will be triggered.
    In the event a Strategy is designed to execute realtime in the last few seconds of a bar (with CalculateOnBarClose = false), to get meaningful results from the Strategy Analyzer (where OnBarUpdate() is only called on the close of each historical bar) does execution information still have to refer to the prior bar? For example, VariableWhatever = High[Historical ? 1 : 0];

    Regards
    Shannon

    #2
    Shannon, this is correct in backtesting you would refer to High[0] and in realtime trading with COBC = false this would be referred to High[1] still.

    Comment


      #3
      Bertrand,

      Thank you for the reply. Unfortunately it is 100% contrary to my understanding.

      Where CalculateOnBarClose = false....

      In the attached diagram, a realtime strategy is designed to execute just prior to bar close enter approximately at bar close (circled red) and set the High and Low of the current bar as variables.

      Now, where this strategy is run on historical data, the strategy is executed at bar close. Entry will be at the open of the subsequent bar (circled red). Should the High of execution bar be set as High[1] (as per diagram) or High[0]?

      I'm of the believe that it should be High[0] but am receiving errors from TraceOrders.

      Regards
      Shannon
      Attached Files

      Comment


        #4
        Shannon,

        Your diagram is inaccurate. When you are backtesting the bar you have marked with High[1] and Low[1] is not [1] indexed. That is the [0] index at the point in time the strategy is processing that bar. What it decides to do as an action for trading is then done on the next bar. When you get to the next bar and placed the trade then the bars you are referencing do become [1] indexes, but until then, they are [0] for programming purposes.

        CalculateOnBarClose = false in realtime will show [0] on the bar you are checking and then it will be able to place trades on that same bar as well.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        601 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        559 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X