Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
My hope in starting this thread is that others will share their preferred fitness functions, that together we may come up with a better function. I know Big Mike has one I've never seen posted (hint), hopefully others also have ideas we can share in this area.
Here is mine at the moment (NT7), I would characterize it as a conservative variant of Van Tharp's System Quality Number:
Hi,
I don't know if there is something called the best "fitness function".
The fitness function that I use gives the best results for the tested data.
It is - Net Profit divided by minus Draw Down. This gives you the best result PERIOD!
But what we are looking for is not the best result for the tested data, but the better predictor for future data.
As I always say optimization is worthless. The only allowed action is walk forward.
Thank you for responding. In my function I found if I don't impute some variance it greatly favored parameters that claim little or no variance (or drawdown), but only take a couple of ticks per trade. I can imagine the same problem with drawdown as a divisor, do you impute a threshold level of drawdown in your calculation?
I have a high degree of agreement with the walk forward. My gut feeling there is to do a default opt on a challenging month (ie periods of both high and low volatility, both bulls and bears getting greedy, and then use the best results are midpoints for the genetic optimization walk forward: 7 days test 1 day walk and then repeat.
Can you post your 'fitness function'? It would be very helpful to me to see the actual code.
I'm still trying to find the ideal fitness function. Net Profit / Drawdown as suggested here previously doesn't do it for me, as that ignores consistency and unrealized risk. The attached is the best I've come up with so far. For me the goal is to have a function that will sort to the top the same parameters I would select by hand based on visual analysis of the cumulative profit graph, which ideally would be a smooth progression from bottom left to top right; and when otherwise comparable preferring the smallest stops.
I very much appreciate the analysis, and your sharing it with us ... I am a believer in removing those pesky outliers, as you have done in your code, and that leaves me confused as to the reasons for the different values used in the multiples (*.20 vs. *.382 ,to me, is huge for 1 trade difference). I am sure there is a good reasom, that is why I am asking to be educated, and as it wasnt included in the .cs :
.... this from Quality3.cs ... (.382)
// Determine average adusted profit
int numTrades = systemPerformance.AllTrades.Count;
double avgProfit = profit / numTrades;
compared to the original post ... (.20)
// Determine average profit with best outlier removed
int numTrades = systemPerformance.AllTrades.Count - 1;
double avgProfit = (systemPerformance.AllTrades.TradesPerformance.Currency.CumProfit - systemPerformance.AllTrades.TradesPerformance.Currency.LargestWinner) / numTrades;
Experimentally I found .20 wasn't high enough, I settled on .382 as being representative of one standard deviation. What I'm doing there is imputing a minimum variance I'll accept for use in the calculation. Without that I found it gave too much preference to parameters that had low deviation only because they had minimal profit targets.
I would like to get an optimization type as a Calmar Ratio: Annual Profit / DD max, but the problem is that I do not know how to compute the Annual Profit with the systemPerformance variables.