A Good Custom Fitness Function

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

A Good Custom Fitness Function

Postby geektrader » 31 Oct 2009

Just wanted to share the Fitness Function which I am using with nice results for a while (high net profit with very "clean" and straight equity curve, low draw-downs):


if (StrategyPerformance.MaxStrategyDrawDown != 0) {
if (StrategyPerformance.GrossLoss != 0) {
return 1000000 * StrategyPerformance.NetProfit / (-StrategyPerformance.GrossLoss) / (-StrategyPerformance.MaxStrategyDrawDown);
}
}


Good luck and let me know your results with it!

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 03 Nov 2009

can you explain and describe how to use this code?


TIA

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 03 Nov 2009

TJ: when you optimize a strategy, you have to select what criteria to optimize on(net profit, ave trade etc), if you select "Custom" and plug in geeks code, it will optimize on that. I tried it briefly over the weekend and it was pretty good.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 03 Nov 2009

ic

thanks !

NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Postby NiC72 » 09 Dec 2009

It works fine. Thanks :)


Return to “User Contributed Studies and Indicator Library”