Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error popup message box when trying to backtest

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

    Error popup message box when trying to backtest

    When I run a backtest I immediately a pop-up message box with

    "Error on running backtest: Object reference not set to an instance of an object."

    Usually, when I get an error in backtesting it doesn't show a message box, it just outputs the error to the Log tab in Control Center, and it will usually say where it happened, like on OnBarUpdate() or something.

    But this is happening immediately when I run the backtest and there's no indication where in the code this is happening. There seems to be a deeper problem. I put try/catch statements all around code and none of them are firing.

    If I have an object set to null that I try to use, the error is just displayed in the Log, not a message box popup. I think it's something outside of my strategy code.

    Has anybody else experienced this?

    I am running with NT 7.0.1.30

    I have restarted NT and reboot my machine and I still get the same result.

    See attached screenshots.
    Attached Files

    #2
    Hello shodson,

    This error indicates you are using a null value.

    Something is not set and is being checked in a condition or is having its value used in some way.

    This error will disable your script.

    This error only appears when running this script, correct?
    If you backtest the SampleMACrossOver does the error appear?

    Is the script a script written by you or one that you have imported?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X