Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Invalid Cast from DateTime to Double

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

    Invalid Cast from DateTime to Double

    Attached is a simple code that creates an "Invalid Cast from DateTime to Double" error in the Log. It will compile clean but if you backtest the code with any NYSE stock, you will get that error in the log.

    Once that error appears, it will continue to display that error even after you fix the source of the error. By changing "Category" to "GridCategory" it should have fixed the problem, but the error continues to appear during backtesting.

    Since using "Category" instead of "GridCategory" does not cause syntax error during compilation, many people will get this log error if they copy the source code from 6.5.
    Attached Files
    Last edited by aksamyo; 10-24-2009, 07:42 PM.

    #2
    Various issues:
    a) You should replace any occurance of "Category" by "GridCategory" (I believe this is stated in the code breaking changes docs you should have at hand)
    b) "DateTime" parameters are not supported.

    Comment


      #3
      I have been using DateTime as parameter in 6.5 ever since i joined; and it works fine and without an error in the log. It works fine in 7.0 too except this time there is an error in the Log.

      The error happens after the completion of the backtest. After testing an instrument list, the error also happens when moving from one instrument to another in the Strategy Analyzer result list.

      Comment


        #4
        It may have worked with NT6.5. However it was not supported (see strategy wizard). I suggest amending your strategy so you would not need to use a DateTime parameter.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        627 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        359 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        562 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X