The values are available as a result of OPTIMIZE
function:
fast = Optimize("fast", 12, 5, 20, 1 ); // 'these are values of opt
variables
slow = Optimize("slow",
26, 10, 25, 1 );
(note optimize calls should be on GLOBAL
level (i.e OUTSIDE "if" of custom backtest proc)
Best regards,
Tomasz
Janeczko
amibroker.com
----- Original Message -----
Sent: Tuesday, March 04, 2008 9:14
PM
Subject: Re: [amibroker] Sequential
Optimizations for independent variables
Thanks for that one and something else about
optimization Thomasz/Herman. I know how to get the built-in backtester
statistics with GetValue. Let's say :
RetValue = st.getvalue("CAR");
But how do I get the values of both optimized
values in underneath mentioned code ?
I tried the same way as above but
failed. What I did was something like :
OptFast =
st.getvalue("fast");
OptSlow =
st.getvalue("slow");
But that did gave me errors. What's
wrong with that ? Why ? The requested field is not available ? But
didn't I initialize both fields in the Optimize instruction ? Both fields
show up in the optimization list in AA. I
don't understand what going wrong ...
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
st =
bo.GetPerformanceStats(0);
fast =
Optimize("fast", 12, 5, 20, 1 );
slow = Optimize("slow", 26, 10, 25, 1 );
Regards, Ton.
----- Original Message -----
Sent: Tuesday, March 04, 2008 2:19
PM
Subject: Re: [amibroker] Sequential
Optimizations for independent variables
Opt =
Optimize("TotalOpt",10,1,200,1);
switch( 1 )
{
case TotalOpt <=100:
Opt1 = TotalOpt;
Opt2 = 10;
break;
case TotalOpt > 100:
Opt1 = 10;
Opt2 =
TotalOpt - 100;
break;
}
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Tuesday, March 04, 2008 2:10
PM
Subject: [amibroker] Sequential
Optimizations for independent variables
Awhile back I suggested, on the feedback site, an option to perform
sequential optimizations. The response was that this is already
possible, however I can't figure out how. Can someone explain to me how
to run the following two optimizations sequentially, that is
independently, one after another?
Opt1 = Optimize("Opt1",10,1,100,1);
Opt2 = Optimize("Opt2",10,1,100,1);
Sequential optimization would only require 200 opt cycles, while the
normal opt procedure is designed for dependent variables and requires
10,000 opt cycles. Sequential opts for independent variables would, in
this case, be almost 100 times faster. I bet many users don't consider
whether the opt variables are independent or not... doing so could turn
a two hour opt into a 1 minute opt.
AFAIK, Opt()s cannot be if()d, and their arguments cannot be changed
dynamically, right?
I must be (again) missing something obvious.
many thanks,
herman