Algorithmic Trading Model using Force Index with Stop Loss

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 uses force index indicators to employ a simple mean-reversion strategy for stock position entries and exits. For the Force Index indicator, the model will use a 13-period indicator for the trading signal. The model will initiate a long position when the trading indicator turns from negative to positive. Conversely, the model will exit the long position when the signal indicator turns from positive to negative.

Moreover, one of the two models will exit the long position when a 10-percent stop-loss triggers. We will evaluate the effectiveness of using a stop-loss trigger by comparing the portfolio results to the model without the stop-loss trigger.

ANALYSIS: In this modeling iteration, we analyzed ten stocks for ten years between September 1, 2011, and September 24, 2021. The models’ performance appeared at the end of the script. The models with the wider signal line width generally produced a better return for the tested stocks. Moreover, the simple buy-and-hold approach came out ahead for all stocks.

CONCLUSION: For most stocks during the modeling time frame, the long-only trading strategy with the Force Index did not produce a better return than the buy-and-hold approach. We should consider modeling these stocks further by 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.