Go to the guy's site where Tomasz download his source code from, download
his source code, and stare at that one instead, I think its a lot closer to
what you want. http://www.bionik.tu-berlin.de/user/niko/cmaes_c.tar.gz


  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Dennis Brown
Sent: Monday, 7 July 2008 11:31 AM
To: [email protected]
Subject: [amibroker] Code help please... Optimize with CMAE



Hello,

I have been staring at the CMAE DLL stuff for days and I really need 
some help to figure out how to use it in a particular way.

I would like to use the optimizer in a generic sense to do the 
following from AFL without using the internal backtester, meaning only 
AFL in indicator mode:

Initialize 2 items:
item 1 is X and has a default,min,max,step,current,best values 
1,1,1000,1,1,1
item 2 is Y and has a default,min,max,step,current,best values 
1,1,1000,1,1,1

The objective is to optimize X and Y so that X*Y==100

objective function in AFL:
function Objective()
{
return 100 - X*Y;
}

The steps I would need to take as I understand them are:

1. Initialize the X and Y OptimizeItems by calling 
OptimizerInit( with bunch of arguments) --most arguments are 
irrelevant to this test.

2. Start the optimizer engine by calling pfEvaluateFunc( pContext ) -- 
there really is no context that I understand for this test.

3. The DLL calls back for the objective AFL function

4. It runs step 3 a number of times to find the solution of X=Y=10

5. OptimizerFinalize(same bunch of arguments as step 1)

Of course I would prefer that step 3 is AFL calling the optimizer DLL 
instead (simple mode), but I did not think that is how the CMAE works.

Anyway, if I could get this simple case to work, I am sure I could 
figure out how do do much more complicated cases after that on my own.

Of course if there is no way to use the existing DLL without changing 
it, I would like to know that also. I should be able to make modest 
changes to the DLL myself.

Please any hints or AFL code is appreciated.

Best regards,
Dennis



 

Reply via email to