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

Unhandled exception: Value cannot be null. Parameter name: dependencyObject

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

    Unhandled exception: Value cannot be null. Parameter name: dependencyObject

    I'm having difficulty tracing this error message: Unhandled exception: Value cannot be null. Parameter name: dependencyObject

    Occurs when loading the strategy from the Strategies panel. It doesn't appear in the Output so it's difficult yo isolate where this error is being triggered. Any insight on how to identify the culprit? thanks

    #2
    Hello pman777,

    I wanted to gather more details, does this happen with all strategies or just one specific strategy? If this is for a specific strategy, does that strategy involve manipulating the chart in any way such as adding/removing buttons?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Only a specific strategy, which does add/remove buttons

      Comment


        #4
        Hello pman777,

        Thanks that helps.

        Based on the given information I would guess this relates to the button logic in the script. A dependency object would be part of the UI framework being used, and Value cannot be null hints that you are trying to do something with the UI but it is null.

        My guess would be that the ChartControl is being used in some way and the ChartControl specifically is null when using the Control Center to apply a strategy. Your button adding logic will need specific null checks to avoid this situation in the control center because there is no chart window.

        If you have a sample of the button adding logic, we may be able to just see what is causing the error by looking at what objects are used and what has the possibility of being null. Alternatively you could use Print statements to isolate what line of code is throwing the error to further isolate the issue.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          thanks Jesse!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,607 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          15 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X