GetFitness Args.
Created at 14 Apr 2021, 23:17
TH
GetFitness Args.
14 Apr 2021, 23:17
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; }