Cargando…
An LSTM and GRU based trading strategy adapted to the Moroccan market
Forecasting stock prices is an extremely challenging job considering the high volatility and the number of variables that influence it (political, economical, social, etc.). Predicting the closing price provides useful information and helps the investor make the right decision. The use of deep learn...
Autores principales: | , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
Springer International Publishing
2021
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8475304/ https://www.ncbi.nlm.nih.gov/pubmed/34603936 http://dx.doi.org/10.1186/s40537-021-00512-z |
_version_ | 1784575402082041856 |
---|---|
author | Touzani, Yassine Douzi, Khadija |
author_facet | Touzani, Yassine Douzi, Khadija |
author_sort | Touzani, Yassine |
collection | PubMed |
description | Forecasting stock prices is an extremely challenging job considering the high volatility and the number of variables that influence it (political, economical, social, etc.). Predicting the closing price provides useful information and helps the investor make the right decision. The use of deep learning and more precisely of recurrent neural networks (RNNs) in stock market forecasting is an increasingly common practice in the literature. Long Short Term Memory (LSTM) and Gated Recurrent Unit (GRU) architectures are among the most widely used types of RNNs, given their suitability for sequential data. In this paper, we propose a trading strategy designed for the Moroccan stock market, based on two deep learning models: LSTM and GRU to predict the closing price in the short and medium term respectively. Decision rules for buying and selling stocks are implemented based on the forecasting given by the two models, then over four 3-year periods, we simulate transactions using these decision rules with different settings for each stock. The returns obtained will be used to estimate an expected return. We only hold stocks that outperform a benchmark index (expected return > threshold). The random search is then used to choose one of the available parameters and the performance of the portfolio built from the selected stocks will be tested over a further period. The repetition of this process with a variation of portfolio size makes it possible to select the best possible combination of stock each with the optimized parameter for the decision rules. The proposed strategy produces very promising results and outperforms the performance of indices used as benchmarks in the local market. Indeed, the annualized return of our strategy proposed during the test period is 27.13%, while it is 0.43% for Moroccan all share Indice (MASI), 15.24% for the distributor sector indices, and 19.94% for the pharmaceutical industry indices. Noted that brokerage fees are estimated and subtracted for each transaction. which makes the performance found even more realistic. |
format | Online Article Text |
id | pubmed-8475304 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2021 |
publisher | Springer International Publishing |
record_format | MEDLINE/PubMed |
spelling | pubmed-84753042021-09-28 An LSTM and GRU based trading strategy adapted to the Moroccan market Touzani, Yassine Douzi, Khadija J Big Data Research Forecasting stock prices is an extremely challenging job considering the high volatility and the number of variables that influence it (political, economical, social, etc.). Predicting the closing price provides useful information and helps the investor make the right decision. The use of deep learning and more precisely of recurrent neural networks (RNNs) in stock market forecasting is an increasingly common practice in the literature. Long Short Term Memory (LSTM) and Gated Recurrent Unit (GRU) architectures are among the most widely used types of RNNs, given their suitability for sequential data. In this paper, we propose a trading strategy designed for the Moroccan stock market, based on two deep learning models: LSTM and GRU to predict the closing price in the short and medium term respectively. Decision rules for buying and selling stocks are implemented based on the forecasting given by the two models, then over four 3-year periods, we simulate transactions using these decision rules with different settings for each stock. The returns obtained will be used to estimate an expected return. We only hold stocks that outperform a benchmark index (expected return > threshold). The random search is then used to choose one of the available parameters and the performance of the portfolio built from the selected stocks will be tested over a further period. The repetition of this process with a variation of portfolio size makes it possible to select the best possible combination of stock each with the optimized parameter for the decision rules. The proposed strategy produces very promising results and outperforms the performance of indices used as benchmarks in the local market. Indeed, the annualized return of our strategy proposed during the test period is 27.13%, while it is 0.43% for Moroccan all share Indice (MASI), 15.24% for the distributor sector indices, and 19.94% for the pharmaceutical industry indices. Noted that brokerage fees are estimated and subtracted for each transaction. which makes the performance found even more realistic. Springer International Publishing 2021-09-24 2021 /pmc/articles/PMC8475304/ /pubmed/34603936 http://dx.doi.org/10.1186/s40537-021-00512-z Text en © The Author(s) 2021 https://creativecommons.org/licenses/by/4.0/Open AccessThis article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ (https://creativecommons.org/licenses/by/4.0/) . |
spellingShingle | Research Touzani, Yassine Douzi, Khadija An LSTM and GRU based trading strategy adapted to the Moroccan market |
title | An LSTM and GRU based trading strategy adapted to the Moroccan market |
title_full | An LSTM and GRU based trading strategy adapted to the Moroccan market |
title_fullStr | An LSTM and GRU based trading strategy adapted to the Moroccan market |
title_full_unstemmed | An LSTM and GRU based trading strategy adapted to the Moroccan market |
title_short | An LSTM and GRU based trading strategy adapted to the Moroccan market |
title_sort | lstm and gru based trading strategy adapted to the moroccan market |
topic | Research |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8475304/ https://www.ncbi.nlm.nih.gov/pubmed/34603936 http://dx.doi.org/10.1186/s40537-021-00512-z |
work_keys_str_mv | AT touzaniyassine anlstmandgrubasedtradingstrategyadaptedtothemoroccanmarket AT douzikhadija anlstmandgrubasedtradingstrategyadaptedtothemoroccanmarket AT touzaniyassine lstmandgrubasedtradingstrategyadaptedtothemoroccanmarket AT douzikhadija lstmandgrubasedtradingstrategyadaptedtothemoroccanmarket |