background-shape

Algorithmic Trading using LSTM

Algorithmic stock trading leverages automated strategies that often operate beyond the capabilities of human traders. This project includes 1. Technical Strategies, Rule-based processes triggered by specific market conditions such as trend breakouts, overbought/oversold levels, support/resistance zones, and target percentage gains. 2. Machine Learning Strategy, where the model learns the latent trend and patterns from interaction between technical indicators, macro economic indicators, and text vectors of public and publisher sentiment around the Symbol of interest. Diagram below illustrates the high level architecture.

Tools Used

Python, SkLearn, PyTorch

Category

Deep Learning / Automation

Date

May 31, 2024

Challenge

For over eight years, I've invested in and traded stocks as a personal hobby, achieving modest yet consistent returns. Like many, I found that life’s demands gradually reduced the time I could devote to trading. This sparked a question, why not apply my data science expertise to automate the process? While I know the challenge will be significant, I'm committed to exploring whether a genuine market edge can be uncovered.

Solution

I employed an ensemble of off-the-shelf encoder-only transformer models and Long Short-Term Memory (LSTM) networks to identify patterns in the sequential nature of stock data. Combined with rule-based technical triggers, the resulting strategy was back-tested but has yet to demonstrate a meaningful edge. I plan to refine and evolve this model iteratively over the coming years.

case-details