Based on the sentiment trading algorithm I posted in my last article I would like to display the adjustments that I made on this strategy and the live trading result of this strategy.
The graph below shows the backtesting result of the algo that I modified based on the original post. This time, I take the potential influence of the earning surprises (one of the most common financial events which occur when a company’s reported earnings above or below analyst’s expectations)into account. Though I did not quantify the influence into the algorithm yet( I will show you the example of how to take advantage of earnings drift in my article in the future), I have simply added the filter to my strategy to narrow down the securities whose companies are about to report the earning announcement soon or who just published their earning announcements in order to mitigate the potential risk and volatility of my strategy.
You can compare the result above with the original backtesting result without accounting for the earning announcement below which has the same backtesting time frame and the same leverage.(basically, everything else of the new algo is the same as the old one except the filter that I just introduced)
From the two outputs above you can tell that our total returns increase by 2.19% after modification. The Sharpe Ratio increases by .04 and MaxDD decreases by 0.3% in turn. Of course, the differences are sort of imperceptible and this is just one experiment which may not be representative and statistically sound enough.
Theoretically, we may avoid uncertainties coming from looming earnings announcements to some extent. However, we may also lose the arbitrage opportunity related to positive earning announcements at the same time. Therefore, the effect could be either side. The sure thing here is that we can partially decrease the volatility(no matter the earning surprises may bring the stock prices up or down). Hopefully, we can also reduce the drawdown and increase Sharpe Ratio.
Here is the piece of code that I added to the algo compared to the former version. I added two more variables into my pipeline (may not be necessary if you just use them as the filter) and filtered down the securities if their earning calendar shows that their companies are about to release earning announcement within 2 days or they have released their earning announcement within last 2 days. If you are very interested in the usage of earning calendar, feel free to check here.
My backtesting period is from 2012/09/01–2016/1/27. I also print out the stock that included in my portfolio and the corresponding days away from both ‘next earning announcement’ date or ‘last earning announcement’ date.
The following two graphs are the performance of this strategy after the start of live trading on 1/25/2016. The picture was taken in this morning (the algo has been running for 3 days continuously). The overall live trading performance of this strategy is generally stable(you can check the second graph which is about its volatility) and positive throughout these days.
Here I will also introduce the part of the earning calendar information that I used in my algorithm. The screenshots below may provide you more details:
- The first picture is the filtered information which only keeps the ‘symbol’, ‘event_headline’(a brief description of the event),’calendar_time’(earnings release time: before/after market hours, or other) and ‘calendar_date’(proposed earnings reporting date).
- The second picture shows the event information of a certain company. Here I will still use AA(Alcoa Inc) as an example.
I will update more algorithms and show you the one which exploit the earning surprise quantitatively in the near future. Hope you enjoy the content. Feel free to leave your ideas or comments here. Thank you!
Reference:
- http://www.investopedia.com/terms/e/earningssurprise.asp
- https://www.quantopian.com/posts/reduce-volatility-and-increase-sharpe-by-accounting-for-earnings-announcements
- http://finance.yahoo.com/q?s=AA
- https://www.quantopian.com/research/notebooks/Cloned%20from%20%22EventVestor%20Earnings%20Calendar%20Data%22%203.ipynb
- http://www.investopedia.com/ask/answers/04/041504.asp