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

Object reference not set to an instance of an object

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

    Object reference not set to an instance of an object

    Hi there,

    I've looked everywhere (I think) so I've had to write this post for some help.

    I'm receiving "Object reference not set to an instance of an object" on two of my indicators that use OrderFlowCumulativeDelta. Here I will provide my simplest indicator which is having problems.

    I have ran logs through each part of the code and it hasn't pointed any areas that is failing specifically. It seems to be failing at the very start of each OnBarUpdate and/or the line where I am syncing the OrderFlowCumulativeDelta with BarsArray[0] maybe?

    I've attached my indicator and I am running the indicator on Volumetric 500 tick bar I have provided the exact set up. It fails every time at 28/04/2022 15:26:49 or 28/04/2022 15:26:59 (via logs).

    Exact error is: Indicator 'AaSingleBarDeltaTracker': Error on calling 'Update' method on bar 5119759: Object reference not set to an instance of an object..

    It randomly started doing this a few days ago and has been doing it ever since so its not just todays data where it isn't working. And the fact that it didn't work on yesterdays data but does today (needs to iterate through yesterday to get to today) is weird.

    I think it must be something to do with OrderFlowCumulativeDelta object.

    Thanks a lot,

    I Appreciate any replies.

    Tarik ;D
    Attached Files

    #2
    So! Update. I removed all my custom indicators and have left the 'Order Flow Trade Detector' Ninjatrader indicator in and its the exact same problem on the exact same time. So I am guessing it's either to do with my account which I have logged out of, logged in, I'm a life time owner (or whatever its called), paid for Orderflow etc... or its a bug?

    Comment


      #3
      Hello tarikmedjber,

      Thank you for your posts.

      I've tested this for a little bit here and I'm seeing this running without an error. I suspect there may be a data issue occurring. Who is your data provider?

      Thanks in advance; I look forward to assisting you further.
      Kate W.NinjaTrader Customer Service

      Comment


        #4
        Also do I see this error on all bar types (500 tick, 1 min, 3 min etc). Only time I do not see this error is when I set my "Days to load" as 2 or less.

        Comment


          #5
          Hey Kate,

          My data provider is CQG.

          Comment


            #6
            I do however log in via NinjaTrader Continuum but use my CQG credentials. I don't know if that is of any value.

            Comment


              #7
              Hello tarikmedjber,

              Thank you for your reply.

              I'm not seeing the same error when connected to a CQG based NinjaTrader Continuum connection either.

              Let's have you delete your historical data and clear the cache, then test.


              Please delete your historical data using the instructions provided at the following page of the NinjaTrader Help Guide:

              Removing Historical Data
              • Once the data has been deleted close NinjaTrader. Open the Documents\NinjaTrader 8\db\cache folder. Select all files then right mouse click and select “delete.”
              • Open NinjaTrader and connect to your data provider. Open a new chart and test.

              Please let me know if this resolves this item.
              Kate W.NinjaTrader Customer Service

              Comment


                #8
                Sorry it's taking a while, up to now all is working very well! I'm just adding things on slowly to see what will break it (if anything - hopefully not of course). But all seems great so far. So thanks!

                Comment


                  #9
                  The only problem I am facing right now is downloading historical bars on one of my charts. See attached my set up. And see first candle erroring out, with a little line at the bottom where the candle should be? Candles are not downloading past that point for some reason? It is only happening on a 3minute candle. All other time frames are fine. Strange.
                  Attached Files

                  Comment


                    #10
                    Hello tarikmedjber,

                    Thank you for your reply.

                    So I may best try to replicate, on what date and time do the bars stop on the 3 minute chart? Does this persist if you right click on the chart and select "Reload all historical data"?

                    Do any errors appear in the Log tab of the Control Center? If so, what is the text of the error?

                    Thanks in advance; I look forward to assisting you further.
                    Kate W.NinjaTrader Customer Service

                    Comment


                      #11
                      Hey,

                      So reloading did work with this problem. But then my original problem occurred once again. Just on a simple indicator of Current OHL as well.

                      I then created a new workspace and loaded historical data for last 5 days on a 3 min chart with Current OHL indicator and, no problems. So let me start adding onto a new workspace (as my old workspace may be flawed some how). I am going to delete cache, historical data and all my workspaces and start fresh.

                      I shall update. Sorry for this annoying issue.

                      Tarik

                      Comment


                        #12
                        Okay all seems to be working fine with the new workspace. Hopefully it lasts! Thanks for you help as always

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by jeronymite, 04-12-2024, 04:26 PM
                        3 responses
                        44 views
                        0 likes
                        Last Post jeronymite  
                        Started by Barry Milan, Yesterday, 10:35 PM
                        7 responses
                        20 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by AttiM, 02-14-2024, 05:20 PM
                        10 responses
                        179 views
                        0 likes
                        Last Post jeronymite  
                        Started by ghoul, Today, 06:02 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post ghoul
                        by ghoul
                         
                        Started by DanielSanMartin, Yesterday, 02:37 PM
                        2 responses
                        13 views
                        0 likes
                        Last Post DanielSanMartin  
                        Working...
                        X