Stock Scouter Bot: A Software Engineer's Journey in Building a Swing Trading Tool

Personal Tech Projects

I am thrilled to introduce the prototype of my latest project, the Stock Scouter Bot. This Telegram bot is designed to simplify swing trading for casual traders like myself. Living in Singapore, the U.S. stock market opens late at night, and it’s easy to miss critical information when the US market opens. This Telegram bot addresses this by sending timely updates at market open, managing trading plans and providing quick access to top market moves.

The idea for Stock Scouter Bot first came from my personal needs after taking some trading courses for personal interest. I wanted an easy way to track my trades when the market is open. It is also to remind myself of my strategies that aren't meant for long-term investments - how long was the holding period i plan for, and finding potential stocks for pair trading and short squeezing, other potential strategies. While many tools do this, I wanted something custom-tailored to my specific needs, all hosted affordably.

Beyond its functionality, this post also delves into the technical architecture, development choices, and challenges faced in building this bot. It showcases a pragmatic approach to creating useful tools with budget-friendly solutions—making it both a fun and valuable side project. Although built primarily for my own use, this prototype has the potential to grow into a tool that benefits other traders, especially those managing trades outside of their timezone.


Disclaimer: I am not a professional trader nor do I have a formal finance background, so there may be instances where I use terms imprecisely or am unaware of existing tools with the functionalities I've developed. This project is about building a solution to my problems as much as it is about my exploration and learning in software development.

Functional Overview

Here’s what the bot can currently do

  1. Check Stock Prices: Instantly fetches the current price of any stock, providing traders quick access to key information.

  1. Track Market Movers: Identifies the top market movers, helping traders spot potential opportunities or trends.

  1. Game Plan Management: Enables traders to set and manage trading game plans. Each plan includes details like target prices for taking profit or stopping losses and a holding period for each stock. The bot sends an automatic update when the market opens, notifying traders about their active game plans.

Technical Architecture

Since this project is a prototype, finding affordable (or free) hosting options was the priority. Here’s how I built it using mostly free resources

1) Backend Hosting and Server Setup

  • I use a free lifetime Oracle VM to host the backend API and manage various services using Docker containers. This allowed me to deploy the application without incurring any costs.
  • Nginx as Reverse Proxy: I have installed Nginx to manage and route requests based on the domain to specific API endpoints. This not only enhances security and streamlines request handling, but also makes the server reusable for deploying multiple projects.

2) Database

  • I am using AWS free-tier RDS for storing game plans and user data. However, this is a temporary solution, as the free tier only lasts one year. I am open to exploring affordable alternatives and welcome any recommendations :)

3) Telegram Bot Hosting

  • The bot is hosted on a separate AWS EC2 instance to ensure it runs independently of the backend, reducing the risk of system failures.

4) Cron Jobs for Market Updates:

  • One of the core functionalities of bots depends on a cron job that triggers a shell script when the market opens. The script would trigger an API that sends updates on active game plans, including the strategy, holding period, and current stock prices.

5) Continuous Integration/Deployment (CI/CD):

  • I integrated GitHub Actions for CI/CD to automate the deployment of both the Bot and backend solution, facilitating a seamless CI/CD workflow at no additional cost For more on automating deployment, refer to my previous post.

Challenges and Solutions

  • Free or Low-Cost Hosting: Since this is a personal project, finding affordable or free hosting was one of the my top priorities. I utilised Oracle’s free VM to simulate the backend server hosting, AWS free-tier for the database and bot deployment, and Github Actions for CI/CD. These services work well for now, but may need reevaluation as the project scales.

  • Stock Data Access: Getting live stock data is another challenge. Most live stock data are expensive, and I had find free alternatives or adjust the scope without compromising too much on data accuracy.

  • Learning Trading Strategies: Coming from a non-finance background, I am still learning different strategies, like short squeezes and pair trading, etc. This impacts on how quickly I can implement features related to these strategies.

Conclusion

Stock Scouter Bot is a personal project designed to address the challenges I’ve faced as a casual swing trader. The bot provides a straightforward way to manage game plans, check stock prices, and identify market movers. While the current architecture and solutions are not yet production-ready, they demonstrate what can be achieved with limited resources.

As I balance other commitments, enhancing this bot will be paced, but I am eager to continue improving it and expanding its capabilities to support more sophisticated trading strategies. I welcome any feedback or advice - please feel free to share your thoughts and suggestions.

Originally published at https://withzell.com.