How santhosh144awc/openalgo works
OpenAlgo is a self-hosted algorithmic trading platform: users connect a broker, then build or submit strategies, analyze market data, and test or execute orders. The README documents several distinct trading surfaces sharing broker sessions and market-data infrastructure. The graph preserves those capabilities and the sandbox/analyzer domain stages; unsampled routes and service wiring are represented only where the README explicitly documents their relationships.
Main entry points: app.py Flask application · market_data_service.py Market data service · orders.py Order workflows · broker Broker integrations
Components 21
Trading surfaces
- Unified broker API
blueprints/orders.py - Python strategy host
blueprints/python_strategy.py - Visual Flow builder
blueprints/flow.py - AI trading agent
blueprints/agent.py
Orders and execution
- Broker integrations
broker - Order workflows
blueprints/orders.py - Analyzer sandbox
blueprints/analyzer.py - Sandbox execution engine
sandbox/execution_engine.py - WebSocket execution
sandbox/websocket_execution_engine.py
Market data and analytics
- Options analytics suite
blueprints - Market analytics
blueprints - Market data service
services/market_data_service.py - Symbol search
services/search_service.py
Strategy lifecycle
- Strategy module engine
services/strategy_module/engine.py - Portfolio tools
portfolio/engine.py
Platform services
- Flask application
app.py - Sandbox state store
database/sandbox_db.py - Strategy state store
database/strategy_module_db.py - Auth and broker sessions
database/auth_db.py
Other components
- Trader or client
- Broker services
Connections 27
- Trader or client → Flask application: uses platform
- Flask application → Unified broker API: serves API
app.py - Flask application → Python strategy host: serves strategy host
app.py - Flask application → Visual Flow builder: serves Flow
app.py - Flask application → AI trading agent: serves agent
app.py - Flask application → Options analytics suite: serves tools
app.py - Unified broker API → Order workflows: submits orders
- Python strategy host → Order workflows: uses order workflows
- Visual Flow builder → Order workflows: executes orders
- AI trading agent → Market data service: reads market data
- AI trading agent → Order workflows: requests approved orders
- Unified broker API → Broker integrations: uses normalized API
- Order workflows → Broker integrations: dispatches orders
- Broker integrations → Broker services: calls broker APIs
- Broker integrations → Market data service: streams broker data
- Analyzer sandbox → Sandbox execution engine: tests orders
- Sandbox execution engine → Sandbox state store: reads and writes
sandbox/execution_engine.py - Sandbox execution engine → Market data service: fetches quotes
sandbox/execution_engine.py - WebSocket execution → Market data service: subscribes to updates
sandbox/websocket_execution_engine.py - Options analytics suite → Market data service: uses live broker data
- Market analytics → Market data service: uses market data
- Strategy module engine → Strategy state store: manages strategy state
services/strategy_module/engine.py - Strategy module engine → Order workflows: dispatches strategy orders
- Portfolio tools → Broker integrations: uses broker portfolio data
- Flask application → Auth and broker sessions: checks sessions
app.py - Symbol search → Auth and broker sessions: checks user context
services/search_service.py - Symbol search → Market data service: resolves symbols