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

RE: [amibroker] Re: Correlation



PureBytes Links

Trading Reference Links




<SPAN 
class=307274021-20042003>Rich,
if for 
instance you wanted to check the correlation between the dj30 and all the stocks 
in your universe you could do it with the foreign statement.
<SPAN 
class=307274021-20042003> 
 <FONT 
face=Arial>
Filter=C<FONT 
size=2>>0<FONT color=#282828 
size=2>;<FONT 
color=#0000ff>
x=Foreign(<FONT 
size=2>"!DJ30","C"); 
//enter the base ticker Here<FONT color=#008000 
size=2> <FONT 
color=#282828 size=2>
test=Correlation(x,<FONT 
size=2>C<FONT 
size=2>,50<FONT color=#282828 
size=2>);<FONT 
color=#0000ff size=2>
AddColumn(test,<FONT color=#ff00ff 
size=2>"Correlation"<FONT 
face=Arial>);
 
 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: Rich Wells 
[mailto:rwellscpa@xxxxxxxxxxxxx]Sent: Sunday, April 20, 2003 5:37 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
CorrelationI would like to find highly correlated pairs 
of stocks or indexes that can be traded in a pair hedging strategy.  So 
I am trying to set up an exploration to run a report showing the percent 
correlation between each stock in a group, such as the NYSE list.  (I 
realize this will probably take hours to run)For example, I have 
determined that the correlation between the price of JPM and BAC is 
.63  Now I would like to do this calculation for a large 
groupThanks,Rich--- In amibroker@xxxxxxxxxxxxxxx, 
"Anthony Faragasso" <ajf1111@xxxx> wrote:> Rich,>  
> From the help menu.....>  > SYNTAX correlation( 
ARRAY1, ARRAY2, periods ) > RETURNSARRAY > FUNCTION Calculates 
correlation between ARRAY1 and ARRAY2 using periods> range > 
EXAMPLEcorrelation( close, ref( close, -5 ), 5 ); - this calculates> 
correlation between close price and and close price 5 days back>  
>  >  > //Load into Indicator Builder> 
lookback=10;> P=Foreign("^NDX","C");//select your Index or ticker> 
Plot(Correlation(C,p,lookback),"Correlation",colorRed,styleLine);> 
> which ever chart is opened will show the correlation between that 
ticker and> the ticker in the P variableSend 
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












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.