Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What does this error mean ?

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

    What does this error mean ?

    Hi ninjas,

    I've been doing certain backtest and all running ok, but weirdly whenever I try to go to recent days, NT gives me this error:

    Error on calling 'OnBarUpdate' method for strategy ' ( any xxxxxx indentifier )': Function does not accept floating point Not-a-Number values.

    I know it's difficult for you to spot it exactly, but at least could you give me some hint where to find the bug? because it's hard to see this strategy running fine in other dates. It seems to have with BarInProgress, not sure though

    Thanks in advance

    #2
    Hi pstrusi,

    The best way to find it is to start adding prints to your code.

    I like to print the bar time and a number so i can recognize the prints.

    Basically i just look for the last print before the error and try and get it closer and closer.

    Print("1 "+Time[0]);

    The issue looks to be coming from a method call that is being supplied a value that is NaN.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea, thanks for your answer but I've just "solved" using a Math.Round for a floating point calculations and it seems to work well now.

      If I had any further problems and not be able to know, I'll put it here as headache :-)

      Regards

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 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
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X