ES

Project

Stock Signals Tracker

Serverless system that detects buy and sell signals on stocks listed on the Mexican Stock Exchange.

View on GitHub →

Goal

A serverless AWS system that tracks daily stock prices from the Mexican Stock Exchange (BMV) and the International Quotation System (SIC). It applies technical analysis indicators — Bollinger Bands and RSI — to automatically detect buy and sell signals. The system does not execute orders: it observes, calculates, and records to support informed decision-making.


How it works

  1. Daily price fetchMonday–Friday at 16:30 CDMX, Windows Task Scheduler runs a local Python script that downloads OHLCV prices from Yahoo Finance (yfinance). Local execution is required because Yahoo Finance blocks AWS Lambda IP ranges.
  2. USD/MXN exchange rateThe same script fetches the day's exchange rate from the Frankfurter API (ECB) and computes the MXN price for USD-denominated stocks.
  3. Persistence in DynamoDB and S3Prices and exchange rates are stored in DynamoDB and in Parquet files partitioned by market and date in S3.
  4. Event-driven analysis via StreamsEach write to the prices table triggers a DynamoDB Stream that automatically invokes the analyze-signals Lambda.
  5. Technical indicator calculationThe Lambda queries the last 90 days of price history, calculates Bollinger Bands (20-day) and RSI (14-period) using pandas, and classifies each ticker as BUY, SELL, or HOLD.
  6. Signal storageSignals are persisted to DynamoDB and S3, queryable via Amazon Athena with the Glue catalog.

Daily scheduling

The price fetch runs at 16:30 CDMX (Monday–Friday) from Windows Task Scheduler. Signal analysis is fully event-driven via DynamoDB Streams — no polling, no additional scheduler on AWS. If the machine was off at 16:30, the task runs as soon as the network is available.


AWS Services


External Services


Stack

Python 3.12AWS CDK (TypeScript)pandaspyarrowyfinanceDynamoDBLambdaS3GlueAthenaSSMCloudFormationWindows Task Scheduler