[Paper Review] Sentiment and Knowledge Based Algorithmic Trading with Deep Reinforcement Learning
This paper proposes a deep reinforcement learning (DRL) framework that integrates stock price time series, news headline sentiment, and knowledge graph–extracted implicit relationships to improve algorithmic trading. By combining sentiment scores from news related to a company via knowledge graph traversal with DRL, the agent achieves significantly higher profits and Sharpe ratios—e.g., 2.432 for MSFT—outperforming both random and sentiment-agnostic policies.
Algorithmic trading, due to its inherent nature, is a difficult problem to tackle; there are too many variables involved in the real world which make it almost impossible to have reliable algorithms for automated stock trading. The lack of reliable labelled data that considers physical and physiological factors that dictate the ups and downs of the market, has hindered the supervised learning attempts for dependable predictions. To learn a good policy for trading, we formulate an approach using reinforcement learning which uses traditional time series stock price data and combines it with news headline sentiments, while leveraging knowledge graphs for exploiting news about implicit relationships.
Motivation & Objective
- To address the lack of reliable labeled data in stock market prediction by formulating trading as a reinforcement learning problem.
- To improve trading policy learning by integrating sentiment from news headlines related to a company through knowledge graph traversal.
- To enhance decision-making by exploiting implicit relationships between news events and stocks, beyond explicit mentions.
- To empirically evaluate the impact of sentiment and knowledge graph integration on trading performance using real-world data.
- To demonstrate that combining time series data, sentiment, and relational knowledge leads to superior risk-adjusted returns.
Proposed method
- The agent uses a Deep Q-Network (DQN) to learn optimal buy/sell/hold actions based on a state representation combining stock price trends and sentiment scores.
- News headlines are retrieved via traversal of a knowledge graph centered on the target stock, identifying semantically related entities and events.
- Sentiment analysis is applied to relevant headlines to generate sentiment scores, which are used as input features to the DRL agent.
- The state space includes historical price data (e.g., 5-day and 50-day average opening prices) and sentiment features derived from news.
- A custom reward function is designed to incentivize profit maximization while penalizing excessive risk, with returns evaluated via Sharpe ratio and cumulative profit.
- The knowledge graph is pruned using a distance threshold to limit noise from distant or irrelevant relationships.
Experimental results
Research questions
- RQ1Can integrating sentiment from news headlines improve the performance of a deep reinforcement learning agent in algorithmic trading?
- RQ2Does leveraging implicit relationships via knowledge graphs enhance the agent’s ability to anticipate market movements?
- RQ3How does the inclusion of sentiment and relational knowledge affect risk-adjusted returns compared to baseline DRL models?
- RQ4To what extent does the agent’s performance depend on the quality and relevance of news data extracted through knowledge graphs?
- RQ5Can a DRL agent trained on a combination of time series, sentiment, and relational data outperform models using only price data or only sentiment?
Key findings
- The DRL agent incorporating sentiment and knowledge graph data achieved a Sharpe ratio of 2.432 for Microsoft (MSFT), significantly outperforming the random policy (-2.249) and the sentiment-agnostic policy (-1.357).
- For Amazon (AMZN), the sentiment-enhanced agent achieved a Sharpe ratio of 2.212, indicating strong risk-adjusted performance.
- The agent with sentiment data generated the highest cumulative profit across all tested stocks (MSFT, AMZN, TSLA), demonstrating superior profitability.
- The sentiment-agnostic agent still made profits due to the overall upward trend in MSFT, but its Sharpe ratio of -1.357 revealed poor risk-adjusted decision-making.
- The random policy performed worst in all metrics, with a Sharpe ratio of -2.249 for MSFT, confirming the value of learning-based approaches.
- The results suggest that sentiment and relational knowledge provide meaningful signal beyond price trends, especially in volatile or event-driven markets.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.