April 2019
Intermediate to advanced
426 pages
11h 13m
English
A common technical indicator for time series data analysis is moving averages. The mean() method can be used to compute the mean of values for a given window in the rolling() command. For example, a 5-day Simple Moving Average (SMA) is the average of prices for the last five trading days, computed daily over a time period. Similarly, we can also compute a longer term 30-day simple moving average. These two moving averages can be used together to generate crossover signals.
In the following example, we download the daily closing prices of ABN, compute the short- and long-term SMAs, and visualize them on a single plot:
In [ ]: %matplotlib inline import quandl import pandas as pd quandl.ApiConfig.api_key = QUANDL_API_KEY ...
Read now
Unlock full access