Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

BarsInProgress - when/how to use?

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

    BarsInProgress - when/how to use?

    For my current strategy I am loading up to 3 different time frames using addDataSeries(), and I believe I understand what BarsInProgress does from a functional point of view, but try as I might I'm really missing the use-case(s)/context(s) in which BarsInProgress should/can be used, and why one would do so (I found the documentation at https://ninjatrader.com/support/help...nstruments.htm to be over-simplistic to the point that it wasn't helpful to me).

    Another way to approach the same basic question(s) might be, what reasons are there for not just processing any/all multi-time frame logic without any specific BarsInProgress callouts? Would it be efficiency reasons? Synchronization issues? Something else, I'm overlooking?

    Thank you

    #2
    Hello Calebg,

    BarsInProgress lets you know which series is processing in OnBarUpdate.

    If you want to trigger an action when the primary bar is closing you can add a condition that BarsInProgress is 0.

    If you want to place an order to a secondary instrument you can place the order using BarsInProgress 1.

    Below is a public link to a reference sample that demonstrates adding a secondary series.


    As well as a public link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Just what I need, thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:56 PM
      2 responses
      13 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Felix Reichert, Today, 02:12 PM
      0 responses
      1 view
      0 likes
      Last Post Felix Reichert  
      Started by Tim-c, Today, 02:10 PM
      0 responses
      1 view
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by cre8able, Today, 01:16 PM
      2 responses
      9 views
      0 likes
      Last Post cre8able  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X