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

Anchor - System.NullReferenceException:

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

    Anchor - System.NullReferenceException:

    I have an indicator that draws several triangles on the chart. If I hit refresh (F5) I get an Object reference not set to an instance of an object error. If I remove the indicator completely and reload it, it works fine. When debugging I find that the bug may be in the @ChartMarkers. Please see below.
    Click image for larger version

Name:	chart anchor.PNG
Views:	174
Size:	139.7 KB
ID:	1113816
    Attached Files

    #2
    Hello cutzpr,

    Thanks for your post.

    Please move the code that is relevant to reproduce the exception in a separate test script for our review. Please also provide steps to reproduce the issue if steps go beyond applying the test script and pressing F5 to reload NinjaScripts.

    Exporting as source code - https://ninjatrader.com/support/help...tAsSourceFiles

    We look forward to hearing back.
    JimNinjaTrader Customer Service

    Comment


      #3
      Jim,

      I was able to figure it out. I was creating and remove drawn objects by accident on State.Configure. I moved the code and it is working fine. For some reason when I loaded the indicator from scratch no errors just on refresh.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      148 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,282 views
      0 likes
      Last Post Leafcutter  
      Working...
      X