Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Opening charts often fails to load all data, showing gaps

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

    #16
    adamus, do you see any of the pacing violation messages from IB in the log that Harry mentioned in his replies? Are there any other errors in the log or trace? So the issue exists only in the internally loaded series via the Add() method for you?

    Comment


      #17
      Originally posted by adamus View Post
      2013-10-15 23:00 is the 50th bar in the bars collection. The 49th bar is also yesterday, but 00:00. So Ninja loaded 49 bars OK, but for reasons unknown, stopped at 2013-10-15 00:00.

      This was the secondary time-frame in an indicator on a 3-min chart of the same instrument.
      I don't want to interfere too much, but if you load a secondary bar series via an indicator, the problem may have been caused by the indicator code. When the primary bar series is processed, the last bar of the secondary bar series may not yet have been processed. This is due to the way NinjaTrader processes the primary and secondary bars.

      Comment


        #18
        Originally posted by NinjaTrader_Bertrand View Post
        adamus, do you see any of the pacing violation messages from IB in the log that Harry mentioned in his replies? Are there any other errors in the log or trace? So the issue exists only in the internally loaded series via the Add() method for you?

        Hi Bertrand,
        no, there were no pacing violations. I am very familiar with pacing violations so I can say that definitively.

        You are correct that this issue only exists in the dataseries added in the Initialization Add() routine.

        Thanks

        Comment


          #19
          Originally posted by Harry View Post
          I don't want to interfere too much, but if you load a secondary bar series via an indicator, the problem may have been caused by the indicator code. When the primary bar series is processed, the last bar of the secondary bar series may not yet have been processed. This is due to the way NinjaTrader processes the primary and secondary bars.
          As I understand it, the primary dataseries is processed first, via OnBarUpdate() with BarsInProgress == 0.

          Then the subsequent dataseries are processed.

          Since my code to check the timespan since the previous bar is only executed in OnBarUpdate() for the current dataseries (which are accessible via Time[0], Close[0] etc without needing to reference BarsInProgress), then the state of the other dataseries outside of their respective OnBarUpdate() events is irrelevant, no?

          Comment


            #20
            Originally posted by adamus View Post
            Hi Bertrand,
            no, there were no pacing violations. I am very familiar with pacing violations so I can say that definitively.

            You are correct that this issue only exists in the dataseries added in the Initialization Add() routine.

            Thanks
            Thanks adamus, I would not have an explanation from the scenario presented and would need to reproduce it here to further investigate and potentially follow up with development. How did you exactly determine that the bar was not loading as you would expect? Per your custom routine posted? To isolate any custom code contributing here, please just print the CurrentBars / OnBarUpdates you get for your load scenario to confirm.

            Comment


              #21
              Hi Bertrand,

              obviously that gap disappeared because I had to trade and got it fixed before I read your reply.

              Today it is behaving itself. I have a Print statement in there to output the BarsInProgress, CurrentBar and bar time, but I need to distinguish which chart outputs which line.

              I was using ChartControl.ParentForm.Name but that isn't working in all cases.

              How can I get that title?

              Thanks

              Comment


                #22
                Completely understood adamus - I think you can look into ChartControl.ParentForm.Text for that task.

                Comment


                  #23
                  Ah, OK. The reason I asked is because sometimes when I want to use ChartControl.ParentForm.Text, I find it has no value. I haven't double-checked, but sometimes I use it in OnStartUp. Could it be that it is only initialised on the first bar?

                  Comment


                    #24
                    Never without a gap, every day since I started this.

                    This is the gap I had today.

                    Chart[$EURUSD (3 Min) 2013-10-18] Indicator: PermaCodeSR005 bar#74 60Minute @2013-10-17 23:00 is more than 1 bar interval since previous bar! (2013-10-17 00:00). Should be time span of 0 days 1 hours 0 mins & 0 secs. Try reloading historical data.

                    Hope it gets us somewhere.

                    This was a clean load after I filled the HDM with data from IQ Feed which avoided the Interactive Brokers 'pacing violations' minefield - although it is while running against Interactive Brokers, since I disconnected from IQ Feed and reconnected to IB (yesterday).

                    This morning I just loaded up Ninja and connected to IB as usual.
                    Attached Files
                    Last edited by adamus; 10-18-2013, 01:08 PM.

                    Comment


                      #25
                      adamus, sorry to hear - when you say clean load, did you remove the previous cache for the session template used as well?

                      Comment


                        #26
                        No I haven't touched the cache.

                        I'll try deleting the cache before starting Ninja everyday and see what effect that has.

                        Comment


                          #27
                          Ok, thanks - please let me know how it goes.

                          Comment


                            #28
                            So far (just this week) I have loaded the charts 2 without deleting the cache first, and both times (including today) it gave me a gap.

                            The other 3 days, I deleted the cache, and loading up and connecting Ninja to IB went like a dream.

                            Also as I said above, sometimes ChartControl.ParentForm.Text has no value - as in the error messages I generate for this situation. Why would that be? Is there any other place to obtain the window name?

                            Thanks

                            Comment


                              #29
                              That's great to hear adamus, thanks for the update. Would not have another idea for the chart window name directly, besides building a custom string perhaps with instrument, bars period id / value and potentially a user supplied suffix as well so you can directly pin the sender chart.

                              Comment


                                #30
                                Bertrand,

                                I forgot to delete the cache again today, got a gap in the data.

                                Have you got this logged as an issue now?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                85 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                47 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                29 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                32 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                67 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X