Generalized Mean Absolute Directional Loss for Machine Learning Trading Models

Read full text
Authors: Jakub Michańków, Paweł Sakowski, Robert Ślepaczuk
Cited by: 1

Abstract

The article presents and evaluates a custom loss function designed specifically for machine learning models used in algorithmic trading. Regardless of the selected asset class and the level of model complexity, the proposed Generalized Mean Absolute Directional Loss (GMADL) function produces superior results and has better numerical properties during optimization than classic regression and classification based loss functions. Better results correspond to higher risk-weighted returns based on buy and sell signals derived from forecasts generated by models trained using GMADL. In practice, GMADL improves model evaluation by aligning the learning objective with trading performance rather than generic error minimization or simple directional accuracy. Through additional parameterization, GMADL provides a flexible mechanism for adjusting the loss's sensitivity to different return magnitudes, which affects model evaluation consistency across various market regimes. This improves the selection of model configurations that are more consistent with performance-based criteria. Moreover, the implementation uses robust machine learning tools, including frameworks for hyperparameter tuning, architecture testing, and walk-forward optimization, to provide robust and scalable model evaluation across real-world financial data from different asset classes.

Fields of Study & Subjects

Energy Load and Power Forecasting

Publication details

Journal / source
SSRN Electronic Journal
Publisher
Elsevier BV
Publication date
1 January 2026
Language
EN
Document type
Preprint