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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      153 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      306 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      176 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X