[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Code help please... Optimize with CMAE



PureBytes Links

Trading Reference Links

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


------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/