Saturday, February 13, 2010

How to generate a list of stocks according to your own magic formula – Part One

Everyone has his/her own method/way doing things, including trading. Different trading styles require totally different watch lists. In this note, I am going to show you how to generate your own list of stocks according to your magic formula. Best of all, it only requires 2 very good free software.


(1) Yahoo & Google Historical Data Downloader. This tool is used to acquire free historical End of Day quotes from Yahoo, Google, or MSN.

Download from:

(2) FreeMAT. This tool is used for data analysis and visualization.

FreeMAT is a free environment for rapid engineering and scientific prototyping and data processing. It is similar to commercial systems such as MATLAB from Mathworks, but it is Open Source and FREE.

Download from:

Once you have the above two free software installed. Follow the steps below:

Step (1) Generate a stock symbol list file that contains all the symbols you want to search from. This is a simple text file, for example, I have a file called “ALL_SYMBOLS.txt”


If you want to add more symbols later, simply open the text file, add the symbol.
To generate this symbol manually takes long time. I will tell you a trick to generate a list of S&P500 symbols quickly.

Go to http://www.finviz.com/screener.ashx?v=111&f=idx_sp500
Then at the bottom right corner, there is a hyperlink called “export”
Click the “export”, it will open an excel file,
Copy the column B into a text file. You just made a list of 500 symbols in a minute.

Step (2). Open the Yahoo&Google Historical Quotes Downloader:

If you are using it for the first time, please then set the Symbols to your newly generated symbol text file, and also set “Data path” to a directory that you want to store all symbol data file. For example, I choose “C:\RelativeStrength\list\ALL_SYMBOLS.txt” as my symbols source, and “C:\RelativeStrength\temp” directory to store all downloaded files.

Also click “Settings” button, and select “Formatting”, make sure the settings are as follows:

Note that these steps are only required for the first time use.

Now just click the “Download Data” button. It will download all stocks from the symbol file.

Each file should look like this with the latest date data in the first row:

Click Here for Part Two of this article.

blog comments powered by Disqus

My Favorite Books