A Deep Deterministic Policy Gradient-based Strategy for Stocks Portfolio Management

Huanming Zhang, Zhengyong Jiang, Jionglong Su · DOI

Abstract

With the improvement of computer performance and the development of GPU-accelerated technology, trading with machine learning algorithms has attracted the attention of many researchers and practitioners. In this research, we propose a novel portfolio management strategy based on the framework of Deep Deterministic Policy Gradient (DDPG), a policy-based reinforcement learning framework, and compare its performance to that of other trading strategies. In our framework, two Long Short-Term Memory (LSTM) neural networks and two fully connected neural networks are constructed. We also investigate the performance of our strategy with and without transaction costs. Experimentally, we choose eight US stocks consisting of four low-volatility stocks and four high-volatility stocks. In our case, the compound annual return rate is 14.12%, outperforming all other strategies. Furthermore, in terms of Sharpe Ratio (0.5988), our strategy is nearly 33% higher than that of the second-best performing strategy.

Introduction

Portfolio management—the art of allocating wealth across various assets—is notoriously difficult because financial markets are non-stationary and often follow the "efficient market hypothesis," making price prediction via standard supervised learning nearly impossible. While Reinforcement Learning (RL) has shown promise because it focuses on actions rather than just predictions, many existing models suffer from two primary flaws: discretization of action spaces and idealized assumptions that ignore transaction costs or short timeframes.

Methodology

The authors employ a Deep Deterministic Policy Gradient (DDPG) approach. DDPG is an "Actor-Critic" framework where the Actor decides how to allocate the portfolio, and the Critic evaluates the quality of that decision based on the resulting reward from the environment.

The Actor-Critic framework used in the DDPG strategy.

Novel Architecture

Unlike previous DDPG models that used Convolutional Neural Networks (CNNs), this research utilizes Long Short-Term Memory (LSTM) networks for the Critic. LSTMs are specifically designed to remember patterns in time-series data, making them ideal for stock history. The Actor uses a Fully Connected (FC) network to output a continuous vector of portfolio weights. This allows the agent to operate in a continuous action space, fine-tuning allocations (e.g., 12.5% vs 12.6%) in a way that discrete Q-learning models cannot.

Training and Exploration

To prevent the model from converging on sub-optimal local solutions, the authors implement Ornstein-Uhlenbeck (OU) noise for action exploration. Unlike standard Gaussian noise, OU noise is autocorrelated, which better mimics the "momentum" found in financial markets. The complete training process is detailed in the DDPG algorithm below:

The Deep Deterministic Policy Gradient (DDPG) algorithm pseudocode.

Experimental Setup and Datasets

The study uses historical data from Yahoo Finance for eight US stocks, categorized by volatility:

  • High Volatility: APA, LNC, RCL, FCX.
  • Low Volatility: GOLD, FDP, NEM, BMY.

The timeframe spans from July 1999 to July 2020, allowing the model to be tested against major market shocks, including the 2008 financial crisis and the 2020 COVID-19 market crash. Crucially, the model incorporates a transaction cost of $0.001 per share to provide a realistic simulation.

Key Results and Insights

The DDPG strategy was compared against seven traditional strategies, including Anticor, Exponential Gradient (EG), and Uniform Buy and Hold (BAH).

  • Profitability: The DDPG strategy achieved a Compound Annual Return Rate (CARR) of 14.12%, nearly double the second-best strategy (Anticor at 7.94%).
  • Risk-Adjusted Return: It achieved a Sharpe Ratio of 0.5988, roughly 33% higher than the next best performer.
  • Stability: The Maximum Drawdown (MDD) was 49.13%. While high, it was the lowest among all tested strategies, proving superior risk resistance during market crashes.

Interestingly, the model performed better and was more robust when transaction costs were included. The authors suggest that transaction costs act as a "penalty term" in the reward function, encouraging the agent to be more cautious and trade only when expected gains significantly outweigh costs.

Conclusion

This research demonstrates that a DDPG-based strategy using LSTM networks can effectively manage stock portfolios in continuous action spaces. By outperforming traditional benchmarks in both returns and risk-adjusted metrics, the model proves the viability of deep reinforcement learning in complex financial environments. Future work will focus on accounting for market slippage and expanding the action space to include short-selling transactions.

Summary updated

BibTeX
@misc{zhang2021deep,
  author = {Huanming Zhang and Zhengyong Jiang and Jionglong Su},
  title = {{A Deep Deterministic Policy Gradient-based Strategy for Stocks Portfolio Management}},
  year = {2021},
  eprint = {2103.11455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.11455},
}
Figure