Announcement

Collapse
No announcement yet.

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:	104
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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            55 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            132 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X