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 JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Started by Haiasi, 04-25-2024, 06:53 PM
      2 responses
      17 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      5 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Working...
      X