Fundamental analysis¶
In this tutorial, you will learn:
- The basics of fundamental analysis
- What are financial ratios
- How to carry out stock screening
Intro to fundamental analysis¶
As we have discussed in the first tutorial, fundamental analysis is a methodology for
predicting the security’s intrinsic value, which may or may not be equal to
its current market value. In general, fundamental analysis could be divided into
quantitative and qualitative.
- Quantitative aspect concerns about studying numerical figures like the company’s revenues, profits, assets, debts, etc
- Qualitative aspect focuses on intangible factors like the company’s management background and brand recognition.
In addition, it is also crucial to look at economic
factors like interest rates, inflation, GDP, etc. These can all affect the
general situation of the company.
In this module, we’ll focus on the quantitave aspect of a company. We could
get the numerical figures we need from the company’s income statements,
cash flow statements and balance sheets.
Financial ratios¶
Instead of using the raw figures we obtained, we would use these figures to compute
financial ratios that help us summarise the financial statements and the
health of a company.
Here are four basic ratios that are often used to pick stocks for investment portfolios:
- Price-earnings (P/E) ratio
- Earnings per share (EPS) ratio
- Debt-to-equity ratio
- Return on equity (ROE) ratio
In the following, we’lll go through the major types of ratios and the equation for each ratio
one by one.
Short-term solvency ratios¶
Definition
Short-term solvency ratios are used to judge the adequacy of liquid assets for
meeting short-term obligations as they come due.
The higher the ratio result, the better a company’s liquidity and financial health;
the lower the ratio, the more likely the company will struggle with paying debts.
Current ratio¶
Current ratio measures a company’s ability to pay short-term obligations or
those due within one year.
\[\text{Current ratio} = \frac{\text{Current assets}}{\text{Current liabilities}}\]
Quick ratio¶
Quick ratio indicates a company’s capacity to pay its current liabilities without
needing to sell its inventory or get additional financing.
\[\text{Quick ratio} = \frac{\text{Current assets} - \text{Inventory}}{\text{Current liabilities}}\]
Cash ratio¶
Cash ratio calculates a company’s ability to repay its short-term debt with cash
or near-cash resources, such as easily marketable securities.
\[\text{Cash ratio} = \frac{\text{Cash equivalents} + \text{Cash}}{\text{Current liabilities}}\]
Networking capital to current liabilities¶
text{Networking capital to current liabilities} = frac{text{Current assets} + text{Current liabilities}}{text{Current liabilities}}
Turnover ratios¶
Definition
Turnover ratios represent the amount of assets or liabilities that a company
replaces in relation to its sales. The concept is useful for determining the
efficiency with which a business utilises its assets.
Inventory turnover ratios¶
Inventory turnover ratios is a ratio that measures the number of
times inventory is sold or consumed in a given time period.
\[\text{Inventory turnover ratio} = \frac{\text{Cost of goods sold}}{\text{Average inventories}}\]
Receivable turnover¶
Receivable turnover is the number of times per year that a business collects
its average accounts receivable. It evaluates the ability of a company to
efficiently issue credit to its customers and collect funds from them in a timely manner.
\[\text{Receivable turnover} = \frac{\text{Sales}}{\text{Accounts receivable}}\]
Fixed asset turnover¶
Fixed asset turnover indicates how well the business is using its fixed assets to generate sales.
\[\text{Fixed asset turnover} = \frac{\text{Net sales}}{\text{Average fixed assets}}\]
Total asset turnover¶
Total asset turnover measures the efficiency with which a company uses its assets to produce sales.
\[\text{Total asset turnover} = \frac{\text{Net sales}}{\text{Average total assets}}\]
Financial leverage ratios¶
Definition
Financial leverage ratios indicates the level of debt incurred by a business entity
against several other accounts in its balance sheet, income statement, or cash flow statement.
They show how the company’s assets and business operations are financed
(using debt or equity).
Total debt ratio¶
Total debt ratio represents the proportion of a company’s assets
that are financed by debt.
\[\text{Total debt ratio} = \frac{\text{Total debts}}{\text{Total assets}}\]
Debt to equity ratio¶
Debt to equity ratio measures the degree to which a company is
financing its operations through debt versus wholly-owned funds.
\[\text{Debt to equity ratio} = \frac{\text{Total debts}}{\text{Total equity}}\]
Equity ratio¶
Equity ratio represents the relative proportion of equity used to finance a
company’s assets.
\[\text{Equity ratio} = \frac{\text{Shareholder's equity}}{\text{Total asset}}\]
Long-term debt ratio¶
Long-term debt ratio shows the proportion of a company’s assets
it would have to liquidate to repay its long-term debt.
\[\text{Long-term debt ratio} = \frac{\text{Long-term liabilities}}{\text{Total equity}}\]
Times interest earned ratio¶
Times interest earned ratio measures a company’s ability to meet
its debt obligations based on its current income.
\[\text{Times interest earned ratio} = \frac{\text{Earnings before interest and tax (EBIT)}}{\text{Total interest expense}}\]
Profitability ratios¶
Definition
Profitability ratios measure the ability of a company to generate income (profit)
relative to revenue, balance sheet assets, operating costs, and shareholders’ equity during a
specific period of time. They show how well a company utilises its assets to produce profit
and value to shareholders.
Gross profit margin¶
Gross profit margin indicates how efficient a business is at managing its operations.
\[\text{Gross profit margin} = \frac{\text{Revenue} - \text{Cost of goods sold (COGS)}}{\text{Revenue}}\]
Net profit margin¶
Net profit margin indicates how much of each dollar in revenue
collected by a company translates into profit.
\[\text{Net profit margin} = \frac{\text{Revenue} - \text{Cost}}{\text{Revenue}}\]
Return on assets (ROA)¶
Return on assets indicates how profitable a company is relative
to its total assets.
\[\text{Return on assets} = \frac{\text{Net income}}{\text{Total assets}}\]
Return on equity (ROE)¶
Return on equity measures the profits made for each dollar from shareholders’ equity.
\[\text{Return on equity} = \frac{\text{Net income}}{\text{Shareholder's equity}}\]
Ratio analysis for stock screening¶
The ratio analysis example could be found in :code: code/fundamental-analysis/ratio-analysis.ipynb.
With the equations above, it would be easy to compute the ratios just with column manipulations:
# take equity ratio as an example
equity_ratio = df["Total stockholders\' equity"].astype(int)
/ df['Total Assets'].astype(int) # Total stockholders' equity / Total Assets
# store all the ratios in the `ratios` dataframe
ratios["Equity ratio"] = equity_ratio
After calculating these ratios, we would want to create screening masks to filter out stocks that
have a relatively better performance.
# e.g. filter out stocks with profitability ratio greater than overall mean
mask1 = (ratios['EPS'] > ratios['EPS'].mean())
mask2 = (ratios['ROE'] > ratios['ROE'].mean())
mask3 = (ratios['ROA'] > ratios['ROA'].mean())
We could apply these masks on the ratios dataframe to get the filtered stocks eventually:
# apply the masks
ratios[(mask1) & (mask2) & (mask3)]
References
Attention
All investments entail inherent risk. This repository seeks to solely educate
people on methodologies to build and evaluate algorithmic trading strategies.
All final investment decisions are yours and as a result you could make or lose money.