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 MacDad, 02-25-2024, 11:48 PM
      7 responses
      158 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      7 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Working...
      X