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 kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        34 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        29 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        36 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        33 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        143 views
        0 likes
        Last Post SalmaTrader  
        Working...
        X