High-level broker trading source: place / modify / cancel plus subscriptions to orders and positions. NOTE: the trade tier's OrderEngine uses the smaller OrderFeed (place / modify / cancel, from openalgo-charts/trade), which is what OpenAlgoTradeFeed implements. Implement OrderFeed for the engine's write path; use TradeFeed for a higher-level broker abstraction.

interface TradeFeed {
    cancelOrder(orderId: string): Promise<void>;
    modifyOrder(orderId: string, patch: Partial<PlaceOrder>): Promise<void>;
    placeOrder(o: PlaceOrder): Promise<{ orderId: string }>;
    subscribeOrders(cb: (orders: unknown[]) => void): UnsubscribeFn;
    subscribePositions(cb: (positions: unknown[]) => void): UnsubscribeFn;
}

Methods

  • Parameters

    • orderId: string

    Returns Promise<void>