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

Re: [amibroker] New operating system



PureBytes Links

Trading Reference Links

Jayson:

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 using
periods range  
EXAMPLE correlation( close, ref( close, -5 ), 5 ); - this calculates
correlation between close price and and close price 5 days back.

I was interpreting that as a comparison of only 2 periods and not
every bar in between them.   Are you saying that a period of say 21 is
looking 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,

Dominick







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