Profile
Back to NewsBack
GitHub Trending 14 min
Reader Mode
marketcalls/openalgo: Open Source Algo Trading Platform for Everyone

marketcalls/openalgo: Open Source Algo Trading Platform for Everyone

8 hours ago

OpenAlgo - Open Source Algorithmic Trading Platform

What is OpenAlgo?

OpenAlgo is a free, open source, self-hosted trading platform, not just a broker bridge. Built on Python Flask + React 19, it gives traders a full-stack environment to design, host, and execute strategies through 36 broker plugins: 35 securities integrations and Delta Exchange for crypto derivatives. Whether you write Python, prefer drag-and-drop, or trade options, OpenAlgo provides a common interface without tying strategy code to one adapter.

OpenAlgo is no longer just "an API layer in front of your broker." Today it combines four trading surfaces in one self-hosted instance, sharing the active broker session, market-data infrastructure, and six operational data stores across the journey from idea to testing and live execution.

Five Ways to Trade with OpenAlgo

| Surface | Route | Who it's for | | --- | --- | --- | | Unified Broker API | /api/v1/ | External platforms: TradingView, Amibroker, ChartInk, Excel, Google Sheets, Python, Java, Go, .NET, Node.js, MetaTrader, GoCharting, N8N. One contract across 36 plugins, with optional operations varying by adapter. | | Python Strategy Host | /python | Traders who code: paste any Python script into the in-browser CodeMirror editor, schedule it on IST start/stop times, run multiple strategies in parallel with process isolation, watch real-time logs. No external server, no Docker, no cron. | | Flow: No-Code Strategy Builder | /flow | Traders who don't code: drag-and-drop nodes for market data, indicators, conditions, order execution, and notifications. Webhook triggers for TradingView and external signals built in. JSON import/export for sharing strategies. | | AI Agent | /agent | Traders who would rather ask: a chat that reads your own market data through OpenAlgo's services, draws charts and payoff diagrams, computes indicators, marks up the /trading chart from a right-side panel, and can place orders only with your explicit approval on every single one. Bring your own model from any LiteLLM provider, or a ChatGPT Plus or Pro subscription, or run it locally against Ollama. | | Options Trading Suite | /tools | Options traders: twelve built-in analytical tools (Strategy Builder with payoff diagrams & live Greeks, Option Chain, IV Smile, Max Pain, Vol Surface, GEX dashboard, OI Tracker, OI Profile, Straddle Chart, Straddle PnL simulator, Option Greeks history). Each one streams from your connected broker. |

Order workflows from the REST API, hosted strategies, and Flow can use Analyzer Mode before live execution. Analytics pages, dashboards, PnL tracking, latency monitoring, notifications, and MCP reuse the same application services where their specific capabilities apply.

Video Tutorial

What is OpenAlgo</a>

Quick Links

Python Compatibility

Requires Python 3.12 or newer.

Supported Brokers (36 plugins)

View All Supported Brokers

  • 5paisa (Standard + XTS)
  • AliceBlue
  • AngelOne
  • Arrow
  • Compositedge
  • Definedge
  • Delta Exchange
  • Dhan (Live + Sandbox)
  • Firstock
  • Flattrade
  • Fyers
  • Groww
  • HDFC Securities
  • HDFC Sky
  • IBulls
  • IIFL
  • Iiflcapital
  • Indmoney
  • JainamXTS
  • Kotak Neo
  • Motilal Oswal
  • Mstock
  • Nubra
  • Paytm Money
  • Pocketful
  • RMoney
  • Samco
  • Shoonya (Finvasia)
  • Tradejini
  • TradeSmart
  • Upstox
  • Wisdom Capital
  • Zebu
  • Zerodha

Plugins share OpenAlgo's normalized API shapes. Exchange coverage, authentication, market-data entitlement, GTT support, and other optional capabilities still vary by adapter and broker account.

Core Features

Unified REST API Layer (/api/v1/)

A maintained contract with 57 REST method/path pairs under /api/v1:
  • Order Management: Place, modify, cancel orders, basket orders, smart orders with position sizing
  • Portfolio: Get positions, holdings, order book, trade book, funds
  • Market Data: Real-time quotes, historical data, market depth (Level 5), symbol search
  • Advanced: Option Greeks calculator, margin calculator, synthetic futures, auto-split orders

Real-Time WebSocket Streaming

  • Unified WebSocket proxy server (port 8765 by default)
  • Common WebSocket implementation using ZMQ for normalized data across brokers
  • Subscribe to LTP, Quote, or Market Depth for any symbol
  • ZeroMQ-based message bus for high-performance data distribution
  • Automatic reconnection and failover handling

Flow Visual Strategy Builder (/flow)

Build trading strategies visually without writing code:
  • Node-based editor powered by xyflow/React Flow
  • Pre-built nodes: Market data, indicators, conditions, order execution, notifications
  • Real-time execution with live market data
  • Webhook triggers for TradingView and external signals
  • Condition nodes with true/false and yes/no edge handles, {{var}} interpolation with list indexing
  • JSON import/export for sharing strategies between traders
  • Visual debugging with execution flow highlighting

Options & Strategy Analytics Tools (/tools)

A suite of twelve built-in analytical tools for options trading and market analysis. The pages use the active broker connection; broker market-data entitlements and exchange coverage still apply. Accessible from the Tools page in the sidebar:

| Tool | Route | What it does | |------|-------|--------------| | Strategy Builder | /strategybuilder | Build multi-leg option strategies with live Greeks, payoff diagrams, what-if simulators, Strategy Chart, Multi Strike OI tabs, and basket order execution | | Strategy Portfolio | /strategybuilder/portfolio | Saved strategies across MyTrades and Simulation watchlists | | Option Chain | /optionchain | Real-time option chain with live Greeks, OI data, and quick order placement | | Option Greeks | /ivchart | Historical IV, Delta, Theta, Vega, and Gamma charts for ATM options | | OI Tracker | /oitracker | Open Interest analysis with CE/PE OI bars, PCR overlay, and ATM strike marker | | Max Pain | /maxpain | Max Pain strike calculation with visual pain distribution across strikes | | Straddle Chart | /straddle | Dynamic ATM Straddle chart with rolling strike, Spot, and Synthetic Futures overlay | | Straddle PnL | /straddlepnl | Simulated intraday ATM straddle P&L with automated N-point adjustments and trade log | | Vol Surface | /volsurface | 3D Implied Volatility surface across strikes and expiries using live option chain data | | GEX Dashboard | /gex | Gamma Exposure analysis with OI Walls, Net GEX per strike, and top gamma strikes | | IV Smile | /ivsmile | Implied Volatility smile with Call/Put IV curves, ATM IV, and skew analysis | | OI Profile | /oiprofile | Futures candlestick with OI butterfly and daily OI change across strikes |

Tools use the active broker's REST and WebSocket capabilities. Data availability and supported exchanges vary by plugin and account entitlement.

API Analyzer Mode

Complete testing environment with ₹1 Crore sandbox capital:
  • Test strategies with real market data without risking money
  • Pre-deployment testing for strategy validation
  • Supports the core MARKET, LIMIT, SL, and SL-M price types
  • Realistic margin system with leverage
  • Configurable sandbox square-off schedules
  • Separate database for complete isolation
API Analyzer Documentation

Action Center

Order approval workflow for manual control:
  • Auto Mode: Immediate order execution (for personal trading)
  • Semi-Auto Mode: Manual approval required before broker execution
  • Complete audit trail with IST timestamps
  • Approve individual orders or bulk approve all
Action Center Documentation

Python Strategy Host (/python)

Host and run your Python strategies directly inside OpenAlgo, with no separate VM, no cron, no Docker:
  • Built-in code editor powered by CodeMirror with Python syntax highlighting and themes
  • Run multiple strategies in parallel with full process isolation
  • Automated IST-based scheduling with start/stop times and per-day-of-week control
  • Secure environment variable management with Fernet encryption
  • Real-time logs streamed to the browser; state persists across restarts
  • Built-in Python Strategy Guide page walks first-time users from an empty editor to a scheduled, running strategy

ChartInk Integration

Direct webhook integration for scanner alerts:
  • Supports BUY, SELL, SHORT, COVER actions
  • Intraday with auto square-off and positional strategies
  • Bulk symbol configuration via CSV
  • Real-time strategy monitoring

AI Agent (/agent)

A built-in LLM agent, on the full page and as a right-side panel on the /trading chart:
  • Reads quotes, depth, history, option chains and Greeks through OpenAlgo's own services, never a third-party data feed
  • Draws candles with the charting library, option analytics with Plotly, and marks levels, trendlines and zones onto your chart
  • Computes 127 indicators with the Rust-backed openalgo.ta, and generates Python strategies using the OpenAlgo SDK
  • Every order pauses for your approval, showing the exact arguments before anything is sent, with the risk limits applied after you approve
  • Any provider LiteLLM supports, a ChatGPT Plus or Pro subscription over OAuth, or a local model through Ollama
  • Keys are encrypted in your own database and never written to a configuration file

AI-Powered Trading (MCP Server)

Connect AI assistants for natural language trading:
  • Compatible with Claude Desktop, Cursor, Windsurf, ChatGPT
  • Execute trades using natural language commands
  • Full trading capabilities: orders, positions, market data
  • Local and secure integration with your OpenAlgo instance

Telegram Bot Integration

Real-time notifications and command execution:
  • Automatic order and trade alerts delivered to Telegram
  • Get orderbook, positions, holdings, funds on demand
  • Generate intraday and daily charts
  • Interactive button-based menu
  • Receive strategy alerts directly to Telegram
  • Secure API key encryption

Advanced Monitoring Tools

Latency Monitor: Track order execution performance and round-trip times across brokers

Traffic Monitor: API usage analytics, error tracking, and endpoint statistics

PnL Tracker: Real-time profit/loss with interactive charts powered by TradingView Lightweight Charts

PnL Tracker Documentation

Traffic & Latency Monitor Documentation

Enterprise-Grade Security

Password Security: Argon2 hashing (Password Hashing Competition winner)

Token Encryption: Fernet symmetric encryption with PBKDF2 key derivation

Two-Factor Authentication: TOTP support with authenticator apps

Rate Limiting: Configurable limits for login, API, orders, webhooks

Manual IP Ban System: Monitor and ban suspicious IPs via /security dashboard

Browser Protection: CSP headers, CORS rules, CSRF protection, secure headers, secure sessions

SQL Injection Prevention: SQLAlchemy ORM with parameterized queries

Privacy First: Zero data collection policy - your data stays on your server

Modern React Frontend

  • React 19 with TypeScript for type-safe, maintainable code
  • shadcn/ui components with Tailwind CSS 4.0 for beautiful, accessible UI
  • TanStack Query for efficient server state management and caching
  • Zustand for lightweight client state management
  • Real-time updates via Socket.IO (orders, trades, positions, logs)
  • CodeMirror for Python and JSON editing with syntax highlighting and themes
  • xyflow/React Flow for visual Flow strategy builder
  • TradingView Lightweight Charts for P&L and market data visualization
  • Light and Dark themes with 8 accent colors
  • Mobile-friendly responsive design

Supported Platforms

Connect your algo strategies and run from any platform:

  • Amibroker - Direct integration with AFL scripts
  • TradingView - Webhook alerts for Pine Script strategies
  • GoCharting - Webhook integration
  • N8N - Workflow automation
  • Python - Official SDK with 100+ technical indicators
  • GO - REST API integration
  • Node.js - JavaScript/TypeScript library
  • ChartInk - Scanner webhook integration
  • MetaTrader - Compatible with MT4/MT5
  • Excel - REST API + upcoming Add-in
  • Google Sheets - REST API integration
Receive your strategy alerts directly to Telegram for all platforms.

Technology Stack

Backend

  • Flask 3.0 - Python web framework
  • SQLAlchemy 2.0 - Database ORM
  • Flask-SocketIO - Real-time WebSocket communication
  • ZeroMQ - High-performance message bus
  • Argon2-CFFI - Password hashing
  • Cryptography - Fernet encryption for tokens
  • Agno - Agentic framework for the /agent reasoning loop and tool calling
  • LiteLLM - LLM-agnostic provider layer the agent calls every model through

Frontend

  • React 19 - UI library
  • TypeScript - Type-safe JavaScript
  • Vite 8 - Fast build tool powered by Rolldown
  • Tailwind CSS 4 - Utility-first CSS framework
  • shadcn/ui - Component library built on Radix UI
  • TanStack Query - Server state management
  • Zustand - Client state management

Data Visualization & Editors

  • TradingView Lightweight Charts - Financial charts
  • CodeMirror - Code editor for strategies
  • xyflow/React Flow - Visual Flow builder
  • Lucide React - Icon library

Testing & Quality

  • Vitest - Unit testing
  • Playwright - E2E testing
  • Biome - Linting and formatting
  • axe-core - Accessibility testing

Databases

  • SQLite - 5 databases (main, logs, latency, health, sandbox)
  • DuckDB - 1 historical market-data store (Historify)

Official SDKs

OpenAlgo provides officially supported client libraries for application development and system-level integrations:

| Language / Platform | Repository | |---------------------|------------| | Python | openalgo-python-library | | Node.js | openalgo-node | | Java | openalgo-java | | Rust | openalgo-rust | | .NET / C# | openalgo.NET | | Go | openalgo-go |

OpenAlgo FOSS Ecosystem

OpenAlgo is part of a larger open-source trading ecosystem:

  • OpenAlgo Core: This repository (Python Flask + React)
  • Historify: Stock market data management platform
  • Official SDKs: Python, Node.js, Java, Rust, .NET, Go (see above)
  • Excel Add-in: Direct Excel integration
  • MCP Server: AI agents integration
  • Chrome Plugin: Browser-based tools
  • Fast Scalper: High-performance trading (Rust + Tauri)
  • Web Portal: Modern UI (NextJS + ShadcnUI)
  • Documentation: Comprehensive guides on Gitbook

Installation

Minimum Requirements

  • RAM: 2GB (or 0.5GB + 2GB swap)
  • Disk: 1GB
  • CPU: 1 vCPU
  • Python: 3.12 or newer
  • Node.js: 20.20+, 22.22+, or 24.13+ (for frontend development)

Quick Start with UV

OpenAlgo uses the modern uv package manager for faster, more reliable installations:

# Clone the repository
git clone --filter=blob:none https://github.com/marketcalls/openalgo.git
cd openalgo

Install UV package manager

pip install uv

Configure environment

cp .sample.env .env

Edit .env with your broker API credentials as per documentation

Run the application using UV

uv run app.py

The application will be available at http://127.0.0.1:5000

For detailed installation instructions, deployment options (Docker, AWS, etc.), and configuration guides, visit docs.openalgo.in/installation-guidelines/getting-started

API Documentation

Complete API reference and examples:

Key Benefits

  • Guided Installation: UV and production install scripts with explicit broker configuration
  • Single API, Multiple Brokers: Switch brokers without code changes
  • No Data Collection: Complete privacy - your data stays on your server
  • Visual Strategy Builder: Create strategies with drag-and-drop Flow editor
  • Host Python Strategies: Run strategies directly without external servers
  • Smart Order Execution: Intelligent routing for complex strategies
  • Order Splitting: Automatically split large orders into smaller chunks
  • Real-Time Analytics: PnL tracking, latency monitoring, traffic analysis
  • Strategy Templates: Rapid prototyping with pre-built templates
  • Plugin Architecture: Extensible design for custom integrations
  • Active Community: Discord support, virtual meetups, open roadmap

Documentation

Comprehensive documentation is available at docs.openalgo.in:

  • API Reference with examples
  • Broker-specific guides
  • Security best practices
  • Deployment tutorials
  • Strategy development guides
  • Troubleshooting and FAQs

Contributing

We welcome contributions! To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using Conventional Commits, for example:
git commit -m "feat: add amazing feature"
  1. Push to the branch (git push origin feature/amazing-feature)
  2. Open a Pull Request

Community & Support

License

OpenAlgo is released under the AGPL V3.0 License. See License.md for details.

Credits & Acknowledgments

OpenAlgo is built upon the shoulders of giants. We extend our gratitude to all the open-source projects that make this platform possible.

Core Framework

  • Flask - BSD License - Python web microframework
  • React - MIT License - UI library for building user interfaces
  • SQLAlchemy - MIT License - Python SQL toolkit and ORM

AI & Agent Frameworks

The AI Agent at /agent is deliberately LLM-agnostic. The agent loop and the provider layer are separate pieces, so moving between model vendors, or to a local model, is a configuration change rather than a code change. Both of these projects are what make that possible.
  • Agno - Apache 2.0 - Agentic framework behind the /agent reasoning loop, tool calling, session persistence and image attachments
  • LiteLLM - MIT License - Unified model layer giving one interface across every supported provider, plus the model catalogue and per-model metadata the agent's provider picker is built from

UI Components & Styling

  • shadcn/ui - MIT License - Beautifully designed components built with Radix UI and Tailwind CSS
  • Radix UI - MIT License - Unstyled, accessible UI components
  • Tailwind CSS - MIT License - Utility-first CSS framework
  • Lucide - ISC License - Beautiful & consistent icon library

Data Visualization

  • TradingView Lightweight Charts - Apache 2.0 - Financial charting library for market data and P&L visualization
  • Plotly - MIT License - Interactive charting library for options analytics and visualization
  • xyflow/React Flow - MIT License - Highly customizable library for building node-based visual strategy editors

Code Editors

  • CodeMirror - MIT License - Versatile code editor for Python and JSON with syntax highlighting
  • @uiw/react-codemirror - MIT License - CodeMirror React wrapper with themes

State Management & Data Fetching

  • TanStack Query - MIT License - Powerful asynchronous state management
  • Zustand - MIT License - Lightweight state management
  • Axios - MIT License - Promise-based HTTP client

Real-Time Communication

  • Socket.IO - MIT License - Real-time bidirectional event-based communication
  • ZeroMQ - LGPL License - High-performance asynchronous messaging

Security

  • Argon2-CFFI - MIT License - Argon2 password hashing (PHC winner)
  • Cryptography - BSD/Apache License - Cryptographic recipes and primitives

Build & Development Tools

  • Vite - MIT License - Fast frontend build tool
  • TypeScript - Apache 2.0 - JavaScript with syntax for types
  • Biome - MIT License - Fast formatter and linter
  • Vitest - MIT License - Blazing fast unit testing
  • Playwright - Apache 2.0 - End-to-end testing framework

Additional Libraries

Repo Activity

!Alt

Disclaimer

This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Always test your strategies in Analyzer Mode before deploying with real money. Past performance does not guarantee future results. Trading involves substantial risk of loss.


Built with by traders, for traders. Making algorithmic trading accessible to everyone.

Chat with me