Skip to content

StanQuant is a secure, scalable platform for testing algorithmic trading strategies using real historical stock data. Built with Django, Next.js, Spark, Kubernetes, and more, it allows users to upload, run, and evaluate trading algorithms at scale in isolated cloud containers.

Notifications You must be signed in to change notification settings

JoshElkind/stan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StanQuant — Trading Algorithm Sandbox

StanQuant is a full-stack web platform for designing, uploading, and evaluating stock trading algorithms on millions of rows of historical data.

Built to empower both beginner and experienced traders, this system provides a secure and scalable environment to validate the logic and performance of your strategies before risking real capital.


Summary

As an undergraduate Computer Science student at the University of Waterloo, I created this project to solve a personal need — I wanted a place to test my own trading scripts using real, large-scale financial data with flexibility and safety.

This app lets users:

  • Upload or create algorithmic trading strategies
  • Evaluate them using detailed statistical backtesting tools
  • Store, preview, and compare results for better decision-making

Tech Stack

  • Frontend: Next.js + TailwindCSS
  • Backend: Django + Django REST Framework
  • Data Processing: Apache Spark (PySpark), Pandas, NumPy
  • Database: AWS RDS (PostgreSQL) with SQLAlchemy ORM
  • Script Execution: Kubernetes Jobs on AWS EKS with Dockerized workloads
  • File Storage: Amazon S3 (managed via boto3)
  • Security: All uploaded user files run inside isolated containers with timeouts, resource caps, and no external network access

Key Features

Algorithm Upload & Validation

  • Upload .py scripts containing a single strategy function (def your_algo(df)).
  • Must return a list or array of Buy/Sell/Hold signals matching the length of the DataFrame.
  • Uploaded files are validated before execution.

Secure Execution Environment

  • Each user-uploaded script is executed in a sealed Kubernetes container using AWS EKS.
  • The job fetches historical stock data from AWS RDS, runs the algorithm, and stores output results back to S3.

High-Performance Data Handling

  • Evaluations run on minute-level historical stock data (millions of rows per test).
  • Uses PySpark and Pandas for fast, scalable processing of time-series indicators, rolling windows, and deciders.

Algorithm Evaluation System

  • Users input metrics like:
    • Gain & Loss thresholds
    • Intercept Ranges
    • Clean conflict filtering
    • Position duration
  • Algorithms can be combined and tested for consensus agreement.

Demo Video

To access a comprehensive walkthrough of the platform, view the Loom video demo:

Demo Video Folder on Loom


Photos

Evaluate Your Algorithms ↓

Evaluate Your Algorithms Evaluate Your Algorithms Evaluate Your Algorithms Evaluate Your Algorithms

Evaluation Results ↓

Evaluation Results Evaluation Results Evaluation Results

View Past Evaluations ↓

View Past Evaluations

Evaluation Analytics ↓

Evaluation Analytics Evaluation Analytics Evaluation Analytics Evaluation Analytics Evaluation Analytics Evaluation Analytics

View Your Algorithms ↓

View Your Algorithms

Preview Your Algorithms ↓

Preview Your Algorithms

Delete Your Algorithms ↓

Delete Your Algorithms

Upload Your Algorithms ↓

Upload Your Algorithms

Create Your Algorithms ↓

Create Your Algorithms Create Your Algorithms Create Your Algorithms Create Your Algorithms

Homepage ↓

Homepage

Sign In ↓

Sign In

Sign Out ↓

Sign Out

About Page ↓

About

User Guide ↓

User Guide


Links

Note: Backend deployment currently paused, please contact me.

About

StanQuant is a secure, scalable platform for testing algorithmic trading strategies using real historical stock data. Built with Django, Next.js, Spark, Kubernetes, and more, it allows users to upload, run, and evaluate trading algorithms at scale in isolated cloud containers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published