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

[amibroker] AFL version of Beta vs QuotesPlus



PureBytes Links

Trading Reference Links

there's an AFL indicator set in the library that computes Alpha, Beta and
R-Squared. looking at relatively high profile NASDAQ stocks, the beta values
it generates don't line up with Beta info from QuotesPlus. that makes me
wonder about Alpha and R-Squared too.

there are only two parameters you can set for the AFL version: the index
you're comparing to, and the number of periods.

- the index I'd think was most likely would be !SPX, the S&P 500. I've tried
a number of others too.

- my understanding is that the standard period, if there is such a thing, is
36 months. I took that to mean 3 years, or 256*3 trading days.

any ideas? (full formula below for reference.)

Dave Merrill



FORMULA:
--------------------------------------------
Mkt = "!SPX";
Periods = 256*3;

P = Foreign(Mkt,"C",1);
Beta2 = (( Periods * Sum(ROC( C,1) * ROC(P,1),Periods )) -
(Sum(ROC(C,1),Periods) * Sum(ROC( P,1),Periods))) / ((Periods *
Sum((ROC(P,1)^2 ),Periods)) - (Sum(ROC(P,1 ),Periods)^2 ));
Alpha = (Sum(ROC( C,1) ,Periods) - ( Beta2 ) * Sum( ROC( P,1) ,Periods ) )
/ Periods;
R2 = Correlation(P,C,Periods)^2;
--------------------------------------------


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/