Prediction of the future of a Forex or Crypto Currency

We trained a LSTM (long short term memory) model to learn the currency's behavior

Posted by Dirouz on April 21, 2024

The Quest for Future Sight: A Deep Dive into Neural Trading

In the dynamic world of financial markets, our team crafted an AI oracle powered by one of the most sophisticated neural architectures - the Long Short-Term Memory (LSTM) network. Think of LSTM as a brilliant mathematician with an exceptional memory system, capable of remembering patterns across long sequences while knowing exactly what to remember and what to forget.

The magic of LSTM lies in its intricate "gates" - the forget gate, input gate, and output gate. Like a master trader's brain, the forget gate decides which market patterns are relevant and which ones to discard. The input gate carefully selects new information to store, while the output gate determines what predictions to make based on this processed information.

Our digital apprentice started its journey with Microsoft's historical data. Each piece of data flowed through these gates in a carefully orchestrated dance:

  • The forget gate examined past market trends
  • The input gate absorbed new price movements
  • The cell state maintained crucial long-term patterns
  • The output gate produced our future price predictions

When we first cast our net wide across months of data, our LSTM struggled with the complexity of long-term fundamental changes - like trying to predict a year's weather from today's temperature. However, when we narrowed our focus to shorter timeframes, the LSTM's pattern recognition abilities shined brilliantly.

The technical architecture proved particularly effective because:
  • LSTM cells maintained market momentum information across trading sessions
  • The gating mechanisms filtered out market noise while preserving crucial signals
  • The neural network adapted to evolving market conditions through backpropagation

For our next iteration, we're expanding the model's inputs to include the complete OHLC (Open, High, Low, Close) candle data, and we're targeting the crypto market's minute-by-minute movements. The LSTM's ability to process sequential data makes it perfect for capturing the rapid price fluctuations in cryptocurrency markets.

... ... ...

Conclusion

This journey into neural trading demonstrates the powerful intersection of financial markets and artificial intelligence, where each timestep brings us closer to mastering the art of market prediction!