Scalping Terminal
Relevant source files
The following files were used as context for generating this wiki page:
The Scalping Terminal is a specialized, low-latency trading interface within OpenAlgo designed for high-frequency, manual execution. It provides a keyboard-driven environment primarily for trading options, futures, and equities. Unlike standard web-based trading interfaces that rely heavily on mouse interactions, the Scalping Terminal emphasizes speed through keyboard shortcuts and a dedicated server-side risk engine that operates independently of the browser.
Sources: okf/tools/scalping.md, CLAUDE.md, Home.tsx:64-66
Architecture and Components
The Scalping Terminal operates as one of the four primary product surfaces of the OpenAlgo platform. It is integrated into the self-hosted instance, sharing the same broker session and real-time market data infrastructure as the Unified Broker API and the Flow No-Code builder.
Core Functional Logic
- Symbol Resolution: The terminal utilizes
blueprints/scalping.pyto resolve complex parameters such as underlyings, expiry dates, and strike prices. - Asset Coverage: It is optimized for index options and supports various product types including NRML (Normal) and MIS (Intraday), specifically excluding CNC (Cash and Carry) for scalping operations.
- Risk Management: A browser-independent server-side risk engine monitors trades to ensure execution remains within predefined safety parameters even if the frontend loses connection.
Sources: CLAUDE.md, okf/tools/scalping.md
Data Flow Overview
The following diagram illustrates how the Scalping Terminal interacts with the broader OpenAlgo ecosystem to facilitate low-latency execution.
The diagram shows the transition from user keyboard input to broker execution, and the return path of market data via the ZeroMQ bus.
Key Features and Operations
The Scalping Terminal is defined by its operational efficiency and specific command set. It provides immediate execution capabilities that bypass traditional order forms.
Keyboard Shortcuts
The terminal maps critical trading actions to specific keys to minimize the time between a trade decision and execution:
| Action | Key/Input | Description |
|---|---|---|
| Buy CE | Arrow Keys | Fires Call Option buy orders |
| Buy PE | Arrow Keys | Fires Put Option buy orders |
| Flatten All | F6 | Immediately closes all open positions |
| Cancel All | F7 | Cancels all pending/open orders |
Sources: Home.tsx:65-66, CLAUDE.md
Operational Constraints
- Focus: primarily targets index options.
- Product Types: Supports NRML and MIS; does not support CNC.
- Latency: Uses a ZeroMQ-based message bus for high-performance data distribution to ensure ticks are delivered with minimal delay.
Integration with OpenAlgo Services
The Scalping Terminal leverages several shared platform services to maintain consistency across the application.
Market Data Pipeline
The terminal relies on the three-layer market data pipeline:
- Broker Adapters: Normalize ticks from proprietary broker feeds.
- ZeroMQ Bus: Decouples the feed from delivery, preventing slow clients from blocking the adapter.
- WebSocket Proxy: Manages subscriptions and provides real-time updates to the Scalping UI.
Sandbox and Analyzer Mode
Scalping strategies and manual execution patterns can be tested in Analyzer Mode. This provides a sandbox environment with ₹1 Crore of virtual capital, allowing traders to practice keyboard execution against real market data without financial risk.
Sources: Home.tsx:67-68, README.md
Technical Specifications
| Component | Technical Detail |
|---|---|
| Route | /scalping |
| Backend Logic | blueprints/scalping.py |
| Risk Engine | Server-side, browser-independent |
| Communication | ZeroMQ (Port 5555) & WebSockets (Port 8765) |
| Frontend | React 19 with real-time Socket.IO updates |
Sources: okf/tools/scalping.md, CLAUDE.md, README.md
The Scalping Terminal represents the high-performance manual trading arm of OpenAlgo, providing professional-grade execution speed within a self-hosted environment. By offloading risk monitoring to the server and utilizing high-speed message buses, it ensures that manual scalpers have the reliability required for fast-paced market environments.