# Algorithmic Trading Model for “Buy Low Sell High” Using Python Take 4

SUMMARY: The purpose of this project is to construct an algorithmic trading model and document the end-to-end steps using a template.

INTRODUCTION: This algorithmic trading model uses daily close prices to generate trading signals. If the stock closes lower for the day, we will purchase at the opening of the next trading day if we did not have the stock on-hand. If the stock closes higher for the day, we will sell the stock at the opening of the next day if we have the stock on-hand. We will take no action if we encounter the trading signal to sell but have no stock on-hand or the trading signal to buy if we already have the stock on-hand.

We apply the analysis on a stock for a fixed period and compare its return/loss to a simple long-only model. The long-only model will purchase the stock at the opening of day one and hold the stock through the entire time.

In iteration Take1, we constructed and tested the trading model for the stock “GOOG” during the year of 2019.

In iteration Take2, we constructed and tested the trading model for the stock “GOOG” during the year of 2018.

In iteration Take3, we modified the strategy by imposing a “waiting window” and tested the trading model for the stock “GOOG” during the year of 2019. The waiting window enforced one day of no action right after we buy or sell. We also observed whether the waiting window can improve our results over the previous strategy.

In this Take4 iteration, we will apply the modified strategy for the year of 2018. We will observe whether the waiting window can improve our results over the previous strategy.

ANALYSIS: In iteration Take1 and during 2019, the “Buy Low Sell High” strategy returned 12.38%. In the meantime, the long-only approach achieved an accumulated return of 15.98%.

In iteration Take2 and during 2018, the “Buy Low Sell High” strategy returned -4.57%. In the meantime, the long-only approach achieved an accumulated return of -0.56%. The long-only method turned out to be a better choice again.

In iteration Take3 and during 2019, the “Buy Low Sell High” strategy returned 13.54%. In the meantime, the long-only approach achieved an accumulated return of 15.98%. The long-only method turned out to be a better choice again. However, the waiting window did improve our buy-low-sell-high strategy as well.

In this Take4 iteration and during 2018, the “Buy Low Sell High” strategy returned -2.38%. In the meantime, the long-only approach achieved an accumulated return of -0.56%. The long-only method turned out to be a better choice again. However, the waiting window did improve our buy-low-sell-high strategy as well.

CONCLUSION: For this period, the “Buy Low Sell High” strategy did not exceed the more straightforward long-only approach, so we should consider modeling more and different methods for this stock.

Dataset ML Model: Time series analysis with numerical attributes

Dataset Used: Various sources as illustrated below.

Dataset Reference: Various sources as documented below.

The HTML formatted report can be found here on GitHub.