Thanks Anthony. Just what I was looking for.
 
Regards
 
Prashanth
 
----- Original Message -----
Sent: Saturday, September 02, 2006 7:37 AM
Subject: Re: [amibroker] Explore for getting Monthly Returns

Prashanth,

Try this, load into AA window...select current symbol, and all quotations, explore.

 

NewMonth = Month() != Ref( Month(), 1 );

StartValue = ValueWhen( NewMonth, Close, 2 );

EndValue1 = ValueWhen( NewMonth, Close, 1 );

Filter = NewMonth;

AddColumn(Month(), "Month", 1.0 );

AddColumn(100*( EndValue1 - StartValue )/StartValue, "Percentage change" );

 

Anthony

----- Original Message -----
From: Prashanth
Sent: Thursday, August 31, 2006 10:39 PM
Subject: Re: [amibroker] Explore for getting Monthly Returns

Hello Graham,
 
Using the syntax you have given gives the Output in terms of the Month Number, ie 4 for April, 6 for June and so on.
 
What I am looking for is for getting Montly Returns of a Scrip for a Particular period, ie If I Explore for 1 Year, the output should be the Movement the Scrip made in each Month in percentage terms.
 
Regards
 
Prashanth
 
----- Original Message -----
From: Graham
Sent: Friday, September 01, 2006 4:32 AM
Subject: Re: [amibroker] Explore for getting Monthly Returns

Try using this condition to get the end of the month

month()!=ref(month(),1)


--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 31/08/06, Prashanth <prash454.ta@gmail.com> wrote:
Hello,
 
I wanted to write a AFL which shall give me the Monthly returns of any scrip for which I explore.
 
I tried out the following
 
// Explore to get Monthly Returns;
A = ValueWhen(Day()==31 AND Month()==8 ,C);
B = ValueWhen(Day()==30 AND Month()==9 ,C);
D = ( (100 * B) / A ) - 100;
Filter=1;
AddColumn(A,"  A  ");
AddColumn(B,"  B  ");
AddColumn(D,"  D  ");
 
But I am finding some problems.
 
1. For Value of B, it takes previous years data. This can be overcome by maybe using the Year() function, but the Explore I am trying to write is for running over multiple years and hence cant use the same.
 
2. If 30 or 31st is a Holiday, I can get incorrect data. How do I overcome that.
 
If anyone has a simple method, I would be very much interested.
 
Thanks in Advance
 
Regards
 
Prashanth






avast! Antivirus: Inbound message clean.

Virus Database (VPS): 0635-3, 08/31/2006
Tested on: 8/31/2006 10:40:47 PM
avast! - copyright (c) 1988-2006 ALWIL Software.


__._,_.___

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 other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to