Click here to Login




How to screen for stocks having a high correlation with the Dow Jones index

Updated on 2011-09-17





Steps:

- Click on "Analysis" then "Screener" to open the screener tool
- In the "Formula Editor", type the following formula:

dji = GetSeries("^DJI", close, LastData);
var1 = correl(perf(close, 1), perf(dji, 1), 30);
filter = var1 >= 0.5;
AddColumn("Correl", var1);


In the first line, we use the "GetSeries" function to reference an external time-series (Dow Jones Index or ^DJI in this case)
In the second line, we calculate the 30-bar correlation between a stock daily returns and the daily returns of the Dow Jones ("Perf" indicator with one bar as parameter)
In the third line, we instruct the application to display stocks with at least 50% correlation.
In the fourth line, we instruct the application to create a correlation column in the "Result" table.

- Select Date/Bar, ticker symbols then click on "Start" to begin the screening process.

In the "Result" table, click on the correlation column header to sort stocks by their 30-Bar correlation with the Dow Jones Industrial Average.

To return stocks' correlation with other indices or funds, simply replace "^DJI", in the "GetSeries" function, by the new index or fund ticker symbol.
Do not forget to download the latest historical data for the asset.










no comments (Log in)

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.