optimised vs. static score

Eliot Stock's Avatar

Eliot Stock

07 Apr, 2010 08:04 AM via web

Hi there,

I have a strategy with three variables I've put @Optimized on. When I run the strategy I find the optimal values for these three variables. If I then change the values for the variables to these optimal values and comment out the @Optimized annotation, the score I get differs from the one when I was running with optimisation (drops from 4.25 to 3.25).

Any idea why this might happen?

Cheers,

Eliot Stock.

  1. Support Staff 2 Posted by Eric on 07 Apr, 2010 10:25 AM

    Eric's Avatar

    Hi Eliot,

    The score is calculated based on the transactions generated by your strategy, plus execution costs. As long as the same transactions are generated, the score should be the same. So whether you use @Optimized values or variables with the appropriate hard-coded values, you should get the same results.

    Have you been able to check if the results graphs are the same?

    Another thing you can try is set the optimized values to a single one, as follows:

        @Optimized(numbers = { 2.5 })
        double indicator = 2.5;
    

    And see if it makes a difference (it shouldn't).

    Eric

  2. Support Staff 3 Posted by Eric on 07 Apr, 2010 10:47 AM

    Eric's Avatar

    Eliot,

    Another common issue is when optimized values are reused in instance variables (that is, outside methods). This does not work.

    Check out this page we just published with details on this issue.

    Eric

  3. Eric resolved this discussion on 07 Apr, 2010 10:47 AM.

  4. Eliot Stock re-opened this discussion on 07 Apr, 2010 08:29 PM

  5. 4 Posted by Eliot Stock on 07 Apr, 2010 08:29 PM

    Eliot Stock's Avatar

    Thanks for that post, very helpful. I did indeed have a variable that was being initialised on instantation rather than in onStrategyStart(), but I'm not sure that explains the results I saw. In any case, I'm getting the results I expect now.

  6. Support Staff 5 Posted by David on 08 Apr, 2010 07:45 AM

    David's Avatar

    Good to know!

  7. David resolved this discussion on 08 Apr, 2010 07:45 AM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

10 Sep, 2010 01:40 PM
10 Sep, 2010 09:40 AM
10 Sep, 2010 09:40 AM
10 Sep, 2010 05:39 AM
10 Sep, 2010 05:39 AM