Skip to content

stock_at_time_quote

Retrieve the NBBO quote at a specific time of day across a date range. Returns one quote per date, representing the prevailing best bid/ask at the specified time.

The time_of_day parameter is milliseconds from midnight ET (e.g., 34200000 = 9:30 AM).

FreeValueStandardPro

Code Example

rust
// Quote at 9:30 AM across Q1 2024
let quotes: Vec<QuoteTick> = tdx.stock_at_time_quote(
    "AAPL", "20240101", "20240301", "34200000"
).await?;
for q in &quotes {
    println!("{}: bid={} ask={}", q.date, q.bid_price(), q.ask_price());
}
python
# Quote at 9:30 AM across Q1 2024
quotes = tdx.stock_at_time_quote("AAPL", "20240101", "20240301", "34200000")
for q in quotes:
    print(f"{q['date']}: bid={q['bid']:.2f} ask={q['ask']:.2f}")
go
// Quote at 9:30 AM across Q1 2024
quotes, err := client.StockAtTimeQuote("AAPL", "20240101", "20240301", "34200000")
if err != nil {
    log.Fatal(err)
}
for _, q := range quotes {
    fmt.Printf("%d: bid=%.2f ask=%.2f\n", q.Date, q.Bid, q.Ask)
}
cpp
// Quote at 9:30 AM across Q1 2024
auto quotes = client.stock_at_time_quote("AAPL", "20240101", "20240301", "34200000");
for (auto& q : quotes) {
    std::cout << q.date << ": bid=" << q.bid
              << " ask=" << q.ask << std::endl;
}

Parameters

symbolstringrequired
Ticker symbol
start_datestringrequired
Start date in YYYYMMDD format
end_datestringrequired
End date in YYYYMMDD format
time_of_daystringrequired
Milliseconds from midnight ET (e.g. "34200000" = 9:30 AM)
venuestringoptional
Data venue filter

Response Fields (QuoteTick)

ms_of_dayi32
Milliseconds since midnight ET
bid_size / ask_sizei32
Quote sizes
bid_exchange / ask_exchangei32
Exchange codes
bid / aski32
Fixed-point prices. Use bid_price(), ask_price(), midpoint_price() for decoded values.
bid_condition / ask_conditioni32
Condition codes
price_typei32
Decimal type for price decoding
datei32
Date as YYYYMMDD integer

Helper methods: bid_price(), ask_price(), midpoint_price(), midpoint_value()

Common Time Values

Time (ET)Milliseconds
9:30 AM (market open)"34200000"
10:00 AM"36000000"
12:00 PM (noon)"43200000"
3:00 PM"54000000"
4:00 PM (market close)"57600000"

Notes

  • Returns one QuoteTick per trading day in the date range.
  • Useful for building daily spread time series or comparing bid/ask dynamics at a fixed time across trading sessions.
  • The returned quote is the NBBO prevailing at the specified time.

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