User Avatar

Leo E.

4y ago

Math enthusiast

Stock Technical Analysis: Simple Moving Averages Help Interpret Irregular Volume Data

Today I decided to expand the set of technical indicators used for evaluating stocks. The previous indicators based on price / volume combination and On-balance volume seem fundamental. In the similar vain, today I am taking a deeper look at another simple but fundamental indicator: simple moving averages (SMA).

Intuitively, moving averages just smoothes the data, so it does not seem particularly exciting. The key benefit of SMA is the filtering the noise out of data. Note that unlike price / volume indicators form previous essays this metric does not have any predictive power. Another reason to explore SMA is to prepare the ground for more complex indicators that use it as a building block.

The mathematical definition, given a time-frame of size n, given data points D1, D2, ..., Dn, SMA is just an average:

SMA = (D1 + D2 + ... + Dn) / n

This defintion simple enough to implement in Python, but I'll just use Python built-in statistics module.

from statistics import mean

I applied SMA with "window" length equal to five days for yesterdays ON Semiconductor EKG like volume data to see the effects of smoothing. The smoothing is obvious. Moreover, the smoothed volume data for ON stock is U shaped, and more importantly it is "synchronized" with the U shaped closing price data. In this case, smoothing confirmed the yesterday's estimate of bullish behavior of the ON stock.