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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, Yesterday, 02:41 AM
        0 responses
        14 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        23 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Working...
        X