Predicting Stock Prices Volatility To Form A Trading Bot with Python

Learn how to employ a statistical model to predict stock price volatility and form a potential algo trading strategy.

Luke Hardy
Quant Factory

--

Forecasting stock returns can be tempting, it may sound like a good idea but it’s challenging to do accurately and consistently. It’s often best left to well-equipped institutions.

However, it is much easier to predict stock price volatility with a time-series model, for example, the GARCH model. That’s exactly what we are focusing on in this article today. We are going to find the best GARCH model to fit in terms of Autoregressive and Moving Average orders. Then we are going to fit this model and predict in a rolling window the variance of a stock for 1 step ahead, in our case that would be 1 day ahead. After we have all the predictions made, we would be able to compare them to the variance itself and try to form a tradable signal. Let’s get into it!

The development of a volatility model for the stock-returns series is done in four steps:

  1. Construct an ARMA model for the financial time series using the serial correlation indicated by the ACF and PACF.
  2. Examine the residuals of the model for ARCH/GARCH effects by utilizing the ACF and…

--

--