GetFitness Args. - Optimize Your Backtesting!

Created at 18 Apr 2021, 18:35
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TH

thecaffeinatedtrader

Joined 22.07.2020

GetFitness Args. - Optimize Your Backtesting!
18 Apr 2021, 18:35


Hi Everyone, 

I been trying to find anything online that would have various Get Fitness codes to add to our algorithms to help with the optimization process, but haven't had much luck.
Therefore I wanted to start a Forum where we can all share various methods in one spot for easy access. 

Things such as:

     - Drawdown less than a certain percentage 

     - Sortino and Sharpe Ratio greater than a certain amount

     - Win percentage above a certain amount

     - etc. 

To start I will share the 2 that I have been able to find during my search.

protected override double GetFitness(GetFitnessArgs args)
{
        //maximize count of winning trades and minimize count of losing trades
        return args.WinningTrades / args.LosingTrades;
}
protected override double GetFitness(GetFitnessArgs args)
{
        //count of winning trades is more important than count of losing trades
        return Math.Pow(args.WinningTrades, 2) / args.LosingTrades;
}

With that said, please share your own that you have come up with or come across so others can benefit as well! 


@thecaffeinatedtrader