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

Custom Bar Type erroneous value out of order

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

    Custom Bar Type erroneous value out of order

    I'm getting an erroneous data point in the OnDataPoint function of a custom bar type and I don't understand the logic of what is going on here. Why would that second incorrect call to ODP reference a bar at 10:34:00AM when the previous call was at 4:15:00?

    barCount time open high low close previous Time
    828 6/4/2019 1:59:00 PM 2805.5 2805.75 2805.5 2805.5 6/4/2019 1:58:00 PM
    828 6/4/2019 2:00:00 PM 2805.5 2805.75 2805.5 2805.5 6/4/2019 1:59:00 PM
    828 6/4/2019 3:01:00 PM 2806.5 2813.5 2806.5 2811.75 6/4/2019 2:00:00 PM
    barCount lastODP close time last Bar Time open high low close previous Bar Close
    828 new day 2805.5 6/4/2019 3:01:00 PM 6/4/2019 2:00:00 PM 2806.5 2813.5 2806.5 2811.75 2805.5 <= THIS IS CORRECT
    829 6/4/2019 3:02:00 PM 2811.5 2813 2811.25 2811.25 6/4/2019 3:01:00 PM
    829 6/4/2019 3:03:00 PM 2811.25 2811.75 2810.75 2811.5 6/4/2019 3:02:00 PM
    ...
    829 6/4/2019 4:07:00 PM 2808.75 2808.75 2808 2808.5 6/4/2019 4:06:00 PM
    829 6/4/2019 4:08:00 PM 2808.75 2808.75 2808.5 2808.75 6/4/2019 4:07:00 PM
    829 6/4/2019 4:09:00 PM 2808.75 2809.5 2808.75 2809.5 6/4/2019 4:08:00 PM
    829 6/4/2019 4:10:00 PM 2809.25 2809.5 2809.25 2809.25 6/4/2019 4:09:00 PM
    829 6/4/2019 4:11:00 PM 2809.25 2809.25 2808.5 2808.5 6/4/2019 4:10:00 PM
    829 6/4/2019 4:12:00 PM 2808.5 2809.5 2808.5 2809 6/4/2019 4:11:00 PM
    829 6/4/2019 4:13:00 PM 2809.25 2809.5 2809.25 2809.5 6/4/2019 4:12:00 PM
    829 6/4/2019 4:14:00 PM 2809.25 2809.5 2809.25 2809.5 6/4/2019 4:13:00 PM
    829 6/4/2019 4:15:00 PM 2809.75 2809.75 2809.75 2809.75 6/4/2019 4:14:00 PM
    barCount lastODP close time last Bar Time open high low close previous Bar Close
    1217 new day 2763.75 6/4/2019 3:01:00 PM 6/4/2019 10:34:00 AM 2806.5 2813.5 2806.5 2811.75 2763.75 <= but then something else is being processed, and this is INCORRECT.
    barCount time open high low close previous Time
    1217 6/4/2019 3:01:00 PM 2806.5 2813.5 2806.5 2811.75 3/6/2019 11:59:00 PM
    1219 6/4/2019 3:02:00 PM 2811.5 2813 2811.25 2811.25 6/4/2019 3:01:00 PM
    1219 6/4/2019 3:03:00 PM 2811.25 2811.75 2810.75 2811.5 6/4/2019 3:02:00 PM
    1219 6/4/2019 3:04:00 PM 2811.5 2812.5 2811.25 2811.75 6/4/2019 3:03:00 PM
    1219 6/4/2019 3:05:00 PM 2811.75 2811.75 2810.5 2811 6/4/2019 3:04:00 PM
    1219 6/4/2019 3:06:00 PM 2811 2811.75 2811 2811.75 6/4/2019 3:05:00 PM
    1219 6/4/2019 3:07:00 PM 2811.75 2811.75 2810.75 2811.25 6/4/2019 3:06:00 PM
    1219 6/4/2019 3:08:00 PM 2811.25 2811.25 2810.5 2810.75 6/4/2019 3:07:00 PM
    1219 6/4/2019 3:09:00 PM 2810.75 2811.25 2810.5 2810.75 6/4/2019 3:08:00 PM
    1219 6/4/2019 3:10:00 PM 2810.5 2811 2810.5 2810.75 6/4/2019 3:09:00 PM
    1219 6/4/2019 3:11:00 PM 2810.75 2810.75 2810.25 2810.75 6/4/2019 3:10:00 PM
    1219 6/4/2019 3:12:00 PM 2810.75 2811 2810.5 2810.5 6/4/2019 3:11:00 PM
    1219 6/4/2019 3:13:00 PM 2810.75 2810.75 2810.5 2810.75 6/4/2019 3:12:00 PM
    1219 6/4/2019 3:14:00 PM 2810.75 2811.25 2810.5 2810.75 6/4/2019 3:13:00 PM
    1219 6/4/2019 3:15:00 PM 2811 2811 2810.75 2810.75 6/4/2019 3:14:00 PM
    1219 6/4/2019 3:16:00 PM 2811 2811.25 2810.5 2810.75 6/4/2019 3:15:00 PM
    1219 6/4/2019 3:17:00 PM 2811 2811.25 2811 2811.25 6/4/2019 3:16:00 PM
    1219 6/4/2019 3:18:00 PM 2811 2811.25 2811 2811.25 6/4/2019 3:17:00 PM
    1219 6/4/2019 3:19:00 PM 2811.25 2811.75 2811 2811.75 6/4/2019 3:18:00 PM
    1219 6/4/2019 3:20:00 PM 2811.75 2812.25 2811.5 2812 6/4/2019 3:19:00 PM
    1219 6/4/2019 3:21:00 PM 2812 2812.25 2811.75 2812.25 6/4/2019 3:20:00 PM

    #2
    It looks like this has something to do with the roll as well. I've set my chart to merge non-backadjusted. It's pulling a value from 3/6/2019 11:59:00PM. If I change my chart to start from 3/7/2019 I don't get that erroneous value.

    Comment


      #3
      Hi habibalex, thanks for your post.

      I would need to test your script to go forward with solving this. Could you kindly Export it then send it to me at platformsupport at ninjatrader.com, please reference the following in the body of your email: <forum link> 2175129 ATTN: ChrisL
      Chris L.NinjaTrader Customer Service

      Comment


        #4
        K I sent the email, let me know if you have received. Thx

        Comment


          #5
          Hi habibalex, thank you I have received your email.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Hello habibalex, thanks for your patience.

            First, is this bar type based on one of the existing bar types in the platform already? If so you should make comparisons as to what is different between the two bar types and see if anything sticks out. It would be helpful if you made a version of this bar type that is reduced as possible and test if you can get this same problem, if not then there is a bug in the OnDataPoint method. In order for me to look into this further, we would need a version of this script that only prints the incorrect data point to highlight the problem.

            With all of this considered, please clear out your cache from the NinjaTrader database just in case the data coming from there is causing this problem.:

            Close out of NinjaTrader
            Navigate to Documents\NinjaTrader 8\db
            Delete the "cache" folder
            Restart NinjaTrader and test.

            I look forward to hearing of your results.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              were you able to reproduce the error? this is sort of based on the PnF on a minute chart but I don't like how I can't view the highs and lows as 'wicks' so I made my own version. My error occurs because there is an erroneous datapoint being supplied into the OnDataPoint method. It only occurs when there is a 'roll date' (ie: March 7) included in the number of days supplied to the chart.
              Last edited by habibalex; 06-10-2019, 06:28 PM.

              Comment


                #8
                Hello habibalex,

                I'm replying to let you know your message has been seen.

                Chris is currently out of the office at this time, but will be replying back after he has returned.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Hello habibalex, thanks for your reply.

                  I would need to know how you are testing this. I am assuming you are looking at this through market replay. If you are able to reproduce this consistently, Could you let me know an exact time to look for the incorrect date prints and the steps you take to reproduce it?

                  I look forward to your reply.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    I'm just loading it on a regular chart. No market replay. Since we rolled today, you can see that an bad print is occurring on this chart. It never traded there. If I don't include the roll date on the chart, this error goes away.
                    Click image for larger version

Name:	Annotation 2019-06-13 221326.jpg
Views:	174
Size:	73.2 KB
ID:	1060718
                    Last edited by habibalex; 06-13-2019, 11:15 PM.

                    Comment


                      #11
                      Hi habibalex, thanks for your reply.

                      So that I can test the same thing you are, please open up a new workspace with one chart and set up this scenario. After you have saved all of that, please navigate to Documents\NinjaTrader 8\workspaces, zip up the workspace file you created (it will be an XML file with the same name as your workspace) and post the .zip to your next reply.

                      I look forward to hearing from you.
                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12
                        here is the workspace.
                        edit: added the 2nd chart w/ only data after current roll so you can see
                        Attached Files
                        Last edited by habibalex; 06-14-2019, 12:13 PM.

                        Comment


                          #13
                          Hi habibalex, thanks for sending that. I was able to reproduce what you are seeing. I will need to look into this further to find out why we are seeing this output.

                          Thanks in advance for your patience.
                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello habibalex,

                            I have been working with Chris to look into this behavior further. Chris came up with some steps to reproduce, but we could not follow these to consistently run into the behavior you are observing.

                            We have your script and workspace files, but actually running into the issue has proven to be a bit difficult. I'd like to be able to follow some clear steps so I can hit this issue consistently and give you our analysis. Since bar cache is important when working with BarsTypes, I would like to follow some steps that also involve clearing the bar cache so we can start from a clean slate to run into the behavior.

                            I think providing steps like the following will help us to move forward here.
                            1. Clear cache folders (Documents\NinjaTrader 8\cache\ and Documents\NinjaTrader 8\db\cache\)
                            2. Start NinjaTrader
                            3. Import test script
                            4. Exact Data Series settings to hit the issue (Please provide a screenshot)
                            5. Any other specific steps to take
                            6. Screenshot of resulting Output window showing issue
                            Please also let us know who you are using for data so we can set up apples-to-apples tests.

                            Thanks, and I look forward to analyzing this further.
                            JimNinjaTrader Customer Service

                            Comment


                              #15
                              I followed the steps and added a pic of the bad tick and instrument settings
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Waxavi, Today, 02:00 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post Waxavi
                              by Waxavi
                               
                              Started by elirion, Today, 01:36 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post elirion
                              by elirion
                               
                              Started by gentlebenthebear, Today, 01:30 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post gentlebenthebear  
                              Started by samish18, Yesterday, 08:31 AM
                              2 responses
                              9 views
                              0 likes
                              Last Post elirion
                              by elirion
                               
                              Started by Mestor, 03-10-2023, 01:50 AM
                              16 responses
                              391 views
                              0 likes
                              Last Post z.franck  
                              Working...
                              X