Mean absolute directional loss as a new loss function for machine learning problems in algorithmic investment strategies

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. MADL places appropriate emphasis not only on the quality of the point forecast but also on its impact on the rate of achievement by the investment system based on it. The introduction and detailed description of the theoretical properties of this new MADL loss function are our main contributions to the literature. In the empirical part of the study, based on the data from two different asset classes (cryptocurrencies: Bitcoin and commodities: Crude Oil), we show that our new loss function enables us to select better hyperparameters for the LSTM model and obtain more efficient investment strategies, with regard to risk-adjusted return metrics on the out-of-sample data.

Authors: Jakub Michańków, Paweł Sakowski, Robert Ślepaczuk

Publication Date: 1 September 2024

Journal: Journal of Computational Science

DOI: 10.1016/j.jocs.2024.102375

Link: View Publication

Keywords: Machine learningRecurrent neural networksLong short-term memoryAlgorithmic investment strategiesTesting architectureLoss functionWalk-forward optimizationOver-optimization