Investing with Python:
By: Curt Beck
Tags: Investing, Data Science, Python

Combining Technical and Fundamental Analysis to Kick Start Your Investing

Photo by Ishant Mishra on Unsplash

Introduction

Having little experience in investing, I’m somewhat intimidated when deciding to buy a stock. Stocks contain a plethora of data-points, making it easy to experience information overload. Amidst all of this data, it’s natural to ask what metrics to consider, and is there a fast and easy way to make an investment decision — Warren Buffet is rolling his eyes right about now.

There are two schools of thought on investing — Technical and Fundamental analysis — and each uses a variety of metrics to assess whether to invest in a stock. In this article, I’ll briefly describe each approach and the merits of combining the two, along with outlining several of the metrics that each camp uses. Finally, I’ll show how to combine both fundamental and technical analysis in Python, making for an easy-to-use tool to kick start your analysis.

A Brief Background on Technical and Fundamental Analysis

Technical and fundamental analysis go about investing in separate ways: Technical analysis uses past price and trading history to assess whether a stock is a sound investment. One of the key tenets to this approach is that the future will resemble the past. Fundamental analysis, on the other hand, eschews past trading history and focuses on financial and economic variables that affect a stock’s price.

Adherents from both schools usually argue that each school’s principals run counter to each other. For example, The technical analyst believes that the stock’s price incorporates all publicly available information. There is no need to look at other factors because they are already included in the price. Therefore, historical trading activity and price movements are key indicators for future movements.

Fundamental analysts would counter that past price movements and activity, dictated by supply and demand for a security, aren’t necessarily indicative of future performance. Enron is a classic example. Being a stock market darling for a period of time, its demise seemed unfathomable. Yet there were red flags along the way— questionable accounting methods (Mark-to-Market), and management’s questionable conduct — and focusing on these aspects would have given a more nuanced picture of the stock’s future movements.

Marrying Fundamental and Technical Analysis

While philosophically opposed, the two camps can be unified on a practical level. The two can very well lead to the same conclusion of a stock being a buy or a sell. For example, say stock’s XYZ short-term moving average is above its long term moving average (this is a buy signal to the technical analyst), and it has posted strong financial growth over the past few years, leading to a strong cash flow and balance sheet, and is poised to continue its growth due to management successfully executing on its business strategy (all very good signs to fundamental analysts). Conversely, the two camps can yield opposing conclusions on whether to buy or sell a stock. A stock’s past trading history can yield one signal, whereas its financials tell a different story. This does not necessarily mean that one technique is more reliable than the other. The point is that using the two in conjunction with each other can offer a more complete picture.

Some Key Indicators

Before describing how exactly to combine fundamental and technical analysis, I’d like to give a brief overview of several key indicators from each camp, all which can be found on Investopedia.

One technique that technical analysts employ is comparing a stock’s short-term moving average with it’s long term moving average. Short-term is usually defined as a 50-day moving average and long-term is usually defined as 200-day moving average, although these numbers are not set in stone. When the short-term moving average exceeds the long-term moving average, it signals that the stock is a “buy.” Conversely, when the short-term average falls below the long-term average, that signals that it’s time to sell the stock.

Fundamental analysts, on the other hand, consider a variety of financial ratios such as Earnings-Per-Share (EPS), Price-to-Earnings (PE), Current Ratio, Debt-to-Equity (DE), etc. They also take into consideration the management of a company as well as the economy at large.

Earnings-Per-Share (EPS) is “a company’s net profit divided by the number of common shares it has outstanding.” It “indicates how much money a company makes for each share of its stock and is a widely used metric for corporate profits.” A “higher EPS indicates more value because investors will pay more for a company with higher profits.”

the price-to-earnings ratio “relates a company’s share price to its earnings per share” and is used to assess future earnings and growth. Depending the situation, a stock with a high PE ratio can indicate that it’s poised for growth or that it is overvalued.

The current ratio measures a company’s ability to pay its short term debt — usually debt that is due within a year. A ratio below 1 can potentially signal trouble. For example, a startup may take on a significant amount of debt to help it grow and achieve profitability in the future. While the company could be a success, having a low current ratio may raise legitimate concern whether the company will survive long enough to reach its goal.

Similarly, like the current ratio, the debt-to-equity ratio measures a company’s liquidity (how well a company can pay its debts). It measures how much a company is borrowing to move its business forward, as opposed to using its own funds. A company with a high DE ratio, like our startup, may be seen as a risky investment because in the event of a downturn where funds dry up, it may not be able to cover its debts.