Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unhandled exception: Object reference not set to an instance of an object

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

    Unhandled exception: Object reference not set to an instance of an object

    popup error shows up when I include the following lines in my script

    private ChartControl chartControl;
    Print(chartControl.ChartPanels.Count);

    what's causing this error??

    #2
    Hello rexmie888,

    There is already a ChartControl provided to indicators and strategies. You do not need to make your own. You do not need your own variable to hold it.

    Below is a link to the help guide.
    https://ninjatrader.com/support/help...artcontrol.htm

    The error is caused because likely you have not assigned a ChartControl object to your variable and its null (meaning you are likely getting an object reference not set to instance of object error', and this is because you don't need to have your own variable.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      thanks a lot

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      37 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, Yesterday, 02:41 AM
      0 responses
      17 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      25 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Working...
      X