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

Multiple instrument indicator development cache does not update after split adjustmnt

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

    Multiple instrument indicator development cache does not update after split adjustmnt

    I am trying to develop an indicator which uses several mutual fund prices from Kinetick end-of-day free provider.


    So, I added several data series in the OnStateChange() method's Configure conditional. Everything looked good but then I noticed that one of the securities in question had a recent 1 to 10 stock split. Since the kinetick free data is not adjustable for splits, I tried to fix the problem by going to my instruments and adding a stock split on the instrument in question with a factor of 10 on the specific date.


    When I returned to my charts, I realized that it was not working at all, so I decided to delete the entire historical database of prices for this ticker and adjust the prices manually on a semi-colon separated spreadsheet. I basically took all the prices prior to the split date and divided them by 10. This seemed to fix all the prices so it didn't look like there was a 90% drop on the split date, so I re-imported the prices back using the historical data manager.


    Now, all the prices look good in the Historical Data manager, but when I run my charts with my custom indicator, the prices used by my indicator's AddDataSeries seem to come from a cache and still show the old prices. Interestingly enough, if I run a chart of the security itself without any indicators, the prices appear correctly.



    I have since removed the split entry (since the data is already manually adjusted), and I've cleared the NT8 cache directory, shut down and restarted NT8 and my computer several times, and recreated the chart from scratch, but it still shows the old prices with the 90% drop!
    I even recreated my indicator with a new name and the prices are still the old prices.


    This is most definitely a bug in NT8. I am guessing that prices added through AddDataSeries not only cache, but might also be caching the split entry that I had added, and then later removed.


    Can someone please help me? I will be happy to supply the code, or even a remote session if necessary.


    Thank you very much in advance.



    Here are some screenshots:









    #2
    Hello grahamb33,

    Thank you for your note.

    Rather than manually modify, reimport, you can define the split in the instrument manager.
    Go to Control Center>Tools>Options>market Data Category. Confirm Adjust for Splits Daily Data is checked.

    Then go to CC>Instruments>Search FSELX>Edit. Scroll to the bottom and define the split.
    Then go to your chart>Right click>update historical data.

    After the steps above, FSELX reflects the split historically.

    If you follow the steps above, do you get the results you desire?

    I look forward to your reply.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,


      Thank you so much for replying. I didn't know about that option, so I was extremely excited when I saw it. Unfortunately, I enabled it and it still does not work. I believe the problem is related to the way data is cached by NT8 when imported via the AddDataSeries method. See my screenshots. If I run a chart of the actual prices, it works and the dividend setting is applied automatically. However, when I add the FSELX via the AddDataSeries and set the value of the plot, you can see the the prices are not dividend-adjusted at all. Any further suggestions would be extremely appreciated!



      I reverted the data back to not adjusted for splits




      Then I set the split date in the instrument itself
      Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.



      Then I set the dividend adjust Option underTools



      Then I made a normal chart of FSELX plots correctly without the 90% drop on May 11, 2018
      Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.



      After reloading the historical data, removing and reapplying the indicator, renaming the indicator, shutting down NT8, restarting the computer, etc, the custom indicator still plots the FSELX price without any split adjustments



      How the indicator imports the data



      Print method called to verify what prices look like:



      Prices imported via the AddDataSeries don't appear to be dividend adjusted and seem to cache a lot...

      Comment


        #4
        Hello grahamb33,

        I followed your instructions however was unable to replicate.

        What version of NinjaTrader are you on? Under Control Center>Help >About.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Version 8.0.14.2 64-bit.


          I believe the problem is caused by a cache of settings or dataseries (or both).
          Is there a way to clear all NT8 caches, including settings, without having to reinstall everything from scratch?


          Thanks!
          Last edited by grahamb33; 07-07-2018, 09:14 AM.

          Comment


            #6
            Hello grahamb33,

            Under Control Center>Tools>Database Manager, you'll see at the bottom of that window, Repair DB.

            If after repairing the database does this resolve the issue?

            I look forward to your reply.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Hi Alan,


              I tried the DB repair tool, but no change. Here is my indicator code if you want to try it out:
              https://tinyurl.com/yaeyf38x

              Please let me know what you find.

              Thank you very much,

              Comment


                #8
                Hello grahamb33,

                Can you replicate this issue with a very simple script with 1 data series and close to no logic?

                I look forward to your reply.
                Alan P.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Alan,


                  I created a barebones version of my indicator that simply takes the single instrument FSELX and adds it with a data series and a plot. Theoretically, this is the same thing that I am doing on my full indicator, except that on the full indicator I also add 39 other instruments.


                  So the result is that the single instrument plots perfectly with the dividend. Here is the test code:
                  https://tinyurl.com/y8bke39z

                  So it appears that the problem is not related to a caching issue, but possibly to the number of instruments. I suppose if you keep adding instruments that eventually the chart goes crazy and loses the ability to process the prices properly? Is there anything that I can do to make it work with a lot of instruments?


                  Thanks Alan.

                  Comment


                    #10
                    Hello grahamb33,

                    Thank you for the update.

                    I would not expect this behavior. Would you be able to provide the script with one data series as well as the one with 39 so I may test on my end?

                    If you could send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

                    I look forward to your reply.
                    Alan P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by CortexZenUSA, Today, 12:53 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by CortexZenUSA, Today, 12:46 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by usazencortex, Today, 12:43 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post usazencortex  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,266 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X