Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to tell if bar is closed

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

    How to tell if bar is closed

    Hi,
    It's my understanding that if I have CalculateOnBarClose set to false then OnBarUpdate will get called for each tick. I need to do different processing depending on if the OnBarUpdate call is for a bar that is closed vs. on that is still (pardon the pun) "ticking". The question is how can I tell the difference?
    Thanks ... Ed

    #2
    Originally posted by edstaffin View Post
    Hi,
    It's my understanding that if I have CalculateOnBarClose set to false then OnBarUpdate will get called for each tick. I need to do different processing depending on if the OnBarUpdate call is for a bar that is closed vs. on that is still (pardon the pun) "ticking". The question is how can I tell the difference?
    Thanks ... Ed
    The Historical property. If true, the bar is closed.

    Comment


      #3
      Hello Ed,

      You can use Historical property as Koganam suggested.

      if(Historical) return;

      This sample code will return the OnBarUpdate() method when Historical is true.

      http://www.ninjatrader.com/support/h...historical.htm
      Cal H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      131 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      74 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      117 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      111 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      89 views
      0 likes
      Last Post CarlTrading  
      Working...
      X