• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Patrick H.NinjaTrader Customer Service

    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 NT-Roland, Today, 04:36 PM
      0 responses
      1 view
      0 likes
      Last Post NT-Roland  
      Started by Newtrader101, Today, 03:40 PM
      2 responses
      10 views
      0 likes
      Last Post Newtrader101  
      Started by Branpo, Today, 02:58 PM
      2 responses
      5 views
      0 likes
      Last Post Branpo
      by Branpo
       
      Started by sdauteuil, Today, 02:09 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by AMATX, Today, 02:19 PM
      2 responses
      10 views
      0 likes
      Last Post AMATX
      by AMATX
       
      Working...
      X