Skip to content

Add real-time data streaming support via WebSocket #3

@ARASH3280ARASH

Description

@ARASH3280ARASH

Summary

Enable the backtesting engine to consume live market data through WebSocket connections, bridging the gap between historical backtests and live paper-trading.

Technical Approach

  • Create a streaming/ module with a WebSocketFeed class that connects to exchange WebSocket APIs (Binance, Bybit) and normalizes incoming ticks into the existing OHLCV bar format.
  • Implement a ring-buffer based bar aggregator that constructs 1m/5m/1h bars from raw tick data in real time.
  • Wire the live feed into the existing strategy execution loop so the same strategy code runs identically in backtest and live modes (event-driven architecture).
  • Add connection resilience with automatic reconnection, heartbeat monitoring, and message sequence gap detection.
  • Include a paper-trading mode that logs simulated fills against live prices without touching any exchange account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions