Pragmatic Deep Learning Model for Forex Forecasting

Pragmatic Deep Learning Model for Forex Forecasting

Pragmatic Deep Learning Model for Forex Forecasting. Using LSTM and TensorFlow on the GBPUSD Time Series for multi-step prediction

In an attempt to solve the classical question, “Can machine learning predict the market?”, I landed on Forex GBPUSD as a challenging financial series with an abundant and free data set. Although there are tens of stories on this platform on stock ML prediction and a handful on Forex ML prediction, here you will see me delve into the peculiarities that are often missed and aim to take my model to the reality spectrum:

  • By implementing multi-step predictions such as 30 or 60 steps (minutes in this case) or more, as opposed to a single step (1 minute) prediction
  • By consuming the model using an algorithmic trading bot to let the profit, or loss, be the judge (the next story)

At the end of the story, readers with some Python and ML experience will be able to use the concepts and modify the linked code to produce their own variation of the model. In part 2, reader will be able to use a commercial algo trading platform with the model.

Source Code and Following Along

The model is built in Python 3.8 using TensorFlow/Keras 2.3. To keep this story focused on concepts, the full source code and the environment preparation, along with the explanation related to running and changing the code are here:

Also, you can view the environment setup and the steps to run the model, visually explained:

Explaining the environment setup and the steps to run the model

Table of Contents

Forex Trading Primer

  • What is Forex?
  • Commission, Spread and Pips
  • Tick Data
  • Open High Low Close Data
  • Candlestick Charts
  • Forex Trading
  • Algorithmic Trading
  • Backtesting

The ML Model: Concept and Plan

  • Model Choice
  • Technical Stack Choice
  • Hardware Choice
  • The Plan

1 — Data Sourcing

2 — Data Preparation

  • Time Interval and OHLC
  • Smoothing
  • Stationarity
  • Batch Size
  • Train, Test Split
  • Process Summary
  • Scaling
  • LSTM Data Input Overview
  • Windows Size
  • Converting Samples

3 — Model Training

  • Training Statistics

4 — Predictions

  • Single-Step Prediction
  • Multi-Step Prediction

tensorflow algorithmic-trading forex-trading deep-learning lstm

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Use a TensorFlow Deep Learning Model for Forex Trading

Building an algorithmic bot, in a commercial platform, to trade based on a model’s prediction. In this tutorial, you'll see How to Use a TensorFlow Deep Learning Model for Forex Trading

Learn Transfer Learning for Deep Learning by implementing the project.

Project walk-through on Convolution neural networks using transfer learning. From 2 years of my master’s degree, I found that the best way to learn concepts is by doing the projects.

Applied Deep Reinforcement Learning in Quantitative Trading

An A.I. Capital Management Research Article Series. Machine learning and artificial intelligence is becoming ubiquitous in quantitative trading.

Top Deep Learning Frameworks in 2020: PyTorch vs TensorFlow

Top Deep Learning Frameworks in 2020: PyTorch vs TensorFlow. This article outlines five factors to help you compare these two major deep learning frameworks; PyTorch and TensorFlow.

Learn TensorFlow.js - Deep Learning and Neural Networks with JavaScript

This full course introduces the concept of client-side artificial neural networks. We will learn how to deploy and run models along with full deep learning applications in the browser! To implement this cool capability, we’ll be using TensorFlow.js (TFJS), TensorFlow’s JavaScript library.