[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] annual return calculation, days between dates [REPOST]



PureBytes Links

Trading Reference Links




[if you got this before, sorry for the 
repost. it doesn't seem to have shown up here, and I haven't seen any replies, 
so I'm trying again. any takers? all ideas welcome (:-) ]
 
I'm adding annual return to an 
indicator, and I have some questions:- how can I find out the number of 
days (NOT bars) in the AA range? 
thesework:      start_date = 
Status("RangeFromDate");      end_date = 
Status("RangeToDate");  how can I subtract start_date from end_date to 
get the number of calendardays between them?- the following code, 
modified from code in the help, computes annual returngiven total equity (e 
in the code below), but does it in terms of bars, 
notdays:      bars_in_test = 
Cum(Status("BarInRange"));      bars_in_year = 
252;      e_ann_rtn_pct = ( (e / initial_equity) ^ 
(bars_in_year / bars_in_test) - 1)* 100;  it's close to what I see 
in the AA report window, but not exact. thereport and I agree exactly on the 
total return percentage, but not annualreturn. in fact, there's no 
integer number of bars in a year that 
canproduce the annual result I see in the report.  how is this 
supposed to be done?- why does the AA report window say this for a date 
range of 1/1/1995 to12/31/95:      Bars (avg. 
days) in test: 252 (361)  the range in question is an entire year. in 
purely calendar terms, that's365 days, not 361. <SPAN 
class=357172013-26092003>where does 361 come from? is that related to the 
reason the 
above code doesn't agree with the 
report?thanks,Dave MerrillSend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.