PureBytes Links
Trading Reference Links
|
Anthony,
I think your code only gives me the annual return of the index
itself - not the return of my Buy/Sell system. I probably didn't make
that clear enough.
Thomas,
Wow! that is some complex code you have there, which probably will do
the job. I'll study it. Thanks.
I actually achieved what I wanted in a brute force fashion. I added
these lines to my backtest code:
Filter=1;
AddColumn(Equity(),"Equity",1.0);
and ran an 'Exploration'. This gave me daily Equity values all the
way back to 1950. I exported this to Excel and used the Vlookup
function to select the relevant annual dates and related equity.
Easy, but not elegant...
Steve
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxx>
wrote:
>
> NewYear = Year() != Ref( Year(), 1 );
>
> StartValue = ValueWhen( NewYear, Close, 2 );
>
> EndValue1 = ValueWhen( NewYear, Close, 1 );
>
> Filter = NewYear;
>
> AddColumn(Year(), "Year", 1.0 );
>
> AddColumn(100*( EndValue1 - StartValue )/StartValue, "Percentage
change" );
>
> ----- Original Message -----
> From: steve_almond
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Sunday, February 22, 2009 4:04 AM
> Subject: [amibroker] Annual Returns
>
>
> I have been looking at a backtest on an index going back to 1950.
> Is there a way to calculate or display the return for each
individual
> calendar year?
>
> Like so:
>
> 1950 2.5%
> 1951 -1.9%
> 1952 12.3%
> etc.
>
> Steve
>
------------------------------------
**** 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/
|