Not logged in
Viewing 14 posts - 1 through 14 (of 14 total)

Forums>Quant Analyzer (formerly named EA Analyzer)>Extending the program>Minimize & Maximize in 1 FitnessFunction?, Possible?

  • #202998|
    Karish
    Customer
    480 Posts

    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.

    #203006
    Customer
    484 Posts

    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.

     

    Attachments:
    You must be logged in to view attached files.
    #203013
    Karish
    Customer
    480 Posts

    Thanks @notch,

    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

    +

    Maximize RetDD

     

    this way i will understand how to add / edit the things i want to it, thank you so much for your help!

    #203015
    Customer
    484 Posts

    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);

    Attachments:
    You must be logged in to view attached files.
    #203019
    Customer
    484 Posts

    To Minimize Consecutive Losses & Maximize Consecutive Wins

     

    You would minimize (MCL divided by MCW).

    #203022
    Karish
    Customer
    480 Posts

    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….

    Attachments:
    You must be logged in to view attached files.
    #203034
    Customer
    484 Posts

    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.

     

     

    #203054
    Customer
    268 Posts

    what about to use maximize but variable put in this way  :    1/minimized variable

    #203057
    Karish
    Customer
    480 Posts

    Could we somehow construct my snippet into one that will be a Maximize + Minimize ready?,

    Maximize already working, we need to somehow manage to add the minimization functions to be easy and simple to edit and add more,

     

    this will help us all im sure

    #203062
    Customer
    484 Posts

    That works as well.

    #203070
    Customer
    484 Posts

    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.

     

     

    #203087
    Karish
    Customer
    480 Posts

    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.

    #203091
    Customer
    484 Posts

    Fair enough.  You are working with a large number of str like me.  I will experiment with your script and post any findings after the festive period.

    Forgive the earlier reluctance, I just hate to code.

    #203097
    Karish
    Customer
    480 Posts

    :), thank you

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.