Skip to content
All library documents

Training a Feed-Forward Network to Forecast Hourly FX Direction

Article Robot Wealth

Summary

This tutorial demonstrates a basic feed-forward neural network workflow for classifying the direction of hourly foreign exchange price changes. It constructs features from hourly changes in closing, high, and low prices, along with distances among those prices and the hourly range. Lagged observations become model inputs, and the target is converted into an up-or-down label. The data is divided chronologically into training, validation, and test portions.

The example builds a dense network in Keras, trains it with binary cross-entropy and RMSprop, and selects a saved model using validation performance. On its held-out test data, the reported accuracy is 0.523 and the loss is 0.691; the tutorial also illustrates turning model probabilities into directional positions and plotting cumulative returns. These figures are a single example, not evidence of a robust or profitable strategy. The article is an introductory modeling walkthrough, and its opening context cautions that extracting meaningful signals from historical markets is difficult; it does not establish generalization across markets or periods.

Key ideas

  • Lagged hourly price changes and price-range relationships are used as features for FX direction classification.
  • The example labels positive and nonpositive future changes as binary targets.
  • Training, validation, and test data are split in chronological order.
  • A dense Keras network is trained and selected based on validation performance.
  • The reported test accuracy is modest and does not demonstrate trading profitability or robustness.

Tags

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