Master's Thesis

"Predicting Movements in the Forex Market Using Machine Learning and Genetic Algorithms to Manage Trades"

Afonso Vira dos Santos Camarão2024

Key information

Authors:

Afonso Vira dos Santos Camarão (Afonso Vira dos Santos Camarão)

Supervisors:

Rui Fuentecilla Maia Ferreira Neves (Rui Fuentecilla Maia Ferreira Neves)

Published in

11/28/2024

Abstract

This work aims to develop a trading strategy that is capable of profiting in the Forex market, particularly trading with the EUR/USD pair. Divided into two phases, this project starts by using two machine learning algorithms (SVM and XGBoost) to divide and classify market trends into five categories. To train these algorithms, two methods of classifying price data are tested, both labeling candles taking into consideration the direction as well as the strength of price variation. The second stage uses two genetic algorithms (GAs), one optimized for uptrends and another for downtrends in the market. These GAs are used to establish trading rules using the machine learning predictions, generating two sets of signals: the first set determines the best timing to open trades, while the other determines the best timing to close them, allowing trades to remain open for the most profitable duration. To test which type of chart offers the best performance with this system, five different charts are used. The system using different GAs for each market trend and two sets of signals showed positive results, with the 15-minute chart displaying the highest results, achieving an ROI of 11.18% over approximately six months of trading, with a percentage of trades that generated profit of 57.38%, highlighting the ability of the GAs to generate a successful set of trading rules.

Publication details

Authors in the community:

Supervisors of this institution:

Fields of Science and Technology (FOS)

electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering

Publication language (ISO code)

eng - English

Rights type:

Embargoed access

Date available:

09/30/2025

Institution name

Instituto Superior Técnico