Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, monk12, TipmyPip, Quad, aliswee), 1,029 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
User-defined optimization target function #457890
02/05/16 13:07
02/05/16 13:07
Joined: Feb 2016
Posts: 4
Freiburg
N
nospam999 Offline OP
Guest
nospam999  Offline OP
Guest
N

Joined: Feb 2016
Posts: 4
Freiburg
Hello, I'm new to zorro and I have read the following in the manual, but I can't find an example how to do this:
Quote:
"... other performance values can be used for optimizing parameters, for instance the profit/drawdown ratio, or the gross profit, or the Sharpe ratio. The objective function can access all trade statistics for determining the performance value."

1) First I would like to replace the objective function in the file default.c optimzing for PRR with my own function/optimization criteria for optimizing. Therefore I need in this function the values of:

R2 coefficient
Max. drawdown
Number of Bars
Total Profit

How can I access the values of these variables in the objective function?

2) How kann I optimize in ascending order (the smaller the better) ?

Re: User-defined optimization target function [Re: nospam999] #457892
02/05/16 13:19
02/05/16 13:19
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You can get the values from the PERFORMANCE struct of which a pointer is passed as sole parameter to the objective function. The struct is defined in trading.h.

What do you mean with ascending order?

Re: User-defined optimization target function [Re: jcl] #457895
02/05/16 15:02
02/05/16 15:02
Joined: Feb 2016
Posts: 4
Freiburg
N
nospam999 Offline OP
Guest
nospam999  Offline OP
Guest
N

Joined: Feb 2016
Posts: 4
Freiburg
Originally Posted By: jcl
You can get the values from the PERFORMANCE struct of which a pointer is passed as sole parameter to the objective function. The struct is defined in trading.h.

I don't unterstand how to do this exactly? This does'nt work:
Code:
var objective(){
 vars opti=PERFORMANCE.vR2;	
  return opti;
}



Quote:
What do you mean with ascending order?

I think PRR ist the better the higher its value are, is that right? It optimizes for high values.
My optimization function is the better the lower its results are and therefore I want to optimize for low values of my target function. (If that is impossible in Zorro I think I also could use the reciprocal value.)

Re: User-defined optimization target function [Re: nospam999] #457907
02/06/16 09:27
02/06/16 09:27
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
No, it's

var objective(PERFORMANCE *Performance)
{
var opti = Performance->vR2;
return opti;
}

And yes, when your function is better for lower results, return the reciprocal or the difference to a maximum.

Re: User-defined optimization target function [Re: jcl] #457921
02/07/16 09:27
02/07/16 09:27
Joined: Feb 2016
Posts: 4
Freiburg
N
nospam999 Offline OP
Guest
nospam999  Offline OP
Guest
N

Joined: Feb 2016
Posts: 4
Freiburg
Ok, it seems to work, thank you very much!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1