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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X