IDEAS home Printed from https://ideas.repec.org/p/hal/journl/hal-05063012.html
   My bibliography  Save this paper

Machine Learning for Stock Price Prediction on the Casablanca Stock Exchange: A Comparative Study of ANN and LSTM Approaches

Author

Listed:
  • Imad Talhartit

    (Université Hassan 1er [Settat], Ecole Nationale de Commerce et Gestion - Settat, Laboratory of Finance, Audit and Organizational Governance Research)

  • Sanae Ait Jillali

    (Université Hassan 1er [Settat], Ecole Nationale de Commerce et Gestion - Settat)

  • Mounime El Kabbouri

Abstract

Capital markets play a fundamental role in the economy by facilitating the flow of funds between investors with capital surpluses and those with financing needs. However, these markets' inherent complexity and high volatility-amplified by economic crises and geopolitical events-make decision-making particularly challenging. In this context, artificial intelligence (AI), especially machine learning (ML) and deep learning (DL), has become increasingly relevant for modeling complex financial time series such as stock prices. Among various learning approaches, Long Short-Term Memory (LSTM) networks stand out for their ability to capture long-term dependencies in sequential data. This study compares the predictive performance of LSTM and Artificial Neural Networks (ANN) models, on ten stocks comprising the MADEX index of the Casablanca Stock Exchange, across three forecasting horizons (10, 20, and 30 days). Results demonstrate that the LSTM model consistently outperforms the ANN model in terms of accuracy and trend detection. For instance, over a 30-day horizon, the LSTM correctly predicted 8 out of 10 stocks, compared to only 4 for the ANN. This work is part of a broader research effort aimed at identifying the most effective model for stock price forecasting. Building on the results of this and previous studies, particularly those involving LSTM models optimized using genetic algorithms, future research will explore other models such as Gated Recurrent Units (GRU) and Support Vector Machines (SVM) to further enhance prediction accuracy and robustness.

Suggested Citation

  • Imad Talhartit & Sanae Ait Jillali & Mounime El Kabbouri, 2025. "Machine Learning for Stock Price Prediction on the Casablanca Stock Exchange: A Comparative Study of ANN and LSTM Approaches," Post-Print hal-05063012, HAL.
  • Handle: RePEc:hal:journl:hal-05063012
    DOI: 10.14738/abr.1305.18770
    Note: View the original document on HAL open archive server: https://hal.science/hal-05063012v1
    as

    Download full text from publisher

    File URL: https://hal.science/hal-05063012v1/document
    Download Restriction: no

    File URL: https://libkey.io/10.14738/abr.1305.18770?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:hal:journl:hal-05063012. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: CCSD (email available below). General contact details of provider: https://hal.archives-ouvertes.fr/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.