Skip to content

A script which parses Morning Star for key financial ratios and company accounts for all companies in the stock index using Good Morning repo

License

Notifications You must be signed in to change notification settings

ferhat00/fundamental_analysis_stocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fundamental Analysis Stocks

This script uses the Good Morning repo by Peter Cerno. This code parses the Morning Star website for a given ticker symbol using the gm.KeyRatiosDownloader() function and returns the specified fundamental indicators and ratios for that company. My code runs this in a loop parsing through all the companies in a country specific CSV file with the ticker symbols of all the companies for that country. It then outputs all that into a dataframe.

Requirements

Python 3, Good Morning, Pandas

Here is the raw output: capture

Some boolean logic on the dataframes, or creating your own columns through calculations of other ratios can then be undertaken as a filter to narrow down the list of companies. This is then output to anoth 'condition' dataframe. The code outputs the raw and condition dataframes to a csv file.

Condition output: capture2

Currently there is a limited number of sequential requests to the Morning Star website using Good Morning, so the code was modified to ignore Value Error and retry with the same ticker symbol.

I welcome others to fork and continue this in the future.

Usage

Modify country_code = 'UK' at the beginning of the script before you run it, picking one of the countries in the dictionary. Then run in IDE. Takes about 1-2 mins depending on internet connection and number of tickers in input file.

Future tasks

  • Initial concept script
  • Make script object oriented function
  • Enable automatic creation, up to date list of ticker symbols, perhaps parsing some online source
  • Expand to other country ticker symbols

About

A script which parses Morning Star for key financial ratios and company accounts for all companies in the stock index using Good Morning repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages