Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Syncronizing between many instruments

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

    Syncronizing between many instruments

    Hi All,

    I'm working on a strategy that load many instruments(~100) and do some checking to enter a position on bar close in OnBarUpdate().
    I want to do the check only once so I have:
    Code:
     if (BarsInProgress != 0)
                    return;
    I know that NT is event driven so my issue is what happens if some of the instruments trades less frequent then the BarInProgress == 0 or vice versa, what data I'm referring to in the call for OnBarUpdate() when I'm using for example Closes[50][0]?

    I hope I made my question clear :-)
    Tx in advance!

    #2
    freewind, you're correct NT would be event driven - if you call Closes[50[0] on BIP1 context this would give you the last known value of the Close from this series, the last time it called the OnBarUpdate().

    Comment


      #3
      OK, and when I'm backtesting can I assume I get the data of the current bars for all of my instruments?

      Comment


        #4
        Correct, the [0] index would point towards the last known value of the array's context you're working with.

        Comment

        Latest Posts

        Collapse

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