Using Reinforcement Learning in the Algorithmic Trading Problem

Evgeny Ponomarev, Ivan V. Oseledets, Andrzej CichockiarXiv 2020

Introduction

Algorithmic trading represents a complex "delayed reward" environment where actions taken at a specific timestamp may only yield measurable results much later. Unlike supervised learning, where every data point has a clear "correct" label, trading requires a control system capable of maximizing long-term portfolio value amidst high noise and volatility. This paper explores the application of the Asynchronous Advantage Actor-Critic (A3C) reinforcement learning algorithm to high-frequency trading of RTS Index futures (MOEX:RTSI).

Methodology

The core of the proposed system is the A3C algorithm, which utilizes multiple parallel "worker" agents to interact with independent environments. This parallelism stabilizes learning and accelerates convergence by decorrelating the agents' experiences. Updates are sent to a global "master" network, creating a robust training loop.

Neural Network Architecture

To address the non-Markovian nature of financial markets, the researchers integrated several specific architectural components:

  1. Actor-Critic Framework: The network is split into an "Actor" that outputs action probabilities (Long, Neutral, Short) and a "Critic" that estimates the value ($V$) of the current state.
  2. Recurrent Layers (LSTM): Long Short-Term Memory layers allow the model to maintain a temporal context, capturing historical price patterns rather than relying solely on instantaneous snapshots.
  3. Regularization via Dropout: Given the high signal-to-noise ratio in market data, Dropout layers were implemented to prevent overfitting and encourage the learning of generalized features.
Neural network architecture with LSTM and Dropout layers.

Reward Function Engineering

A significant hurdle in RL for trading is the "buy-and-hold trap," where agents learn that doing nothing is safer than active trading. To counter this, the authors introduced penalties for prolonged inactivity and artificially inflated transaction commissions during the training phase. This forced the agent to identify high-conviction trading opportunities that could overcome realistic market costs.

Experimental Setup

The model was trained and validated using real-world bid data from the RTS Index futures:

  • Training Period: Sept 15, 2015 – Dec 15, 2015 (~50,000 one-minute intervals).
  • Testing Period: Dec 15, 2015 – June 15, 2016 (out-of-sample validation).

Key Results

The optimized A3C architecture demonstrated significant profitability and robustness. The best-performing model achieved an annual profit of 110.5% before commissions and 66.5% after commissions.

Equity curves from backtesting on training and out-of-sample data.

Key performance metrics include:

  • Sharpe Ratio: 3.2, indicating exceptional risk-adjusted returns.
  • Win Rate: A transaction win rate of approximately 54%.
  • Commission Impact: The study highlighted that simpler models, while appearing profitable in a zero-cost simulation, often resulted in catastrophic losses (up to -143.7%) when realistic commissions were applied. This underscores the necessity of incorporating transaction costs directly into the RL reward signal.

Discussion and Conclusion

The integration of LSTM layers and Dropout proved critical for navigating the noisy, time-dependent environment of the stock exchange. While the results are promising, limitations remain, such as the computational intensity of training and the lack of market impact (slippage) modeling in the current simulation. Future work will focus on testing more advanced RL algorithms within this established "sandbox" and refining the reward functions to better capture the nuances of market dynamics.

Summary updated

BibTeX
@misc{ponomarev2020using,
  author = {Evgeny Ponomarev and Ivan V. Oseledets and Andrzej Cichocki},
  title = {{Using Reinforcement Learning in the Algorithmic Trading Problem}},
  year = {2020},
  eprint = {2002.11523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.11523},
}
Figure