Skip to content

Trade Quote

FreeValueStandardPro

Fetch combined trade + quote ticks for a stock on a given date. Returns raw DataTable.

Returns every trade reported by UTP & CTA paired with the last BBO quote reported by UTP or CTA at the time of trade. A quote is matched with a trade if its timestamp <= the trade timestamp. If you prefer to match quotes with timestamps that are < the trade timestamp, specify the exclusive parameter to true. Set the venue parameter to nqb to access current-day real-time historic data from the Nasdaq Basic feed if the account has a stocks standard or pro subscription.

  • Multi-day requests are limited to 1 month of data.
rust
pub fn stock_history_trade_quote(&self, symbol: &str, date: &str) -> StockHistoryTradeQuoteBuilder<'_>

Optional parameters chain on the builder: .start_time(&str), .end_time(&str), .exclusive(bool), .venue(&str), .start_date(&str), .end_date(&str). Execute with .awaitResult<Vec<TradeQuoteTick>, Error>, or decode chunk-by-chunk with .stream(handler).

Example

rust
let rows = tdx.stock_history_trade_quote("AAPL", "20250303").await?;
for t in &rows {
    println!("ms_of_day={} price={} bid={} ask={}", t.ms_of_day, t.price, t.bid, t.ask);
}

Parameters

NameTypeRequiredDefaultDescription
symbolstringyesTicker symbol (e.g. AAPL)
datedateyesDate YYYYMMDD
start_timestringno09:30:00Start time filter
end_timestringno16:00:00End time filter
exclusiveboolnotrueWhen true, quotes whose timestamp equals the trade timestamp are excluded; only quotes strictly before the trade are paired.
venuestringnonqbVenue/exchange filter. Accepted values: nqb, utp_cta.
start_datedatenoStart date YYYYMMDD
end_datedatenoEnd date YYYYMMDD
timeout_msintnoPer-request deadline in milliseconds. 0 means no deadline.

Response

Rows of TradeQuoteTick:

FieldTypeDescription
ms_of_dayi32Milliseconds since midnight Eastern Time.
sequencei32Exchange-assigned trade sequence number.
ext_condition1i32Additional trade condition code.
ext_condition2i32Additional trade condition code.
ext_condition3i32Additional trade condition code.
ext_condition4i32Additional trade condition code.
conditioni32Trade condition code.
sizei32Number of contracts or shares traded.
exchangei32Exchange code where the trade executed.
pricef64Trade price.
condition_flagsi32Trade condition flags bitmap.
price_flagsi32Trade price flags bitmap.
volume_typei32Volume reporting mode: 0 = incremental, 1 = cumulative.
records_backi32Offset of this record behind the most recent record.
quote_ms_of_dayi32Timestamp of the paired quote, milliseconds since midnight ET.
bid_sizei32Last NBBO bid size.
bid_exchangei32Exchange code of the NBBO bid.
bidf64NBBO bid at the time of the trade.
bid_conditioni32Quote condition code on the bid side.
ask_sizei32Last NBBO ask size.
ask_exchangei32Exchange code of the NBBO ask.
askf64NBBO ask at the time of the trade.
ask_conditioni32Quote condition code on the ask side.
datei32Trading date as a YYYYMMDD integer.

Example response

ms_of_daysequenceext_condition1ext_condition2ext_condition3ext_condition4conditionsizeexchangepricecondition_flagsprice_flagsvolume_typerecords_backquote_ms_of_daybid_sizebid_exchangebidbid_conditionask_sizeask_exchangeaskask_conditiondate
342000111492032951115127187.18000034200011317187.1017187.19020240102
342000148931322551115111187.18000034200011317187.1017187.19020240102
342000148932322551115151187.18000034200011317187.1017187.19020240102

Decoded from a captured production response; 3 of 8192 rows shown.

Released under the Apache-2.0 License.