Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

f optimizer development - no values returned

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

    f optimizer development - no values returned

    I'm in the process of developing an optimizer, the code compiles correctly but nothing is displayed in the strategy analyzer. The code isn't completely finished but it should be able to return at least one value. NT6 shows nothing and NT6.5 says that there is no info to display. The code is attached.

    Thanks,
    Chris
    Attached Files

    #2
    I didn't examine your logic in any depth, but I'd do two things:

    1) Check to make sure you're not getting a divide by zero (it looks likely -- did you look in the "Log" tab for errors?)

    2) If still having troubles, try writing some intermediate results to a text file using C# I/O methods.

    Good luck.

    Comment


      #3
      I'll take a quick look. Note you can use Strategy.Print() to write debug info to the output window.

      Comment


        #4
        It returns results for me as expected (on 6.5 beta 4), but your logic doesn't make sense, in particular:

        1. TWR *= HPR; TWR is always zero, so this value is always going to be zero.

        2. This section:
        Loser = systemPerformance.ShortTrades.TradesPerformance.Gr ossLoss;
        largestLoser = systemPerformance.LongTrades.TradesPerformance.Gro ssLoss;

        if(largestLoser >Loser)
        {
        largestLoser = Loser;
        }

        The gross loss is the total of all losing trades, and it is a negative number. This logic is not going to do what you think.

        But I am not getting the no results message. KBJ is probably right about there being an exception.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X