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

[amibroker] MM formula problem



PureBytes Links

Trading Reference Links

Hello

I have quite specific problem. I need to optimize a parameter (delta - see below) nested into my MM code. Unfortunately, I can't do it as formula is inside CBT procedure and somehow Optimization engine doesn't "see" it stating in Auto-Analisis window: "You haven't specified any variables for optimization"...

How to procedee with optimization of parameter included only into CBT code? Or how to refer in CBT formula to the parameter specified outside CBT (if this issome solution)?

PS By the way - just to present "raw" MM forumula:

Position=0,5*{[1+8*(profit/delta)/n]^0,5+1}, where n = trades' number

And my CBT code:

SetCustomBacktestProc("");
if(Status("action")==actionPortfolio)
{
bo=GetBacktesterObject();
bo.PreProcess();
for(i=0;i<BarCount;i++)
{
for(sig=bo.GetFirstSignal(i);sig;sig=bo.GetNextSignal(i))
{
if(sig.IsEntry() AND sig.IsLong())
{
if(bo.Equity-a<=0)//a = initial capital//
position=1;
else
{
delta=Optimize("delta",500,500,10000,500);
position=0.5*((1+8*(bo.Equity-a)/delta)^0.5+1
sig.PosSize=pozycja;
}
}
bo.ProcessTradeSignals(i);
}
bo.PostProcess();
}





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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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/