Skip to content
All library documents

CNN-LSTM Stock Direction Model and Daily Threshold Trading Example

Article BigQuant

Summary

This BigQuant example builds a binary classifier from rolling windows of daily open, high, low, close, and volume changes. Its network applies a convolutional layer to each 50-step, five-feature input, passes the result through an LSTM and dense layers with dropout, and predicts whether the stock's return over the following ten days is positive. The shown workflow separates earlier observations for training from later observations for prediction, then reports classification accuracy in code.

The trading example uses a single A-share instrument: it targets a fully invested position when the predicted probability exceeds 0.5 and exits when it falls below that threshold. It specifies a benchmark and transaction costs, but the document supplies no actual accuracy or backtest performance results. The page is framed as a post about an error after a platform upgrade, yet includes no clear diagnosis or repair; the displayed generated strategy code is the main substantive material. Its single-stock example and limited evaluation details constrain conclusions about generalization.

Key ideas

  • The model uses rolling windows of five daily price and volume features to predict the sign of a later return.
  • Its architecture combines a convolutional layer, an LSTM, and dense layers with dropout.
  • The example divides data by date into training and prediction periods and computes classification accuracy.
  • The trading rule enters a fully invested position above a 0.5 prediction threshold and exits below it.
  • No actual predictive or trading results are reported, and the example uses one instrument.

Tags

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