rs_trader is a next-generation modular trading platform designed to blend total "Lego-like" flexibility with the raw performance of Rust, Polars DataFrames, and GPU acceleration.
Unlike rigid, monolithic platforms, rs_trader treats trading as a complete computing system where every component is an interchangeable plugin. The application is built on three fundamental pillars:
The workflow is the beating heart of the platform. It is far more than a data processing tool; it is where you define the behavior of your trading station.
- Risk Management as a Workflow: Design nodes to monitor daily PnL, validate account balances, or dynamically calculate position sizes based on ATR. Risk rules act as a logic gate, intercepting and blocking orders before they ever reach the broker.
- Algorithmic Trading: Build automated strategies by chaining technical indicator blocks with decision-making logic nodes.
- Interactive UI: The workflow bridges the gap between visual actions (chart clicks) and actual execution.
To ensure absolute fluidity even when handling millions of candles, rs_trader utilizes a "Pass-by-Reference" architecture.
- Zero-Copy: Heavy data (Polars DataFrames) is loaded once into shared memory.
- Resource Pooling: If multiple charts or algorithms use the same data (e.g., NQ 1min), they all point to the same memory object (
Arc<RwLock>). - Batch Performance: Indicators (SMA, RSI, etc.) are computed using vectorized Polars operations, processing massive histories in milliseconds.
An asynchronous message bus connects all plugins, ensuring a decoupled and reactive ecosystem.
- The Chart publishes an intent (e.g., "User wants to Buy at 18250").
- The Workflow intercepts this intent, injecting intelligence (Risk check, Validation).
- The Simulated Engine or Real Broker executes the order and broadcasts status updates back to the bus.
Everything is a plugin. You can build your custom terminal by assembling:
- Egui Panes: Visualization plugins (Interactive charts, Order books, Workflow editors).
- Workflow Nodes:
- Loaders: CSV, Parquet, and real-time feed connectors.
- Processors: Technical indicators, statistical calculations.
- Logic: Risk managers, trade validators, signal generators.
- Sinks: Data exporters and chart injection points.
- Market Connectors: Rithmic, IBKR, Binance, or local simulators.
- Core: Rust (Safety & Speed)
- Data: Polars (High-performance vectorized processing)
- UI: Egui & GPUI (Fluid, reactive interfaces)
- Rendering:
egui_trade_plotwith GPU acceleration (WGPU). - Concurrency: Tokio (Async messaging & background tasks).
- Rust (latest stable)
- WGPU compatible drivers
cargo build --release./target/release/rs-trader --ui=eguiBy making the Workflow central, rs_trader completely decouples the View (the chart) from the Logic (risk and strategy). You can swap your broker, update your risk parameters, or add a pattern-detection AI simply by modifying a node in your graph—without ever touching the terminal's source code.