Skip to main content

Module streaming

Module streaming 

Source
Expand description

HTTP chunked-transfer streaming for TradeStation v3.

TradeStation uses HTTP streaming (NOT WebSocket):

  • Content-Type: application/vnd.tradestation.streams.v3+json
  • Newline-delimited JSON objects
  • StreamStatus messages signal snapshot boundaries (EndSnapshot) and reconnect requests (GoAway)

All stream methods return a BoxStream of typed updates that can be consumed with futures::StreamExt.

§Example

use futures::StreamExt;

let mut stream = client.stream_quotes(&["AAPL"]).await?;
while let Some(result) = stream.next().await {
    let quote = result?;
    if !quote.is_status() {
        println!("{}: {}", quote.symbol.as_deref().unwrap_or("?"), quote.last.as_deref().unwrap_or("?"));
    }
}

Structs§

StreamBar
A streaming bar (OHLCV) update.
StreamMarketDepthAggregate
A streaming market depth aggregate summary.
StreamMarketDepthQuote
A streaming market depth (Level 2) quote.
StreamOptionChain
A streaming option chain update.
StreamOptionQuote
A streaming option quote update.
StreamOrder
A streaming order status update.
StreamPosition
A streaming position update.
StreamQuote
A streaming quote update.
StreamStatus
Stream status messages from TradeStation.

Type Aliases§

BoxStream
Type alias for a boxed async stream of results.