Searcharxiv⌕ Search

arXiv subjects

Paweł Sakowski

Publications and source records attributed to Paweł Sakowski.

10 recordsLinked to original sources

Generalized Mean Absolute Directional Loss for Machine Learning Trading Models

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.

q-fin.CP↗

Randomized Neural Networks for estimation of exposure profiles and Credit Valuation Adjustment (CVA) for American Equity Options

This paper studies the use of randomized neural networks for the estimation of exposure profiles and unilateral CVA of American options within a Monte Carlo framework. The analysis is carried out separately under both Black-Scholes and Heston dynamics, combining American option valuation, expected exposure and potential future exposure estimation, and unilateral CVA calculation with portfolio netting effects. The numerical experiment compares this approach with the classical Least-Squares Monte Carlo (LSM) used as a benchmark in both low-dimensional single-asset and high-dimensional multi-asset scenarios, and also includes a path convergence test and a sensitivity analysis. The results show that the randomized feedforward neural network approach preserves convergence to the LSM benchmark when it is extended from pricing to exposure and CVA estimation, while its main advantage appears in high-dimensional problems, where it scales more efficiently and leads to lower computational cost. These results support the use of randomized neural networks as a useful alternative for exposure and CVA estimation in high-dimensional American-style options.

q-fin.CP↗

Overreaction as an indicator for momentum in algorithmic trading: A Case of AAPL stocks

This paper investigates whether short-term market overreactions can be systematically predicted and monetized as momentum signals using high-frequency emotional information and modern machine learning methods. Focusing on Apple Inc. (AAPL), we construct a comprehensive intraday dataset that combines volatility normalized returns with transformer-based emotion features extracted from Twitter messages. Overreactions are defined as extreme return realizations relative to contemporaneous volatility and transaction costs and are modeled as a three-class prediction problem. We evaluate the performance of several nonlinear classifiers, including XGBoost, Random Forests, Deep Neural Networks, and Bidirectional LSTMs, across multiple intraday frequencies (1, 5, 10, and 15 minute data). Model outputs are translated into trading strategies and assessed using risk-adjusted performance measures and formal statistical tests. The results show that machine learning models significantly outperform benchmark overreaction rules at ultra short horizons, while classical behavioral momentum effects dominate at intermediate frequencies, particularly around 10 minutes. Explainability analysis based on SHAP reveals that volatility and negative emotions, especially fear and sadness, play a central role in driving predicted overreactions. Overall, the findings demonstrate that emotion-driven overreactions contain a predictable structure that can be exploited by machine learning models, offering new insights into the behavioral origins of intraday momentum and the interaction between sentiment, volatility, and algorithmic trading.

q-fin.TR↗

Application of Deep Reinforcement Learning to At-the-Money S&P 500 Options Hedging

This paper explores the application of deep Q-learning to hedging at-the-money options on the S\&P~500 index. We develop an agent based on the Twin Delayed Deep Deterministic Policy Gradient (TD3) algorithm, trained to simulate hedging decisions without making explicit model assumptions on price dynamics. The agent was trained on historical intraday prices of S\&P~500 call options across years 2004--2024, using a single time series of six predictor variables: option price, underlying asset price, moneyness, time to maturity, realized volatility, and current hedge position. A walk-forward procedure was applied for training, which led to nearly 17~years of out-of-sample evaluation. The performance of the deep reinforcement learning (DRL) agent is benchmarked against the Black--Scholes delta-hedging strategy over the same period. We assess both approaches using metrics such as annualized return, volatility, information ratio, and Sharpe ratio. To test the models' adaptability, we performed simulations across varying market conditions and added constraints such as transaction costs and risk-awareness penalties. Our results show that the DRL agent can outperform traditional hedging methods, particularly in volatile or high-cost environments, highlighting its robustness and flexibility in practical trading contexts. While the agent consistently outperforms delta-hedging, its performance deteriorates when the risk-awareness parameter is higher. We also observed that the longer the time interval used for volatility estimation, the more stable the results.

q-fin.CP↗

Investment Portfolio Optimization Based on Modern Portfolio Theory and Deep Learning Models

This paper investigates an important problem of an appropriate variance-covariance matrix estimation in the Modern Portfolio Theory. We propose a novel framework for variancecovariance matrix estimation for purposes of the portfolio optimization, which is based on deep learning models. We employ the long short-term memory (LSTM) recurrent neural networks (RNN) along with two probabilistic deep learning models: DeepVAR and GPVAR to the task of one-day ahead multivariate forecasting. We then use these forecasts to optimize portfolios of stocks and cryptocurrencies. Our analysis presents results across different combinations of observation windows and rebalancing periods to compare performances of classical and deep learning variance-covariance estimation methods. The conclusions of the study are that although the strategies (portfolios) performance differed significantly between different combinations of parameters, generally the best results in terms of the information ratio and annualized returns are obtained using the LSTM-RNN models. Moreover, longer observation windows translate into better performance of the deep learning models indicating that these methods require longer windows to be able to efficiently capture the long-term dependencies of the variance-covariance matrix structure. Strategies with less frequent rebalancing typically perform better than these with the shortest rebalancing windows across all considered methods.

q-fin.PM↗

Alternative Loss Function in Evaluation of Transformer Models

The proper design and architecture of testing machine learning models, especially in their application to quantitative finance problems, is crucial. The most important aspect of this process is selecting an adequate loss function for training, validation, estimation purposes, and hyperparameter tuning. Therefore, in this research, through empirical experiments on equity and cryptocurrency assets, we apply the Mean Absolute Directional Loss (MADL) function, which is more adequate for optimizing forecast-generating models used in algorithmic investment strategies. The MADL function results are compared between Transformer and LSTM models, and we show that in almost every case, Transformer results are significantly better than those obtained with LSTM.

q-fin.CP↗

Can Artificial Intelligence Trade the Stock Market?

The paper explores the use of Deep Reinforcement Learning (DRL) in stock market trading, focusing on two algorithms: Double Deep Q-Network (DDQN) and Proximal Policy Optimization (PPO) and compares them with Buy and Hold benchmark. It evaluates these algorithms across three currency pairs, the S&P 500 index and Bitcoin, on the daily data in the period of 2019-2023. The results demonstrate DRL's effectiveness in trading and its ability to manage risk by strategically avoiding trades in unfavorable conditions, providing a substantial edge over classical approaches, based on supervised learning in terms of risk-adjusted returns.

q-fin.TR↗

Hedging Properties of Algorithmic Investment Strategies using Long Short-Term Memory and Time Series models for Equity Indices

This paper proposes a novel approach to hedging portfolios of risky assets when financial markets are affected by financial turmoils. We introduce a completely novel approach to diversification activity not on the level of single assets but on the level of ensemble algorithmic investment strategies (AIS) built based on the prices of these assets. We employ four types of diverse theoretical models (LSTM - Long Short-Term Memory, ARIMA-GARCH - Autoregressive Integrated Moving Average - Generalized Autoregressive Conditional Heteroskedasticity, momentum, and contrarian) to generate price forecasts, which are then used to produce investment signals in single and complex AIS. In such a way, we are able to verify the diversification potential of different types of investment strategies consisting of various assets (energy commodities, precious metals, cryptocurrencies, or soft commodities) in hedging ensemble AIS built for equity indices (S&P 500 index). Empirical data used in this study cover the period between 2004 and 2022. Our main conclusion is that LSTM-based strategies outperform the other models and that the best diversifier for the AIS built for the S&P 500 index is the AIS built for Bitcoin. Finally, we test the LSTM model for a higher frequency of data (1 hour). We conclude that it outperforms the results obtained using daily data.

q-fin.PM↗

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. 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, with regard to risk-adjusted return metrics on the out-of-sample data.

q-fin.CP↗

Systemic risk indicator based on implied and realized volatility

We propose a new measure of systemic risk to analyze the impact of the major financial market turmoils in the stock markets from 2000 to 2023 in the USA, Europe, Brazil, and Japan. Our Implied Volatility Realized Volatility Systemic Risk Indicator (IVRVSRI) shows that the reaction of stock markets varies across different geographical locations and the persistence of the shocks depends on the historical volatility and long-term average volatility level in a given market. The methodology applied is based on the logic that the simpler is always better than the more complex if it leads to the same results. Such an approach significantly limits model risk and substantially decreases computational burden. Robustness checks show that IVRVSRI is a precise and valid measure of the current systemic risk in the stock markets. Moreover, it can be used for other types of assets and high-frequency data. The forecasting ability of various SRIs (including CATFIN, CISS, IVRVSRI, SRISK, and Cleveland FED) with regard to weekly returns of S&P 500 index is evaluated based on the simple linear, quasi-quantile, and quantile regressions. We show that IVRVSRI has the strongest predicting power among them.

q-fin.RM↗