Minimize & Maximize in 1 FitnessFunction?, Possible? there are only MAXIMIZE FitnessFucntions but is there a way to create a FitnessFunction that can Minimize and Maximize at the same time? like Maximize NumberOfTrades and Minimize Drawdown please help..!, thank you for your time.
I tried to post a QA snippet but got this message:
*** Forbidden. Message seems to be spam. ***
Looks in the text file assuming it doesn’t also get filtered.
But this is not that understandable..,
could you please make this snippet with this example:
Maximize Constitutive Losses & Minimize Constitutive Wins
Minimize Stagnation & Minimize Drawdown
this way i will understand how to add / edit the things i want to it, thank you so much for your help!
See snippet: times the fitness by consecutive wins if you want that to be also included, adding it in the main formula is better because it won’t have too much weight but play around with it, it works well for my portfolios:
return fitness = fitness * stats.getDouble(StatsConst.MAX_CONSEC_WINS);
Still very very hard to understand…,
see my snippet where i maximize things,
i want to add to this same snippet some minimize features like minimize drawdown and minimize stagnation for example..
please could you somehow help me with this? is there a way to make the code more understandable like mine just with the addition of the minimization of some functions?, see the txt file attached….
I don’t think it is possible to have two types of fitness; I normally get around the problem by passing divided variables to the fitness variable like so:
To Minimize Consecutive Losses & Maximize Consecutive Wins
You would minimize (MCL divided by MCW).
You should compile my last snippet and you will see it will produce portfolios that minimise DD, stagnation etc.
Sorry I can’t be more help.
Do you mind if we spend a little time to discuss the value of what you are trying to acheive? How many strategies do you intend to analyse in portfolio manager?
Minimizing and maximizing portfolios is already straight forward since we only need to use the reciprocal of a number to achieve the goal.
You maybe over-egging the muffin especially if you’re working with less than 100 robust and extremely tradable strategies.
i load over 5000 strs into QA4,
i set the max strs in a portfolio to 100,
i have a snippet for fitness that i already built and its working great, (attached to my last post..),
what i am trying to achieve is to add to my already working snippet 2 more fitness functions but this time rather to Maximize i want to them to be working on Minimization.
I want to add up those 2 functions:
Minimize DrawDown in % + Minimize DrawDown in $,
Minimize Stagnation in % + Minimize Stagnation in Days.
thats all, if i have those 2 examples added to the snippet in a very simple lay-out way..,
Thank you for your time.
You must be logged in to reply to this topic.