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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X