Photo by Marc Schulte on Unsplash

Forecasting Stock Prices using XGBoost (Part 2/5)

A Follow-up to Part 1

Yibin Ng
Published in
7 min readDec 8, 2020

--

So after I published my first article (here) on forecasting stock prices using XGBoost, I received feedback that the signal should first be made stationary before making any predictions, otherwise it is like trying to shoot at a fast-moving and erratic target. This article aims to repeat the analysis we did in Part 1, but we use stock returns instead of the raw stock prices.

Problem Statement
Exploratory Data Analysis
Feature Engineering
Training, Validation, Test split
Hyperparameter Tuning
Applying the Model
Findings

Problem Statement

Here, we aim to predict the daily returns of Vanguard Total Stock Market ETF (VTI), using data from the previous N days. In this experiment, we will use 6 years of historical prices for VTI from 2013–01–02 to 2018–12–28, which can be easily downloaded from yahoo finance. After downloading, the dataset looks like this:

Downloaded dataset for VTI. The column ‘daily_ret’ is computed.

--

--

Yibin Ng
AI Trading Labs

Data Scientist. Signal Processing, Applied Cryptography, Privacy and Security, Geospatial Analysis, Machine Learning. https://eigenai.co