Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate Confuse

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

    OnBarUpdate Confuse

    Hi
    I am confused. i add a data series by AddDataSeries method in the constructor of strategy. i set the period to 150 tick, when i run the strategy in a new chart, i set the interval to 5 minutes. now i want to know when Onbarupdate method is called? every 5 minutes or every 150 ticks?

    #2
    Hello amiralimadadi,

    Both data series will call OnBarUpdate() as each series is updated based on your Calculate setting.

    To help see this, on the OnBarUpdate section you can add this print statement:

    Print ("OnBarUpdate called by: "+BarsInProgress). BarsInProgress 0 will be the 5 minute bars and BarsInProgress 1 will be the 150 tick bars.

    Reference: https://ninjatrader.com/support/help...inprogress.htm

    Please review the multi time frame section of the helpguide as there are a number of concepts you will want to review to best help you work in this environment: Reference: https://ninjatrader.com/support/help...nstruments.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X