Training an LSTM to Forecast Futures Prices from Tick Data
Summary
This tutorial outlines a workflow for modeling Chinese steel futures using high frequency market data. It starts with tick snapshots for the RB2305 contract, explains that futures may trade during night sessions, and resamples the raw observations into ten second bars to reduce the dataset. The example then computes log returns and plots prices, volume, and return distributions as exploratory checks.
For prediction, the tutorial uses close, open, and volume as features and aligns them with prices one minute ahead. It describes scaling features and labels, forming sequences for an LSTM, splitting observations into training and test sets, and loading batches for a PyTorch model. The reported residuals are mostly within a stated range, with greater variation in the test set. This is a small, short sample and a simple model; the document presents it as a learning exercise, not evidence of a deployable strategy. It does not establish trading profitability, robust out of sample performance, or execution viability.
Key ideas
- Tick data can be resampled into fixed interval bars to make time series modeling more manageable.
- The example predicts a futures price one minute ahead using recent price and volume features.
- LSTM inputs are constructed from scaled sequential observations and divided into training and test sets.
- The residual discussion is limited to a small sample and does not demonstrate a tradable edge.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.