Skip to content
All library documents

Using Decision Trees to Classify and Forecast Futures Returns

Article QuantInsti blog

Summary

This tutorial explains how to prepare market data for classification and regression decision trees. It uses daily E-mini S&P 500 futures data and constructs predictors from exponential moving averages, average true range, average directional index, relative strength index, and MACD. The classification target indicates whether the next day’s return is positive; the regression target is the next day’s return. The workflow covers cleaning indicator data, splitting observations into training and test sets, fitting each tree, and examining its splits.

The examples illustrate how predictors and targets differ between categorical direction forecasts and continuous return forecasts. The article emphasizes that a held-out test set helps assess generalization and reduce overfitting, while indicator choices and tree parameters still require careful tuning. It supplies an educational workflow, not convincing evidence of a profitable strategy: no robust out-of-sample trading results, transaction costs, or execution analysis are established. It suggests ensemble approaches as a possible next step.

Key ideas

  • A decision tree can classify next-period direction or estimate a continuous future return.
  • The example uses futures prices and technical indicators as predictor variables.
  • Targets are shifted forward so predictors use information available before the forecast period.
  • Separating training and test data helps evaluate whether a fitted tree generalizes.
  • Tree settings and indicator parameters need further tuning, and predictive output does not establish profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.