NOTE: This script is for learning purposes only and does not constitute a recommendation for buying or selling any stock mentioned in this script.
SUMMARY: This project aims to construct and test an algorithmic trading model and document the end-to-end steps using a template.
INTRODUCTION: This algorithmic trading model compares a simple mean-reversion strategy with or without using RSI as the exit signal for an individual stock. The model will use a trend window size of ten days for long trades only. When the 14-day RSI value reaches 70, the model will exit the long position. In addition, the model will also generate an exit signal when the holding reaches a 10% loss at the end of the day.
ANALYSIS: In this modeling iteration, we analyzed the stock of AAPL (Apple Inc.) between January 1, 2016, and July 30, 2021. The mean-reversion model without using RSI produced a gain of 26.90% per share, while the model with RSI signals returned a profit of 121.95%. In addition, the buy-and-hold approach yielded an increase of 462.84% per share.
CONCLUSION: For the AAPL stock during the modeling time frame, the long-only trading strategy with or without RSI as the exit signal did not produce a better return than the buy-and-hold approach. We should consider experimenting with more variations of the strategy.
Dataset ML Model: Time series analysis with numerical attributes
Dataset Used: Quandl
The HTML formatted report can be found here on GitHub.