Mean Absolute Directional Loss as a New Loss Function for Machine Learning Problems in Algorithmic Investment Strategies
Mean Absolute Directional Loss as a New Loss Function for Machine Learning Problems in Algorithmic Investment Strategies
This paper introduces the Mean Absolute Directional Loss (MADL) function, a novel loss metric designed for optimizing machine learning models in algorithmic investment strategies (AIS). Unlike classical loss functions such as MAE or RMSE, which penalize forecast errors regardless of direction, MADL directly measures the profit or loss from a trading signal by comparing the sign and magnitude of predicted returns against realized returns. The function is defined as the average of the negative product of the sign of the product of realized and predicted returns and the absolute realized return, making it directly aligned with the goal of maximizing trading profits. The authors argue that this alignment leads to better hyperparameter selection and model estimation for AIS.
The empirical validation uses an LSTM model with a walk-forward testing procedure on daily simple returns of Bitcoin and Crude Oil (USO ETF) from 2013 to 2021. Four combinations of loss functions for hyperparameter tuning and model estimation are compared: MADL/MADL, MADL/MAE, MAE/MAE, and MAE/MADL. Results consistently show that the MADL/MADL approach outperforms all other combinations across multiple risk-adjusted performance metrics (IR*, IR**, IR***) for both assets. For Bitcoin, MADL/MADL achieves an annualized return of 109.94% with a maximum drawdown of 75.04%, while for Crude Oil it yields a positive return of 5.25% compared to a -10.59% loss for Buy & Hold. Regression tests confirm a significant positive alpha for the MADL/MADL strategy on Bitcoin. The paper concludes that MADL is a more appropriate loss function for AIS and suggests future extensions such as squared penalization to address large losses.
Highlights
- 1Proposes a novel loss function, Mean Absolute Directional Loss (MADL), specifically designed for algorithmic investment strategies (AIS).
- 2Demonstrates that MADL outperforms classical loss functions (e.g., MAE) in hyperparameter tuning and out-of-sample performance.
- 3Validates the approach on two distinct asset classes: cryptocurrencies (Bitcoin) and commodities (Crude Oil).
- 4Provides a rigorous testing architecture including walk-forward optimization and multiple performance metrics.
- 5Shows that using MADL for both hyperparameter tuning and model estimation yields the best risk-adjusted returns.
Methods
- MMean Absolute Directional Loss (MADL) function: penalizes forecasts based on directional accuracy and magnitude of realized returns.
- MLong Short-Term Memory (LSTM) neural network with walk-forward optimization.
- MHyperparameter tuning using MADL vs. MAE loss functions.
- MPerformance evaluation using risk-adjusted metrics (IR*, IR**, IR***) and regression tests for alpha significance.
Results
- RMADL/MADL strategy achieves the highest risk-adjusted returns (IR*, IR**, IR***) for both Bitcoin and Crude Oil.
- RFor Bitcoin, MADL/MADL yields an annualized return of 109.94% with a maximum drawdown of 75.04%, outperforming Buy & Hold and other combinations.
- RFor Crude Oil, MADL/MADL produces a positive annualized return (5.25%) while Buy & Hold yields -10.59%.
- RRegression analysis shows a positive and significant alpha for MADL/MADL on Bitcoin, indicating superior risk-adjusted performance.
- RMADL/MADL leads to more frequent trading (306 trades for BTC, 731 for USO) compared to MADL/MAE, suggesting better signal extraction.
Analyze Paper
Generate insights from "Mean Absolute Directional Loss as a New Loss Function for Ma...".