PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Dom.
<FONT face=Arial color=#0000ff
size=2>
<FONT
face="Courier New">R1=Correlation(P,C,Periods1)^2;
you
are checking the correlation between the price of DIA and the currently selected
stock over the last 21 days. Your chart values will provide the data for any bar
selected. If you select a bar 5 bars ago then you are seeing the same
correlation for the but the calculated value as of 5 days ago.. So yes if you
select a 21 period correlation the last value you see is how well the 2 arrays
were correlated over a 21 period calculation. If you select yesterdays bar you
will see how well the 2 arrays were correlated over a 21 period calculation
yesterday......
Regards,
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: dom1_1998
[mailto:Dom2000@xxxxxxxxxxx]Sent: Thursday, March 18, 2004 8:52
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re:
CorrelationJayson:I believe the formula I'm
experimenting with is Anthony's R square.Regarding periods, the help file
says:SYNTAX correlation( ARRAY1, ARRAY2, periods ) RETURNS
ARRAY FUNCTION Calculates correlation between ARRAY1 and ARRAY2
usingperiods range EXAMPLE correlation( close, ref( close, -5 ), 5
); - this calculatescorrelation between close price and and close price 5
days back.I was interpreting that as a comparison of only 2 periods and
notevery bar in between them. Are you saying that a period of
say 21 islooking at the whole 21 bars? Here's the whole
formula FYI://***Base Market************/Mkt="dia";//Must be
enclosed in
"....."Quotations.P=Foreign(Mkt,"C",1);Periods1=21;//Set the
period of Observation Periods2=100;//Set the period of Observation
/***R-Squared*****************/R1=Correlation(P,C,Periods1)^2;R2=Correlation(P,C,Periods2)^2;
Filter= R1>0.75 AND R2
>0.75;AddColumn(R1,"r21",1.2);AddColumn(R2,"r100",1.2);TIA,DominickSend
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
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
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|