Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulation stopping early on errors

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

    Simulation stopping early on errors

    I noticed an issue with the handling of incorrect code. Due to some missing error checks, I was using double.NaN to calculate an integer for use in EnterLong/ ExitLong. So far, this is definitely my own fault.

    The next thing that happens was surprising though: NinjaTrader was not showing any kind of error message, but was simply terminating the simulation before all bars were processed and the strategy analyzer showed an empty report.

    Request for an improvement: If something happens that is confusing enough for the engine to terminate a strategy, an error message should be displayed. Without this, it actually took me a while to locate the issue.


    Thank you,
    best regards, Felix

    #2
    Hello fbertram,

    Thank you for your post.

    Can you provide the code that was using a double.NaN to calculate an int?
    I will test with generic NaNs.

    Comment


      #3
      Hi Patrick,

      unfortunately I cannot share my code in this case. Basically, I was casting NaNs to int, resulting in large negative numbers, and passing that on to EnterLong and ExitLong. That confused the engine enough to stop simulation without ever displaying an error message. Not on the screen and not in the Output Window.

      Thank you,
      best regards, Felix

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      138 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      294 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      239 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      336 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      171 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X