Circle of Competence (CoC) is a web-scraping tool designed to analyze stock market symbols according to criteria discussed in Benjamin Graham's The Intelligent Investor.
It allows a user to quickly analyze publicly-traded companies, and roughly determine their intrinsic value. As with all investing tools, use it at your own risk.
First, have Python 3+ installed on your system so you can run python files.
-
Clone the repository into a directory of your choosing.
-
Run the
main.py
file. You'll be prompted to enter one or more stock symbols. -
Enter your symbol(s) along with any desired flags.
- $
bgs -x
- Note: It takes a few seconds per symbol to scrape/process the required data.
- $
-
Look at the results printed to the console.
-
Enter more symbols as desired.
-
Type 'exit' or 'quit' to close the program.
You can also pass a sequence of symbols via the standard in to main program by using the -m batch
flag at program start.
This will execute a parallelized fetch of the symbol information and writes the results to the coc.xlsx
file.
Example:
echo "BRK.B" | python3 main.py -m batch
Note that flags can be combined into strings prepended with a dash, so "-dx" would run both "-d" and "-x".
- "-d" Debug Mode
- Debug mode, prints all available fetched data for a symbol.
- "-j" JSON Output
- Generates and prints a JSON string for all the symbols given.
- "-s" Silent Mode
- Silent mode, hides all console output for each symbol. Best when used in combination with JSON generation.
- "-x" Excel Update/Creation
- Appends the symbol to a generated excel file,
coc.xlsx
. If the symbol already exists in file, then its row is overwritten with fresh data.
- Appends the symbol to a generated excel file,
CoC uses a variety of datapoints for appraising a company according to the 7-point system. Most of these values are fundamentals derived from financial statements and balance sheets, such as: Market Capitalization, P/E Ratio, Assets, Liabilities, etc.
Additionally, there are general indicators listed to assist in determining the strength of a company. These include things such as its price relative to its Book Value, or the Payout Ratio of its dividend.
Together, these help illustrate where potential weaknesses in a company may lie. Although CoC can be used to identify long-term strength in a company, it primarily identifies the presence (or absence) of long-term weakness.
Internally, CoC analyzes companies based on the following criteria. An answer of True is associated with relative strength, whereas False is associated with relative weakness.
- Does it have cheap assets?
- Is Market Capitalization < Net Asset Value * 1.5?
- Note: Net Asset Value = (Assets - Liabilities)
- Essentially, is the value of all its outstanding shares less than 1.5x the assets leftover after paying all its debts.
- Does it have earnings growth of at least 2.9% annually for the last 5 years?
- This equates to approximately 15% total growth over 5 yrs.
- Has it not had an earnings deficit in the last 5 years?
- Were there any years where it lost money?
- Does it have a Current Ratio of at least 2.0?
- Are the company's underlying assets worth at least twice its short-term debts (those owed in one year)?
- Does it have cheap earnings?
- Is its Price-to-Earnings Ratio <= 15?
- Essentially, is it priced no greater than 15x its annual earnings.
- Is its Price-to-Earnings Ratio <= 15?
- Does the company have over $700M (USD) in annual sales?
- This ensures that the company is large and consistently does real business.
- Has it not missed or reduced its dividend payments in the last 5 years?
- This only applies if the company has previously paid a dividend.
- Analysis
- A breakdown of which criterion pass/fail and how so. Meant to inform users of a company's risks.
- Graham Number
- The Graham number is a calculation to determine a fair value for a company's shares. Purchasing at or below this value is seen as ideal.
- It is calculated as the sqrt(22.5 * EPS * BVPS).
- Sometimes CoC returns a negative value for the Graham number. This means that either the EPS, the BVPS, or both are negative.
- This indicates a need for manually examining the two values further.
- Dividend Yield
- Relative to the currently traded price, what percentage of profits are payed out annually by the company.
- Sector
- A descriptor of which industry the company does business in.