PureBytes Links
Trading Reference Links
|
lookback=10;
x=IIf(GroupID()==1,Correlation(C,Foreign("^DJI","C"),Lookback)
IIf(GroupID()==2,Correlation(C,Foreign("^NDX","C"),Lookback)
IIf(GroupID()==3,Correlation(C,Foreign("^FTSE","c"),Lookback)
IIf(GroupID()==4,Correlation(C,Foreign("^GDAXI","c"),Lookback),0))));
Plot(x,"Correlation",colorRed,styleLine);
Title="( "+ WriteVal(LOOKBACK,1)+" )"+" period Correlation between...
+Name()+ "...And..." + WriteIf(GroupID()==1,"^DJI",WriteIf(GroupID()==2,
^NDX",WriteIf(GroupID()==3,"^FTSE",WriteIf(GroupID()==4,"^GDAXI",""))))+" =
+WriteVal(X,1.2);
Anthony
-------Original Message-------
From: amibroker@xxxxxxxxxxxxxxx
Date: Sunday, April 20, 2003 11:03:51
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Help please ... How to code correlation of index to
share
Hi folks.
Got stuck with AFL ...
Lets say I have several groups set up, and each group contains a bunch of
shares, plus a corresponding index. For example:
Group Shares Indice
1 30 Dow shares ^DJI
2 100 Nasdaq shares ^NDX
3 100 FTSE shares ^FTSE
4 30 german shares ^GDAXI
How can I set up an indicator that will plot the correlation of the current
share to the indice associated with that shares group? For example:
corr=(c,close from index in current share's group);
plot(corr,"correlation",colorblack,styleline);
Any sneaky way to code this without using 20 nested iif's? I have 20 groups.
..
Thanks,
Andy
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.
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online-No late fees! Try Netflix for FREE!
http://us.click.yahoo.com/YKLNcC/oEZFAA/i5gGAA/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/
|