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

Question about muti-instrument indicator

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

    #16
    Hello EV,

    Thank you for your response.

    With different timestamps at different times, or more accurately the bars closing at different time and dates we can see that the CurrentBar is not the same distance from the Count as the other bar series in the script. Check for this as a condition before entering to avoid entering when the bars are not in sync as you wish.

    Comment


      #17
      To keep this dicussion simple, my questions only pertain to multiple data series that are for the same time period (e.g. 1-day bars). No multiple time periods are involved.

      Are you saying that the different data series are not kept in sync, even if they are all for the same time period (e.g. 1-day bars)? I thought the point was for them to be synchronized.

      If they are not kept in sync, is the any guarantee that you will ever see an entry with the series you want to calculate from synchronized?

      --EV

      Comment


        #18
        Hello EV,

        Thank you for your response.

        What do you mean by in sync? Being that CurrentBar is the same distance from Count as the other series in the script or that their timestamp matches?

        This would not always be the case as certain instruments may have more bars than others for the time period requested. And there may be a date where one of the series had a bar but the others did not or vice versa.

        Comment


          #19
          Originally posted by NinjaTrader_PatrickH View Post
          Hello EV,

          Thank you for your response.

          What do you mean by in sync? Being that CurrentBar is the same distance from Count as the other series in the script or that their timestamp matches?

          This would not always be the case as certain instruments may have more bars than others for the time period requested. And there may be a date where one of the series had a bar but the others did not or vice versa.
          I mean that for data series with the same time period (e.g. 1-day bars) and reflecting the same market (e.g. NYSE) that (Count - CurrentBar) is the same value. Nothing in this thread is talking about multi-time series, just multi-insturment.

          For example, I have noticed cases where the S&P 500 price data series is one bar short of things like advances, decline, new highs, new lows, etc during each cycle until (BarsInProgress==0). Then, and for the rest of that cycle all data series are in sync. Next cycle starts it all over again -- out of sync until after receiving (BarsInProgress==0).

          As to a missing date -- I would hope that would show up as a bar whose data is invalid. Otherwise DataSeries[barsAgo] would give unexpected results. Be that as it may, it is not a factor in what I have observed -- I was working with 1-day bars of S&P 500, NYSE advance, NYSE decline, NYSE new highs, etc. The days should align for each of those.

          At this point I have moved on -- for my particular indicator I am only dealing with 1-day bars from major things as mentioned above so I just begin OnBarUpdate() with "if (BarsInProgress != 0) return;". Perhaps I'll get surprised at some point, but my experience to date says that all of my data series are in sync that way.

          --EV

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          22 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          21 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X