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 Belfortbucks, Today, 09:29 PM
        0 responses
        6 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
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        6 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Working...
        X