TradeR: Practical Deep Hierarchical Reinforcement Learning for Trade Execution

Karush Suri, Xiao Qi Shi, Konstantinos N. Plataniotis, Yuri A. LawryshynarXiv 2021

Abstract

Advances in Reinforcement Learning (RL) span a wide variety of applications which motivate development in this area. While application tasks serve as suitable benchmarks for real world problems, RL is seldomly used in practical scenarios consisting of abrupt dynamics. This allows one to rethink the problem setup in light of practical challenges. We present Trade Execution using Reinforcement Learning (TradeR) which aims to address two such practical challenges of catastrophy and surprise minimization by formulating trading as a real-world hierarchical RL problem. Through this lens, TradeR makes use of hierarchical RL to execute trade bids on high frequency real market experiences comprising of abrupt price variations during the 2019 fiscal year COVID19 stock market crash. The framework utilizes an energy-based scheme in conjunction with surprise value function for estimating and minimizing surprise. In a large-scale study of 35 stock symbols from the S&P500 index, TradeR demonstrates robustness to abrupt price changes and catastrophic losses while maintaining profitable outcomes. We hope that our work serves as a motivating example for application of RL to practical problems.

Introduction

While Reinforcement Learning has mastered video games and board games, it often stumbles in the real world. The authors identify two major hurdles: catastrophe and surprise. Standard RL agents often fail in trading because they haven't seen enough "surprising" data during training to know how to react to sudden market crashes. Most RL trading models focus on maximizing immediate profit (PnL), which often leads to risky, high-frequency selling that backfires when the market turns volatile.

Methods: The TradeR Framework

TradeR introduces two key innovations to bridge the gap between simulation and reality: hierarchical trade execution and energy-based surprise minimization.

Hierarchical Trade Execution

Instead of a single network, TradeR uses a two-level hierarchy:

  • Order Determination (Lower level): A network that observes the market and determines the quantity to be traded.
  • Bid Execution (Higher level): A network that takes that quantity and decides the action: Buy, Sell, or Hold.

Surprise Minimization

To handle market volatility, TradeR incorporates "intrinsic motivation" via a Surprise Value Function based on the "Mellowmax" operator. This function calculates the standard deviation of state transitions. If the market moves in a way that is statistically deviant from training data, the agent receives a penalty. This encourages the agent to steer toward predictable states and avoid catastrophic "surprises."

TradeR System Architecture: The interaction between the Trading Environment and the Agent, highlighting the hierarchical Actor and the Surprise Value Function.

Experimental Setup

The framework was tested on a massive scale using real-world data from the S&P 500 Index. 35 stock symbols were selected, covering the 2019 fiscal year (April 2019 to March 2020). This period includes the high-volatility COVID-19 stock market crash. Price transitions were recorded at 1-minute intervals, providing a high-frequency environment.

Results and Key Insights

TradeR demonstrated improved performance on 21 out of 35 symbols compared to strong baselines like PPO, DDPG, and TD3.

Robustness and Strategy

  • The Power of "Hold": Including a "Hold" action proved vital for stabilizing risk.
  • Balance vs. PnL: Using the agent's total Account Balance as a reward signal worked better than per-step PnL, as it encourages holistic decision-making.
  • "Buy More, Sell Less": Under the surprise-minimization scheme, TradeR naturally evolved a "safer" strategy. While baseline agents often panicked and sold off assets during the crash, TradeR learned to minimize the number of shares sold, holding onto assets for long-term recovery.
Performance Comparison: TradeR maintains competitive returns while significantly reducing the number of shares sold compared to baselines like PPO and TD3.

Conclusion

TradeR addresses the challenges of catastrophe and surprise in financial markets through hierarchical RL and intrinsic motivation. While it requires significant historical data and currently treats the market as a static environment, it demonstrates a path toward more robust RL applications in real-world scenarios with abrupt dynamics. Future work will explore multi-agent settings to better model competitive market dynamics.

Summary updated

BibTeX
@misc{suri2021trader,
  author = {Karush Suri and Xiao Qi Shi and Konstantinos N. Plataniotis and Yuri A. Lawryshyn},
  title = {{TradeR: Practical Deep Hierarchical Reinforcement Learning for Trade Execution}},
  year = {2021},
  eprint = {2104.00620},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.00620},
}
Figure