Code
Language: Python 2.7
3rd Party Packages: None
This program is pretty simple to use, all we have to do is run the program and wait for it to terminate. Our data comes from Yahoo! so depending on the internet connection and the amount of data being downloaded this may take a few minutes to complete.
FileSnack link: http://snk.to/f-c7clb99t
The zipped file contains:
- Main program: poorBoysData.py
- S&P 500 companies: SP500.txt
- Empty folder: Tickers
How the Code Works
Our Yahoo! Data Collector is pretty straight forward. Our program navigates to Yahoo, downloads the historical data, and saves it to the file [stock's ticker].txt in the folder 'Tickers.'
In our back test we always ran into problems with 4:1 stock splits and special one-time dividends so to correct these data errors we replaced Yahoo!'s open, high, low, and close with the following:
There are four primary variables that if changed will make the program perform a different function and collect data in a different way. We can choose to collect data from the S&P500 by changing isSP500 to True or we can collect a specific set of data by setting isUsersTickers to True and populating the usersTickerList list with ticker symbols. The fourth is the adjustPrices variable mentioned above.
In our back test we always ran into problems with 4:1 stock splits and special one-time dividends so to correct these data errors we replaced Yahoo!'s open, high, low, and close with the following:
Open = (Open / Close) * Adjusted CloseThe price adjustment can be turned off by setting adjustPrices to False.
High= (High/ Close) * Adjusted Close
Low= (Low/ Close) * Adjusted Close
Close = Adjusted Close
Further Functionality and Modification
There are four primary variables that if changed will make the program perform a different function and collect data in a different way. We can choose to collect data from the S&P500 by changing isSP500 to True or we can collect a specific set of data by setting isUsersTickers to True and populating the usersTickerList list with ticker symbols. The fourth is the adjustPrices variable mentioned above.
titanium app | TITanium Arts
ReplyDeleteOur titanium rod in leg app is designed to titanium nitride coating service near me develop the fastest and the titanium plate flat irons fastest. Discover how to create it and make a titanium nail living. Get titanium earrings sensitive ears a free TITACORE APP