A Reinforcement Learning Algorithm for Trading Commodities
25 Pages Posted: 21 Feb 2023 Last revised: 27 Nov 2023
Date Written: February 18, 2023
Abstract
We propose a Reinforcement Learning (RL) algorithm for generating a trading strategy in a realistic setting, that includes transaction costs and factors driving the asset dynamics. We benchmark our algorithm against the analytical optimal solution, available when factors are linear and transaction costs are quadratic, showing that RL is able to mimic the optimal strategy. Then we consider a more realistic setting, including non-linear dynamics, that better describes the WTI spot prices time series. For these more general dynamics, an optimal strategy is not known and RL becomes a viable alternative. We show that on synthetic data generated from WTI spot prices, the RL agent outperforms a trader that linearizes the model to apply the theoretical optimal strategy.
Keywords: Portfolio Optimization, Reinforcement Learning, SARSA, Commodities, Threshold Models
Suggested Citation: Suggested Citation