Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantbox

Institutional-Grade Automated Trading Platform for Indian Stock Markets

Quantbox is a full-stack algorithmic trading platform designed for the Indian equities market. It provides automated strategy execution, backtesting, paper trading, live trading integration with Angel One SmartAPI, and a community marketplace for sharing strategies.


Table of Contents


Features

Trading Modes

  • Live Trading: Real-time execution via Angel One SmartAPI with SEBI-compliant IP verification
  • Paper Trading: Simulated execution with live market data for strategy validation
  • Backtesting: Historical performance analysis with comprehensive metrics

Strategy Engine

  • 40+ Pre-built Strategies: Trend following, mean reversion, momentum, and institutional strategies
  • 20+ AI/ML Strategies: LSTM, Transformer, XGBoost, Reinforcement Learning models
  • Strategy Builder: Visual drag-and-drop strategy composition
  • Custom Parameters: Fine-tune every strategy parameter
  • Risk Management: Stop-loss, take-profit, trailing stops, position sizing

Analytics & Monitoring

  • Real-time Charts: Interactive candlestick charts with technical indicators
  • Sentiment Analysis: AI-powered market sentiment from news and social media
  • Performance Metrics: Sharpe ratio, Sortino ratio, max drawdown, profit factor
  • Trade History: Comprehensive logging with P&L tracking
  • Kill Switch: Emergency halt for all automated trading

Community Features

  • Strategy Marketplace: Share and copy strategies from other traders
  • Ratings & Reviews: Community feedback on published strategies
  • Leaderboards: Top performing strategies and traders

Security

  • AES-256-GCM Encryption: All sensitive credentials encrypted at rest
  • Two-Factor Authentication: TOTP-based 2FA with backup codes
  • Account Lockout: Automatic lockout after failed login attempts
  • Security Audit Logging: Comprehensive audit trail
  • IP Whitelisting: SEBI-compliant trading IP verification

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         NGINX (Reverse Proxy)                    │
│                    SSL Termination + Load Balancing              │
└─────────────────────────────────────────────────────────────────┘
                          │                    │
                          ▼                    ▼
┌─────────────────────────────────┐  ┌─────────────────────────────┐
│      Next.js Frontend (3000)     │  │   FastAPI Backend (8000)    │
│  - Dashboard UI                  │  │  - Trading Engine           │
│  - Strategy Builder              │  │  - Backtest Engine          │
│  - Charts & Analytics            │  │  - Sentiment Analysis       │
│  - Authentication                │  │  - Angel One Integration    │
│  - API Routes                    │  │  - WebSocket Feeds          │
└─────────────────────────────────┘  └─────────────────────────────┘
                          │                    │
                          ▼                    ▼
┌─────────────────────────────────────────────────────────────────┐
│                    PostgreSQL Database (5432)                    │
│         Users, Trades, Strategies, Performance, Audit            │
└─────────────────────────────────────────────────────────────────┘
                                   │
                                   ▼
┌─────────────────────────────────────────────────────────────────┐
│                         Redis (6379)                             │
│              Session Cache, Rate Limiting, Pub/Sub               │
└─────────────────────────────────────────────────────────────────┘

Tech Stack

Frontend

Technology Purpose
Next.js 15 React framework with App Router
TypeScript Type-safe development
Tailwind CSS 4 Utility-first styling
Radix UI Accessible component primitives
Lightweight Charts Financial charting
Framer Motion Animations
NextAuth.js Authentication

Backend

Technology Purpose
FastAPI High-performance Python API
SQLAlchemy Async ORM
APScheduler Scheduled tasks
SmartAPI Angel One broker integration
NumPy Technical indicator calculations
Loguru Structured logging

Infrastructure

Technology Purpose
PostgreSQL 15 Primary database
Redis 7 Caching and sessions
Docker Containerization
NGINX Reverse proxy and SSL
Certbot SSL certificate management

Project Structure

autotradesync-trading-system/
├── backend/
│   ├── app/
│   ├── Dockerfile
│   └── requirements.txt
├── public/
├── src/
├── Dockerfile
├── docker-compose.yml
├── docker-compose.prod.yml
├── init.sql
├── nginx.conf
└── ...

Getting Started

Prerequisites

  • Docker & Docker Compose

Local Development

  1. Clone the repository:

    git clone https://github.com/your-repo/autotradesync-trading-system.git
    cd autotradesync-trading-system
  2. Start the development environment:

    docker-compose up --build

    This command will build the Docker images and start all the services, including PostgreSQL, Redis, the backend, and the frontend. The services will be available at:

    • Frontend: http://localhost:3000
    • Backend: http://localhost:8000
    • Backend Docs: http://localhost:8000/docs

Production Deployment

Prerequisites

  • A server with Docker and Docker Compose installed.
  • A domain name pointing to your server's IP address.

Setup

  1. Clone the repository on your server:

    git clone https://github.com/your-repo/autotradesync-trading-system.git
    cd autotradesync-trading-system
  2. Configure environment variables:

    Create a .env file and add your production environment variables. You can use .env.example as a template.

    cp .env.example .env
    nano .env
  3. Configure Nginx:

    Edit nginx.conf and replace yourdomain.com with your actual domain name.

    sed -i 's/yourdomain.com/your-actual-domain.com/g' nginx.conf
  4. Deploy the application:

    docker-compose -f docker-compose.prod.yml up -d --build

SSL Configuration

  1. Obtain SSL certificates:

    Use the certbot service defined in docker-compose.prod.yml to obtain SSL certificates from Let's Encrypt.

    docker-compose -f docker-compose.prod.yml run --rm certbot certonly --webroot --webroot-path=/var/www/certbot --email your-email@example.com --agree-tos --no-eff-email -d yourdomain.com
  2. Restart Nginx:

    After obtaining the certificates, restart the Nginx container to apply the changes.

    docker-compose -f docker-compose.prod.yml restart nginx

Trading Strategies

... (rest of the file remains the same)

About

autosync - Repository created from Orchids integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages