Skip to content

pcortellezzi/rs_trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

106 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦀 rs_trader: The Modular Trading OS

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.

🎯 Philosophy: The "Trading Operating System"

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:

1. 🧠 The Brain: Workflow Engine (Logic & Behavior)

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.

2. ⚡ The Hub: Shared Data Domain (Memory)

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.

3. 📡 The Bus: Messaging API (Signaling)

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.

🏗️ Plugin Architecture

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.

🚀 Technical Stack

  • Core: Rust (Safety & Speed)
  • Data: Polars (High-performance vectorized processing)
  • UI: Egui & GPUI (Fluid, reactive interfaces)
  • Rendering: egui_trade_plot with GPU acceleration (WGPU).
  • Concurrency: Tokio (Async messaging & background tasks).

🛠️ Getting Started

Prerequisites

  • Rust (latest stable)
  • WGPU compatible drivers

Build

cargo build --release

Run

./target/release/rs-trader --ui=egui

Why is this so powerful?

By 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.

About

Tarding Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages