Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarClose...

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

    OnBarClose...

    When I create a strategy and select OnBarClose calculation option, to which bar does high[0] refer to in my OnBarUpdate() method? Does it refer to the bar that just closed(the one I want to calculate on)

    Thanks

    #2
    High[0] would refer to the high of the most recent bar (the one that just closed).
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hmmm,

      If High[0] refers to the bar that just closed how do we refer to the bar that is currently being updated?

      For instance a 1 hour bar will be updating for a whole hour. How do we refer to that bar in the code?

      Comment


        #4
        To refer to the bar that is currently being updated, you'll have to set Calculated On Bar Close = false in Initialize() and then series[0] will give you the current (updating) bar's values. If you choose that path, then the bar that has just closed will be series[1].
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        88 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        48 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        30 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        34 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        68 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X