Hello,
As far as concatenated OOS is considered, things depend on which metrics
do you really want.
That is so because some metrics accumulate nicely so
you can simply add them up (either using AddToComposite or
just adding multiple Foreign() calls).
Some metrics are derived directly from equity (Drawdown, sharpe ratio,
UlcerIndex)
and can be calculated directly using plain AFL formula working on
IS or OOS equity.
For example CAR/MDD for out-of-sample test OOS:
Symbol = "~~~OSEQUITY"; // change the ticker to your preference
eq = Foreign( Symbol, "C" );
if( Name() != Symbol ) Title = "You should change symbol to " + Symbol;
function TotalDays()
{
yy = Year();
dy = DayOfYear();
LastLeapYear = (yy % 4) == 1 && yy != 2001;
YearChg = yy != Ref(yy, -1);
YearChg = IIf(IsNull(YearChg), False, YearChg);
YearLen = IIf(YearChg, IIf(LastLeapYear, 366, 365), 0);
return Cum(YearLen) + dy - dy[0];
}
dr = 100 * ( eq/Highest(eq) - 1);
profit = 100 * ( eq/eq[0] - 1 );
td = TotalDays();
Days = td[ BarCount - 1 ] - td[ 0 ];
Car = 100 * ( ( eq / eq[ 0 ] ) ^ ( 365 / Days ) - 1 );
//Plot( dr, "DD%", colorRed );
//Plot( Lowest(dr), "Max DD%", colorBlue );
//Plot( profit, "Profit %", colorGreen );
//Plot( Car, "CAR", colorDarkGreen );
Plot( Car/Highest( -dr ), "CAR/MDD", colorOrange );
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Thomas Ludwig" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, May 19, 2008 12:02 PM
Subject: Re: [amibroker] Plotting historical portfolio backtest metrics in
INDICATOR
> TJ,
>
> thanks a lot - very helpful!
>
> However, I'd be happy if you could also present a solution how do do
> something similar for the concatenated IS and OOS equity curves in a WF
> test - see my posts #123921 and 123945. I don't think this can be done
> with the custom backtester.
>
> Best regards,
>
> Thomas
>
>
>> Hello,
>>
>> To show you how easy it is to actually PLOT ANY portfolio backtest
>> metric as a historical series in INDICATOR, without using script, OLE
>> - just PURE AFL I prepared this:
>>
>> http://www.amibroker.com/kb/2008/05/19/historical-portfolio-backtest-
>>metrics/
>>
>> This addresses the following goals:
>> a) having ANY portfolio backtest metric available as historical
>> series for use ANYWHERE (in indicator or wherever) b) plotting
>> backtest metrics in INDICATORS and doing this FAST (without constant
>> recalculation) c) using only pure AFL for that
>>
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>>
>> ------------------------------------
>>
>> 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
>>
>>
>>
>
>
> ------------------------------------
>
> 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
>
>
>