optimised vs. static score
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.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Eric on 07 Apr, 2010 10:25 AM
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:
And see if it makes a difference (it shouldn't).
Eric
Support Staff 3 Posted by Eric on 07 Apr, 2010 10:47 AM
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
Eric resolved this discussion on 07 Apr, 2010 10:47 AM.
Eliot Stock re-opened this discussion on 07 Apr, 2010 08:29 PM
4 Posted by Eliot Stock on 07 Apr, 2010 08:29 PM
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.
Support Staff 5 Posted by David on 08 Apr, 2010 07:45 AM
Good to know!
David resolved this discussion on 08 Apr, 2010 07:45 AM.