stock_at_time_trade
Retrieve the trade at a specific time of day across a date range. Returns one trade per date, representing the trade that occurred at or just before the specified time.
The time_of_day parameter is milliseconds from midnight ET (e.g., 34200000 = 9:30 AM).
FreeValueStandardPro
Code Example
rust
// Trade at 9:30 AM across Q1 2024
let trades: Vec<TradeTick> = tdx.stock_at_time_trade(
"AAPL", "20240101", "20240301", "34200000"
).await?;
for t in &trades {
println!("{}: price={}", t.date, t.get_price());
}python
# Trade at 9:30 AM across Q1 2024
trades = tdx.stock_at_time_trade("AAPL", "20240101", "20240301", "34200000")
for t in trades:
print(f"{t['date']}: price={t['price']:.2f}")go
// Trade at 9:30 AM across Q1 2024
trades, err := client.StockAtTimeTrade("AAPL", "20240101", "20240301", "34200000")
if err != nil {
log.Fatal(err)
}
for _, t := range trades {
fmt.Printf("%d: price=%.2f\n", t.Date, t.Price)
}cpp
// Trade at 9:30 AM across Q1 2024
auto trades = client.stock_at_time_trade("AAPL", "20240101", "20240301", "34200000");
for (auto& t : trades) {
std::cout << t.date << ": price=" << t.price << std::endl;
}Parameters
symbolstringrequiredTicker symbol
start_datestringrequiredStart date in
YYYYMMDD formatend_datestringrequiredEnd date in
YYYYMMDD formattime_of_daystringrequiredMilliseconds from midnight ET (e.g.
"34200000" = 9:30 AM)venuestringoptionalData venue filter
Response Fields (TradeTick)
ms_of_dayi32Milliseconds since midnight ET
sequencei32Sequence number
ext_condition1 through ext_condition4i32Extended trade condition codes
conditioni32Trade condition code
sizei32Trade size in shares
exchangei32Exchange code
pricei32Fixed-point price. Use
get_price() for decoded f64.condition_flagsi32Condition flags bitmap
price_flagsi32Price flags bitmap
volume_typei320 = incremental volume, 1 = cumulative volumerecords_backi32Records back count
price_typei32Decimal type for price decoding
datei32Date as
YYYYMMDD integerHelper methods: get_price(), is_cancelled(), regular_trading_hours(), is_seller(), is_incremental_volume()
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 TradeTick per trading day in the date range.
- Useful for building daily time series at a consistent intraday timestamp (e.g., "price at 10:00 AM every day").
- The returned trade is the one that occurred at or just before the specified time.