Sentiment Moving Average
Technical Analysis is the process of using charts and indicators based on the price and volume to predict the future movements of financial assets.
Technical Analysis bears similarities with Sentiment Analysis as Technical Indicators can be used to guess the opinions of other investors through their actions. For example, a large volume with increasing price could signify that the investors are largely positive and bullish about the asset.
As such, Technical Indicators is a proxy for Sentiment Analysis.
This report will aim to show that incorporating Sentiment Analysis with Technical Analysis will improve the performance of a simple trading strategy.
Strategies to be Compared
The following 2 strategies will be used in this report:
If (5-day SMA > 10-day SMA)
If (5-day SMA > 10-day SMA)
If (2-day Average Sentiment > A1)
Else if (2-day Average Sentiment < A2)
If (2-day Average Sentiment < B1)
Else if (2-day Average Sentiment > B2)
The basis of both strategies is when the short term (price) moving average is above the long term (price) moving average, the asset price is in an upward path. Hence, we want to follow the trend and long the asset. Conversely, we want to short the asset in the other case.
The difference between the strategies is that B has additional entry and exit conditions if the sentiment moving average data does not agree with the (price) moving average condition.
It is obvious that Strategy A will always have open positions whereas Strategy B will occasionally have no positions, instead holding cash until another opportunity arises.
Sentiment data from the FinSentS API will be used for the comparison of the 2 strategies. A1, A2, B1, B2 are selected to be 5, 4, 6, 7 respectively for Strategy B.
For the asset, Apple Inc. (AAPL) is used.
When either Strategy enters a position, the position size will be equal to 90% of the portfolio’s value. This is to simulate the leaving of some cash holdings to prevent for margin calls.
The backtest is carried out on the Quantopian Platform over the period 1/1/2016 – 11/5/2017.
**Both strategies outperformed the S&P500 index.
** More details and Source code on Quantopian
It is clear from the results that Strategy B is the superior strategy, with larger return, lower drawdown and lesser volatility.
In short, incorporating Sentiment Analysis with Technical Analysis will improve the performance of a simple trading strategy.
More about the Data
The data used in this report is powered by FinSentS published by InfoTrie Financial Solutions.
The FinSentS News Sentiment database offers daily media sentiment indicators for 23,000+ global equities, calculated by applying sophisticated real-time machine-learning algorithms to the content of thousands of news websites and media sources from around the world.
Each stock has 5 indicators:
- Sentiment Score: a numeric measure of the bullishness / bearishness of news coverage of the stock.
- Sentiment High / Low: highest and lowest intra-day sentiment scores.
- News Volume: the absolute number of news articles covering the stock.
- News Buzz: a numeric measure of the change in coverage volume for the stock.