Rx Trader

 

The RxTrader module to be responsible for order execution, trade signal processing, and position management. It interacts with Kafka, the trading strategy controllers, and an action execution framework.

1. Data Flow and Integration

  1. Market signals (bidPrice, offerPrice) are sent from RxModeler to Kafka

    • RxModeler generates trading signals based on price movements.
    • These signals include bidPrice and offerPrice and are published to Kafka.
  2. RxKafkaConsumerService consumes the signals

    • It processes trading signals and sends them to RxTradeSignalsDesk, which distributes them further.

2. Order Execution Pipeline

  1. RxOrderExecuteReportController handles order execution

    • Receives trade requests from RxGateway (which connects to the broker).
    • Processes order execution reports.
  2. RxPositionReportController updates position states

    • Stores filled orders and trade results.
    • Communicates with RxPositionControllerThread to manage trade profitability calculations.

3. Trade Strategy and Position Management

  1. RxPositionControllerThread handles trade calculations

    • Implements:
      • Time elapsed calculations
      • Position status tracking
      • Profitability calculations
  2. Strategy Execution via Controllers

    • RxStrategyAutoTradeController – Manages automated trade strategies.
    • RxOrderStopLossController – Implements stop-loss mechanisms to mitigate risk.

4. Order Management and Action Execution

  1. RxOrdersDesk stores and manages orders

    • Likely functions as an internal order book.
  2. RxActionController tracks order actions

    • Maintains an ActionMap for tracking and managing trade actions.
    • Works with RxActionExecutor to determine trade execution feasibility.
  3. RxActionExecutor executes trade actions

    • Evaluates whether an action (trade) can be executed.
    • Calls RxActionFactory to construct and realize trade actions.

5. Supporting Components

  1. RxActionFactory builds and executes trading actions

    • Connects with:
      • RxOrderFactory (to create trade orders)
      • RxOrderStopFactory (to manage stop orders)
      • RxMonitorTradeParameters (likely a risk management module).
  2. RxCommandDispatcher handles REST API requests

    • Allows external systems (like Rx GUI) to send commands via HTTP POST.

6. User Interface and External Control

  1. RX GUI (JavaFX Desktop Application)
    • Provides a graphical user interface for monitoring and controlling trades.
    • Likely interacts with RxTradeParametersDesk, RxTraderApplication, and RxSessionController for user-defined trade settings.

Summary

  • RxTrader is responsible for processing trade signals, executing orders, and managing positions.
  • Kafka acts as a central event bus, distributing signals and execution results.
  • Order execution is handled via controllers, with strategies managed in separate components.
  • An action-based execution model ensures flexible trade decision-making.
  • A JavaFX-based GUI enables external monitoring and control.

 

 

Below is a structured breakdown of the key components and their roles: