Calculating the most popular technical indicators
There are hundreds of different technical indicators that traders use for making decisions whether to enter or exit a position. In this recipe, we will learn how to easily calculate a few of those indicators using the TA-Lib
library, which is the most popular library for such a task. We start with a brief introduction of a few of the selected indicators.
Bollinger Bands are a statistical method, used for deriving information about the prices and volatility of a certain asset over time. To obtain the Bollinger Bands, we need to calculate the moving average and standard deviation of the time series (prices), using a specified window (typically, 20 days). Then, we set the upper/lower bands at K times (typically, 2) the moving standard deviation above/below the moving average. The interpretation of the bands is quite simple: the bands widen with an increase in volatility and contract with a decrease in volatility.
The default setting of using...