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();
}



Reply via email to