Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Open[0] with CalculateOnBarClose = true

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

    Open[0] with CalculateOnBarClose = true

    the first tick of the bar just showed up. I presume this is when OnBarUpdate() gets called.
    is the price of this tick equal to Open[0]? if not, what is the opening price of this (and not the previously finished) bar?

    #2
    Hello jalexan1,

    Thanks for your post.

    When using CalculateOnBarClose = true, the Open[0] would be the open of the latest finished bar and not of the currently forming bar. Your code would be unaware of the currently forming bar until it too closed and became the CurrentBar.

    When using CalculateOnBarClose = false, the Open[0] would be the value of the first tick of the currently forming bar. In this case, CurrentBar is the currently forming bar.

    When CalculateOnBarClose = true, you only get an OnBarUpdate event at the close of the bar, once per bar.

    When CalculateOnBarClose = false, you will get an OnBarUpdate event on every tick (live data only, historical data is processed like CalculateOnBarClose = true).

    Reference:
    http://ninjatrader.com/support/helpG...onbarclose.htm
    http://ninjatrader.com/support/helpG...currentbar.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X