IDEAS home Printed from https://ideas.repec.org/p/war/wpaper/2023-23.html
   My bibliography  Save this paper

Mean Absolute Directional Loss as a New Loss Function for Machine Learning Problems in Algorithmic Investment Strategies

Author

Listed:
  • Jakub Michańków

    (Cracow University of Economics, Department of Informatics; University of Warsaw, Faculty of Economic Sciences, Quantitative Finance Research Group, Department of Quantitative Finance)

  • Paweł Sakowski

    (University of Warsaw, Faculty of Economic Sciences, Quantitative Finance Research Group, Department of Quantitative Finance)

  • Robert Ślepaczuk

    (University of Warsaw, Faculty of Economic Sciences, Quantitative Finance Research Group, Department of Quantitative Finance)

Abstract

This paper investigates the issue of an adequate loss function in the optimization of machine learning models used in the forecasting of financial time series for the purpose of algorithmic investment strategies (AIS) construction. We propose the Mean Absolute Directional Loss (MADL) function, solving important problems of classical forecast error functions in extracting information from forecasts to create efficient buy/sell signals in algorithmic investment strategies. Finally, based on the data from two different asset classes (cryptocurrencies: Bitcoin and commodities: Crude Oil), we show that the new loss function enables us to select better hyperparameters for the LSTM model and obtain more efficient investment strategies, regarding risk-adjusted return metrics on the out-of-sample data.

Suggested Citation

  • Jakub Michańków & Paweł Sakowski & Robert Ślepaczuk, 2023. "Mean Absolute Directional Loss as a New Loss Function for Machine Learning Problems in Algorithmic Investment Strategies," Working Papers 2023-23, Faculty of Economic Sciences, University of Warsaw.
  • Handle: RePEc:war:wpaper:2023-23
    as

    Download full text from publisher

    File URL: https://www.wne.uw.edu.pl/download_file/3237/0
    File Function: First version, 2023
    Download Restriction: no
    ---><---

    Other versions of this item:

    References listed on IDEAS

    as
    1. Topcu, Mert & Gulal, Omer Serkan, 2020. "The impact of COVID-19 on emerging stock markets," Finance Research Letters, Elsevier, vol. 36(C).
    2. Caporale, Guglielmo Maria & Plastun, Alex, 2019. "The day of the week effect in the cryptocurrency market," Finance Research Letters, Elsevier, vol. 31(C).
    3. Grobys, Klaus & Ahmed, Shaker & Sapkota, Niranjan, 2020. "Technical trading rules in the cryptocurrency market," Finance Research Letters, Elsevier, vol. 32(C).
    4. Junming Yang & Yaoqi Li & Xuanyu Chen & Jiahang Cao & Kangkang Jiang, 2019. "Deep Learning for Stock Selection Based on High Frequency Price-Volume Data," Papers 1911.02502, arXiv.org.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Fan Fang & Carmine Ventre & Michail Basios & Leslie Kanthan & David Martinez-Rego & Fan Wu & Lingbo Li, 2022. "Cryptocurrency trading: a comprehensive survey," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 8(1), pages 1-59, December.
    2. Grobys, Klaus & Junttila, Juha, 2021. "Speculation and lottery-like demand in cryptocurrency markets," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 71(C).
    3. ?ikolaos A. Kyriazis, 2021. "Impacts of Stock Indices, Oil, and Twitter Sentiment on Major Cryptocurrencies during the COVID-19 First Wave," Bulletin of Applied Economics, Risk Market Journals, vol. 8(2), pages 133-146.
    4. Brada, Josef C. & Gajewski, Paweł & Kutan, Ali M., 2021. "Economic resiliency and recovery, lessons from the financial crisis for the COVID-19 pandemic: A regional perspective from Central and Eastern Europe," International Review of Financial Analysis, Elsevier, vol. 74(C).
    5. Mahata, Ajit & Rai, Anish & Nurujjaman, Md. & Prakash, Om, 2021. "Modeling and analysis of the effect of COVID-19 on the stock price: V and L-shape recovery," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 574(C).
    6. Prelorentzos, Arsenios-Georgios N. & Konstantakis, Konstantinos N. & Michaelides, Panayotis G. & Xidonas, Panos & Goutte, Stephane & Thomakos, Dimitrios D., 2024. "Introducing the GVAR-GARCH model: Evidence from financial markets," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 91(C).
    7. Alla A. Petukhina & Raphael C. G. Reule & Wolfgang Karl Härdle, 2021. "Rise of the machines? Intraday high-frequency trading patterns of cryptocurrencies," The European Journal of Finance, Taylor & Francis Journals, vol. 27(1-2), pages 8-30, January.
    8. Ștefan Cristian Gherghina & Daniel Ștefan Armeanu & Camelia Cătălina Joldeș, 2020. "Stock Market Reactions to COVID-19 Pandemic Outbreak: Quantitative Evidence from ARDL Bounds Tests and Granger Causality Analysis," IJERPH, MDPI, vol. 17(18), pages 1-35, September.
    9. Xie, Yutang & Cao, Yujia & Li, Xiaotao, 2023. "The importance of trade policy uncertainty to energy consumption in a changing world," Finance Research Letters, Elsevier, vol. 52(C).
    10. Jialei Jiang & Eun-Mi Park & Seong-Taek Park, 2021. "The Impact of the COVID-19 on Economic Sustainability—A Case Study of Fluctuation in Stock Prices for China and South Korea," Sustainability, MDPI, vol. 13(12), pages 1-17, June.
    11. Carmen López-Martín & Sonia Benito Muela & Raquel Arguedas, 2021. "Efficiency in cryptocurrency markets: new evidence," Eurasian Economic Review, Springer;Eurasia Business and Economics Society, vol. 11(3), pages 403-431, September.
    12. Viktor Manahov, 2024. "The rapid growth of cryptocurrencies: How profitable is trading in digital money?," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 29(2), pages 2214-2229, April.
    13. Katarzyna Czech & Michał Wielechowski & Pavel Kotyza & Irena Benešová & Adriana Laputková, 2020. "Shaking Stability: COVID-19 Impact on the Visegrad Group Countries’ Financial Markets," Sustainability, MDPI, vol. 12(15), pages 1-19, August.
    14. Böyükaslan, Adem & Ecer, Fatih, 2021. "Determination of drivers for investing in cryptocurrencies through a fuzzy full consistency method-Bonferroni (FUCOM-F’B) framework," Technology in Society, Elsevier, vol. 67(C).
    15. Muhammad Sheraz & Imran Nasir, 2021. "Information-Theoretic Measures and Modeling Stock Market Volatility: A Comparative Approach," Risks, MDPI, vol. 9(5), pages 1-20, May.
    16. Hui Hong & Zhicun Bian & Chien-Chiang Lee, 2021. "COVID-19 and instability of stock market performance: evidence from the U.S," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 7(1), pages 1-18, December.
    17. Stefanescu Razvan & Dumitriu Ramona, 2021. "The Extended Holiday Effects on Bucharest Stock Exchange during Coronavirus Pandemic," Risk in Contemporary Economy, "Dunarea de Jos" University of Galati, Faculty of Economics and Business Administration, pages 293-303.
    18. Sanjay Kumar Rout & Hrushikesh Mallick, 2022. "Sovereign Bond Market Shock Spillover Over Different Maturities: A Journey from Normal to Covid-19 Period," Asia-Pacific Financial Markets, Springer;Japanese Association of Financial Economics and Engineering, vol. 29(4), pages 697-734, December.
    19. Burcu Berke & Gülsüm Akarsu, 2024. "Volatility spillovers from COVID-19 to stocks, exchange rates and oil prices: evidence from Turkiye," Economics Bulletin, AccessEcon, vol. 44(3), pages 1254-1262.
    20. Abakah, Emmanuel Joel Aikins & Gil-Alana, Luis Alberiko & Madigu, Godfrey & Romero-Rojo, Fatima, 2020. "Volatility persistence in cryptocurrency markets under structural breaks," International Review of Economics & Finance, Elsevier, vol. 69(C), pages 680-691.

    More about this item

    Keywords

    machine learning; recurrent neural networks; long short-term memory; algorithmic investment strategies; testing architecture; loss function; walk-forward optimization; over-optimization;
    All these keywords.

    JEL classification:

    • C4 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics
    • C14 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Semiparametric and Nonparametric Methods: General
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • C58 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Financial Econometrics
    • G13 - Financial Economics - - General Financial Markets - - - Contingent Pricing; Futures Pricing

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    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:war:wpaper:2023-23. 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.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with 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: Marcin Bąba (email available below). General contact details of provider: https://edirc.repec.org/data/fesuwpl.html .

    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.