Skip to content

stock_snapshot_trade

Latest trade snapshot for one or more stocks. Returns the most recent trade execution for each symbol.

FreeValueStandardPro

Code Example

rust
let trades: Vec<TradeTick> = tdx.stock_snapshot_trade(&["AAPL"]).await?;
for t in &trades {
    println!("price={} size={}", t.get_price(), t.size);
}
python
trades = tdx.stock_snapshot_trade(["AAPL"])
for t in trades:
    print(f"price={t['price']:.2f} size={t['size']}")
go
trades, err := client.StockSnapshotTrade([]string{"AAPL"})
if err != nil {
    log.Fatal(err)
}
for _, t := range trades {
    fmt.Printf("price=%.2f size=%d\n", t.Price, t.Size)
}
cpp
auto trades = client.stock_snapshot_trade({"AAPL"});
for (auto& t : trades) {
    std::cout << "price=" << t.price
              << " size=" << t.size << std::endl;
}

Parameters

symbolsstring[]required
One or more ticker symbols
venuestringoptional
Data venue filter
min_timestringoptional
Minimum time of day as milliseconds from midnight ET

Response Fields (TradeTick)

ms_of_dayi32
Milliseconds since midnight ET
sequencei32
Sequence number
ext_condition1 through ext_condition4i32
Extended trade condition codes
conditioni32
Trade condition code
sizei32
Trade size in shares
exchangei32
Exchange code
pricei32
Fixed-point price. Use get_price() for decoded f64.
condition_flagsi32
Condition flags bitmap
price_flagsi32
Price flags bitmap
volume_typei32
0 = incremental volume, 1 = cumulative volume
records_backi32
Records back count
price_typei32
Decimal type for price decoding
datei32
Date as YYYYMMDD integer

Helper methods: get_price(), is_cancelled(), regular_trading_hours(), is_seller(), is_incremental_volume()

Notes

  • Accepts multiple symbols in a single call.
  • Prices are stored as fixed-point integers. Use the get_price() helper to get the decoded float value.

Released under the GPL-3.0-or-later License.