Forex Stock Price Prediction Using Transformer And Time Embeddings

This repository contains the code for the Project "Forex Stock Price Prediction using Transformers and Time Embeddings" written in Tensorflow 2.9.1

Data ScienceJupyter NotebookMIT

Abstract

Forex Stock Price Prediction Using Transformer And Time Embeddings is an open-source Data Science project. This repository contains the code for the Project "Forex Stock Price Prediction using Transformers and Time Embeddings" written in Tensorflow 2.9.1. The foreign exchange (Forex) market is a global decentralized market for the trading of currencies. It is one of the largest financial markets in the world, with an average daily trading volume of over $5 trillion. It is built using Jupyter Notebook. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Data Science mini project or final-year project.

1. Introduction

The foreign exchange (Forex) market is a global decentralized market for the trading of currencies. It is one of the largest financial markets in the world, with an average daily trading volume of over $5 trillion. Predicting the price movements of Forex markets is a challenging task, as these markets are affected by a variety of factors, including economic and political events, interest rates, and global news. In recent years, deep neural networks have shown great potential in predicting stock market prices. In this report, weexplore the use of transformer-based deep neural networks for Forex stock market price prediction. We use the Transformer-XL architecture, which is a variant of the Transformer architecture that is designed to handle long sequences. We also use time embeddings to encode the time information of the input data. We evaluate our model on the EUR/USD Forex pair and compare it to a variety of baseline models. Our model achieves a mean absolute error (MAE) of 0.0004 on the test set, which is a 20% improvement over the best baseline model.

The dataset we have used is that of IBM stock price history. The dataset starts from 1962-02-16 and ends on the date 2020-01-31. The data contains the Open, High, Low, Close as well as the trading Volume (OHLCV) of the IBM stock for every day between the aforementioned dates, leading to a total size of 14588 entries.

2. Objective

This repository contains the code for the Project "Forex Stock Price Prediction using Transformers and Time Embeddings" written in Tensorflow 2.9.1

This project demonstrates how Jupyter Notebook can be applied to a real-world Data Science problem.

4. Technology Stack

Jupyter Notebook

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later with Jupyter Notebook / JupyterLab (or Google Colab)
  • pip for dependencies
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/ayushabrol13/Forex-Stock-Price-Prediction-using-Transformer-and-Time-Embeddings.git
cd Forex-Stock-Price-Prediction-using-Transformer-and-Time-Embeddings

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Turn the analysis into an interactive dashboard
  • Automate data refresh with a scheduled job
  • Add a predictive model on top of the analysis

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. What is the source of the dataset and how was missing data handled?
  2. Which exploratory analysis steps revealed the most useful insight?
  3. Why were these particular charts chosen to present the data?
  4. Which statistical or ML technique supports the conclusions?
  5. How could the analysis be automated or refreshed with new data?

9. Source Code & License

This project is developed by ayushabrol13 and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Data Science project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Data Science Internship