Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

9:30 bar

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

    9:30 bar

    HI Folks,

    I wrote some indicator and rely on calculation to mark bars based on their numbering. What i do in code is calculate how many bars passed since midnight (ETH) to session start (RTH - 9:30 for S&P e-mini) - 113 bars and start marking from that position.

    Paid attention that for the same date data (NRD file) sometimes markets are as expected, sometimes shifted by 1 bar to the right (marking 1 bar late). Same code, same date, market replay data.

    After careful investigation, came to my attention that 9:30 bar is sometimes missing on the chart according to data box.
    What do I mean? Take a look at pictures, bar on the right of data box is pointed by the mouse, switches from 9:25 right to 9:35 skipping 9:30 bar. and I think this is why it is being skipped for me and markers appear on 1 bar later than they should.
    Can you please explain the phenomenon of disappearing 9:30 bar?
    Note that this is S&P emini futures from Jan 28, 2022.
    Click image for larger version  Name:	9.30.jpg Views:	0 Size:	102.4 KB ID:	1187778
    Last edited by stasha; 01-31-2022, 03:07 PM.

    #2
    Hello stasha,

    Thank you for your inquiry.

    I'd be happy to download the data and attempt to reproduce the issue on my end. So that I'm certain that I am looking at the correct candles, what is your local time zone?

    Additionally, what 'Trading Hours' template is applied to the chart? This can be found by right-clicking on the chart, and selecting 'Data Series'. The trading hours setting is in the 'Time Frame' section.

    Did you download this Playback data from our server or was this data that you recorded yourself?

    I look forward to your response.
    Zachary S.NinjaTrader Customer Service

    Comment


      #3
      Thanks for prompt response. Data series shows <use instrument settings> (presume nothing is applied, it is a default) and time zone is eastern (Toronto).
      Playback data used downloaded using NT8 -> Tools -> Import -->Historical Data

      Comment


        #4
        Hello stasha,

        Thank you for your response and for that information.

        When I download this same date of data for ES 03-22 and use the same settings, I do not experience the same behavior. My 9:30 bar is present. Since that is the case, there is something isolated to your installation that is resulting in this issue. We will need to figure out what that is. The first thing that I want to do is redownload the data and test on a chart in Safe Mode without your custom script. Please do the following;
        • Go to Tools > Historical Data
        • From the 'Edit' tab, expand the 'Market Replay' section
        • Select the ES 03-22 section
        • Delete January 28th by locating it on the right hand side, right-clicking on it and select 'Remove'
        After removing the existing Playback data, please redownload it from Tools > Historical Data > Load > Get Market Replay.

        After the download has completed, please launch NinjaTrader in Safe Mode and follow the steps below;

        Safe Mode will prevent NinjaTrader from:
        • Loading workspaces.
        • Connecting on start-up.
        • Loading custom assemblies.
        • Getting instrument updates from the server.
        To enable safe mode, please use the following steps:
        • Exit NinjaTrader.
        • Hold the CONTROL key and double click the NinjaTrader icon.
        • Keep the CONTROL key held down until you see the Control Center.
        • You can verify you are in safe mode by going to Help -> About.
        Once you have opened the platform in safe mode:
        • Reconnect to the Playback Connection from the 'Connections' menu
        • Please open a new chart with no custom bar types/indicators/templates, load January 28th and test for issues by attempting to locate the 9:30 candle that was previously missing.
          • Please note this will not delete your workspace however the new blank workspace will be named Untitled. If you have a workspace already named "Untitled," however, you will not want to save the workspace when exiting NinjaTrader, otherwise, it will overwrite it.
        Please let me know the results of this test.
        Zachary S.NinjaTrader Customer Service

        Comment


          #5
          Hi Zachary,
          Thank you for suggestion! After playing with this a little, I conclude it is a data file. I could not attach the problematic file (over 50M in ZIP) but its clearly missing information (9:30 bar).

          Substitute good file you downloaded with this one, you'll see it.

          Now the issue is that it happens more than half of the time so it is certainly worth your attention.
          I am not sure if its specifically 9:30 bar every day or smth else, but I see that if I use Indicator.CurrentBar as my counter of bar numbers and trying to offset midnight to RTH session (113 bars) sometimes it falls on 9:30 (correct), but sometimes its 9:35 (missing data file). About 50% of the time.
          I download the data file every day for the previous day (past midnight). And as said before sometimes its complete and some other times its missing info (1 bar, since my offset starts 1 bar later than expected 50% of the time).
          Any suggestions?
          Last edited by stasha; 02-01-2022, 08:06 AM.

          Comment


            #6
            Hello stasha,

            Thank you for your reply.

            When I load this data file on my end, I have the 9:30 candle. It is not the data file, but something else on your chart that is causing the issue. I have suspicion that it may be your script. Did you complete the test that I requested using Safe Mode?

            I've quoted this message again for you below;

            Please do the following;
            • Go to Tools > Historical Data
            • From the 'Edit' tab, expand the 'Market Replay' section
            • Select the ES 03-22 section
            • Delete January 28th by locating it on the right hand side, right-clicking on it and select 'Remove'
            After removing the existing Playback data, please redownload it from Tools > Historical Data > Load > Get Market Replay.

            After the download has completed, please launch NinjaTrader in Safe Mode and follow the steps below;

            Safe Mode will prevent NinjaTrader from:
            • Loading workspaces.
            • Connecting on start-up.
            • Loading custom assemblies.
            • Getting instrument updates from the server.
            To enable safe mode, please use the following steps:
            • Exit NinjaTrader.
            • Hold the CONTROL key and double click the NinjaTrader icon.
            • Keep the CONTROL key held down until you see the Control Center.
            • You can verify you are in safe mode by going to Help -> About.
            Once you have opened the platform in safe mode:
            • Reconnect to the Playback Connection from the 'Connections' menu
            • Please open a new chart with no custom bar types/indicators/templates, load January 28th and test for issues by attempting to locate the 9:30 candle that was previously missing.
              • Please note this will not delete your workspace however the new blank workspace will be named Untitled. If you have a workspace already named "Untitled," however, you will not want to save the workspace when exiting NinjaTrader, otherwise, it will overwrite it.
            Please let me know the results of this test.
            Zachary S.NinjaTrader Customer Service

            Comment


              #7
              Hi Zachary,
              Please see images and attachments. I am confident at this point that this is a NRD file and not script. Reason:
              yesterday I've downloaded that file and it showed 9:30 bar. File was 146.5 MB.
              I decided to do the same today: downloaded new file, which is 145.9 MB (smaller) and is missing the 9:30 bar. See images, it is in safe mode.
              Bottom line: by downloading the file you get new file every time, and roughly half of the time the file is missing info. It is not corrupt, as NT takes it and renders it, but it is smaller size and missing that one bar. Again to reiterate: this happens too often to ignore. Honestly, knowing the tech, the file must be replicated to avoid loss and I think the data provider sends to file from the server that is less busy but the file itself is of diff size and when its smaller it is missing information.
              The newly downloaded file is under the same share as above zipped in 20220128 bad 2.zip
              Please LMK your thoughts
              Thanks

              Comment


                #8
                Hi Zachary

                More to see: i have 2 NRD files for 28-01-2022 data: 1 without 9:30 bar (downloaded today) and 1 with 9:30 bar (downloaded today).
                I ran both and compared the charts (attached). Charts are different (same day, same instrument, same timeframe, but file size is diff and bar is missing). Both runs are in safe mode as described above.
                To reiterate: this is not just this specific day that it happens, but happens to me half of the time. Trust i've isolated the issue to input data , but correct me if I am wrong here.
                Possible cause i have described in my previous post: get different file based on load balancer and sometimes you get "good" file, some other times, however, file is missing info.
                Hope you can suggest some work around or some fix to mitigate this issue. Happy to help in any way - let me know if I can.
                Thanks

                Comment


                  #9
                  Hello stasha,

                  Thank you for your detailed responses and patience as we troubleshoot this problem.

                  I can definitely understand that this must be a frustrating issue to have to try and work with. I've been trying my hardest to recreate the problem on my end with my installation of NinjaTrader with various different processes. I once again downloaded each of the files provided (both file 1 and file 2) in an effort to reproduce this problem, and was unable to recreate it with either of them. To ensure that something wasn't caching on my end from when I'd previously loaded the chart, I made sure to delete my historical minute data and chart data cache as well to no avail. I've tried with multiple different days and instruments from the server as well with no luck. Lastly, I've even tested with a brand new installation and changed my time zone on my PC to try and rule out various factors that may be different between your setup and mine. As a test, I would like you to try loading this same date of data after clearing your cache and historical minute data to see if you continue to get the same result. In this case, I'm going to have you rename the folders rather than delete them so that you can retrieve your saved historical data easily should the test result in the same behavior. Please do the following;
                  • Shut down NinjaTrader.
                  • On your PC, open the Documents > NinjaTrader 8 > db folder.
                  • Rename the sub-folder named 'cache' to 'cacheOLD'
                  • Rename the sub-folder named 'minute' to 'minuteOLD'
                  • Restart NinjaTrader in Safe Mode
                  • Connect to the Playback Connection and open a new 5 Minute chart for ES 03-22
                  • Allow the data to play back until after 9:30 AM on 1/28 or use the 'Go To' feature to jump ahead to a point where the data has loaded
                  • Report back and let me know if you continue to see the same
                  I look forward to your response.
                  Zachary S.NinjaTrader Customer Service

                  Comment


                    #10
                    After doing all of the above (rename, restart, "go to" to some time PM the same day,
                    I only get 1 bar at that time where the chart jumped, other bars disappeared as in the pic
                    Last edited by stasha; 02-01-2022, 03:42 PM.

                    Comment


                      #11
                      Hello stasha,

                      Thank you for your reply.

                      Since we renamed the minute folder, your saved historical data is no longer loading and with the Simulation Edition key, the chart will not backfill with the historical data up to that point when you use the Go To feature unless you have saved it locally already. I'd recommend instead using the Go To feature to go back to 7 or 8 AM that day, and allowing the data to play back until after 9:30 AM. You can increase the speed when you are doing that so you don't have to wait for the candles to build at real-time speed.

                      Please let me know the results once you are able to do that.
                      Zachary S.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Zachary,

                        Back to square 1: i see data file is missing a file (see attached). This time i screen capped with steps recorder that shows the mouse pointer at the moment of recording.
                        You can clearly see bar 9:25 and 9:35 and no 9:30 between.
                        If I download that date file again it will be either 145.9 MB (this file, missing info) or 146.5 MB (not missing info). I played with this file today plenty of time and can tell that there are 2 different filse being downloaded. Either smaller (missing info) or little bigger (not missing info). Non of them is corrupt, but one is smaller than the other if you download many times. Its like flipping a coin.
                        And again, happens on other days too. This one is just example.
                        Not sure how to proceed as my indicator relying on CurrentBar variable to give me the correct bar number for current bar. Sometimes 9:30 bar is 113, but some other times its 114, based on this calculation:

                        Code:
                        var midnightOffset = (int)Math.Round((RTHStartTime.TimeOfDay.TotalMinutes / BarsPeriod.Value), 0) - 1; // 0 based
                        RTHStartTime is user property and is set to 9:30, so it is a calculation of how many bars passed since midnight.
                        If downloaded file is complete bars marked by indicator are fine, as expected, but with files like i am dealing with here, bars marking is shifted by a bar. Happens every other day , so I have to download the NRD file multiple times, until complete file downloaded.
                        This is because some times 9:30 bar is actually 9:30 bar, and some other times, based on bar count it is 9:35 bar, since for this very day the 9:30 bar is missing somehow. Can't explain it, and not sure how to make this midnight offset reliable, due to missing bar.

                        Added:
                        - new picture chart with good file (you can see that the chart is different and pay attention to mouse iointer and timestamp in data box)
                        - 3 files for the same day - different file sizes and different creation time for each (good and bad means missing info or not, based on chart)
                        all 3 files are uploaded to the sharing place above , not sure how can you not reproduce it, for me whatever file i run that result i get.
                        bad means missing info, good means complete file, it is even little bigger in size
                        Last edited by stasha; 02-01-2022, 08:18 PM.

                        Comment


                          #13
                          More proof bar is missing, I am in debugger looked at "good" file - everything is hunky dory, markers are in the right places.
                          Switched to "bad" file and look at this image, bar 112 is 9:25 bar, bar 113 is 9:35 bar. ultimate proof. if you want me to upload same info with good file, so that bar 113 will be 9:30 i can, let me know and let me know how to work around "bad" files while downloading. currently it is multiple times download and trying until it works,
                          i showed that 3 downloaded files for the same date have different sizes, creation times and content, both visually and in terms of variables in the debugger.
                          i am not sure what else can i provide to demo that this is an issue. now, i need to be able to rely on bar count to know that bar 113 is 1st bar of the day (including night session), but as you can see it is not always the case, please suggest workaround. but the best would be to have reliable data to begin with. it happens almost every day that you need to download file multiple times.

                          I don't see issues with reproducing it:
                          - set NT8 to run 1 day only: Start: 01/28/2022 End: 01/28/2022
                          - make sure it is on 12:00:00 AM (handle is on the most left, near play button)
                          - whatever file you have under "...\NinjaTrader 8\db\replay\ES 03-22\20220128.nrd" replace with one of "bad" ones from https://drive.google.com/drive/folde...Djx6K1HV6sDx3y
                          - run the day past 9:30 AM, say till 10:00 AM
                          - open data box and look at bars around 9:30.

                          If its a "good" file (under the same location) you will see 9:30 bar, if one of "bad" ones - you won't.
                          that works for me and screwing my indicator that relies on bar closing at 9:35 (1st bar on RTH (day session)) being number 114, but sometimes it is bar number 113 because last bar from ETH (night session) (bar closing at 9:30 AM) is missing.

                          thank you very much for sticking with this - this is very basic, as you cannot have different chart for the same day depending on what file you had downloaded.
                          it is clearly data issue. please confirm you could reproduce it. once you did, lets see what can be done about it.

                          Added: 20220131 file as a zip with missing 9:35 bar this time in the same sharing location, check it out. It goes from 9:30 to 9:40 straight
                          Last edited by stasha; 02-01-2022, 10:14 PM.

                          Comment


                            #14
                            Hello stasha,

                            Thank you for your reply.

                            Unfortunately, I cannot reproduce this problem at all on my end. I've tried with the files from the 28th that you provided, the file from the 31st that you've provided, I've tried downloading them from the server myself multiple times, I've tried changing the time zone on my PC to your local time zone and downloading them, I've tried working with a new installation, and no matter what I do, this behavior does not occur for me whatsoever. Every file that I've tried works the exact same 100% of the time. I've also had my Team Lead take a look at this problem and they cannot reproduce either. Obviously, the issue is not as basic as it appears because even the exact same data files work differently for you than they do me or other members of our support staff.

                            At this point, I would like to review your log and trace files & setup a time that I can remote into your PC and conduct these tests myself. That way, I can test things on your PC and my PC at the same time.

                            Please send me your log and trace files. You can do this by going to the Control Center-> Help-> Email Support

                            Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

                            Please reference the following ticket number in the body of the email: 3464434 ATTN Zachary
                            Zachary S.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by GLFX005, Today, 03:23 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post GLFX005
                            by GLFX005
                             
                            Started by XXtrader, Yesterday, 11:30 PM
                            2 responses
                            11 views
                            0 likes
                            Last Post XXtrader  
                            Started by Waxavi, Today, 02:10 AM
                            0 responses
                            6 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Started by TradeForge, Today, 02:09 AM
                            0 responses
                            14 views
                            0 likes
                            Last Post TradeForge  
                            Started by Waxavi, Today, 02:00 AM
                            0 responses
                            3 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Working...
                            X