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 ZenCortexCLICK, Today, 04:58 AM
        0 responses
        2 views
        0 likes
        Last Post ZenCortexCLICK  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        172 responses
        2,280 views
        0 likes
        Last Post sidlercom80  
        Started by Irukandji, Yesterday, 02:53 AM
        2 responses
        17 views
        0 likes
        Last Post Irukandji  
        Started by adeelshahzad, Today, 03:54 AM
        0 responses
        4 views
        0 likes
        Last Post adeelshahzad  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X