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

Deadlock Error

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

    Deadlock Error

    Hi,

    I am experiencing the Deadlock issue intermittently due to my strategy script I guess. In general what causes this issue. Can you please advise

    Click image for larger version

Name:	image.png
Views:	59
Size:	10.7 KB
ID:	1278465




    #2
    11/17/2023 10:50:23 AM Default AddOn 'NinjaAddonsToolBar': Error on calling 'OnWindowDestroyed' method: System.NullReferenceException: Object reference not set to an instance of an object.

    Comment


      #3
      Hello greenhollow803,

      The write lock error typically occurs when accessing a different thread.

      For example using Dispatcher.Invoke() or BeginInvoke() instead of using Dispatcher.InvokeAsync() can cause this type of error.

      The null object error means there is a variable with a null value that was attempted to be used.
      Hello, I keep running into an error of "Object reference not set to an instance of an object." when I set the entryOrder to Null after it has been cancelled. Below is the block of code that I found in several of the example strategies. protected override void OnOrderUpdate(Order order, double limitPrice,


      What is the specific line of code causing the error?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thanks for your qiuick response Chelsea.

        I am not able to get the line of code which is throwing error. The chart window hangs and I am forced to close the NT8 and restart. Any leads to identify the line of code causing the issue

        Comment


          #5
          Hello greenhollow803,

          You can temporarily use a try and catch to figure out which line is causing the error.
          W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


          You can also comment out logic until the error stops, then uncomment lines until the error returns to identify the last line that was uncommented as the line causing the error.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I already have try catch at most of the places. Let me try to added for each method and get back to you if it freezes again

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,403 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            94 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X