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 uses ET wall-clock format HH:MM:SS.SSS (for example 09:30:00.000). Legacy millisecond strings such as 34200000 are also accepted.
FreeValueStandardPro
Code Example
rust
let data = tdx.stock_at_time_trade("SPY", "20260101", "20260301", "09:30:00.000").await?;
for t in &data {
println!("date={} ms_of_day={} price={:.2} size={}",
t.date, t.ms_of_day, t.price, t.size);
}python
data = tdx.stock_at_time_trade("SPY", "20260101", "20260301", "09:30:00.000")
for t in data:
print(f"date={t.date} ms_of_day={t.ms_of_day} price={t.price:.2f} size={t.size}")typescript
const data = tdx.stockAtTimeTrade('SPY', '20260101', '20260301', '09:30:00.000');
for (const t of data) {
console.log(`date=${t.date} ms_of_day=${t.ms_of_day} price=${t.price} size=${t.size}`);
}cpp
auto data = client.stock_at_time_trade("SPY", "20260101", "20260301", "09:30:00.000");
for (const auto& t : data) {
printf("date=%d ms_of_day=%d price=%.2f size=%d\n", t.date, t.ms_of_day, t.price, t.size);
}Parameters
symbolstringrequiredTicker symbol
start_datestringrequiredStart date in
YYYYMMDD formatend_datestringrequiredEnd date in
YYYYMMDD formattime_of_daystringrequiredET wall-clock time in
HH:MM:SS.SSS (e.g. "09:30:00.000"; legacy "34200000" is also accepted)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
pricef64Trade price (decoded at parse time).
condition_flagsi32Condition flags bitmap
price_flagsi32Price flags bitmap
volume_typei320 = incremental volume, 1 = cumulative volumerecords_backi32Records back count
datei32Date as
YYYYMMDD integerHelper methods: is_cancelled(), regular_trading_hours(), is_seller(), is_incremental_volume()
Common Time Values
| Time (ET) | time_of_day |
|---|---|
| 9:30 AM (market open) | "09:30:00.000" |
| 10:00 AM | "10:00:00.000" |
| 12:00 PM (noon) | "12:00:00.000" |
| 3:00 PM | "15:00:00.000" |
| 4:00 PM (market close) | "16:00:00.000" |
Sample Response
json
[
{"date": 20260330, "ms_of_day": 43199998, "price": 637.34, "size": 2140},
{"date": 20260331, "ms_of_day": 43199983, "price": 639.79, "size": 100},
{"date": 20260401, "ms_of_day": 43199879, "price": 657.82, "size": 100}
]SPY trade closest to 12:00 PM ET on each date. One row per date in the range.
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.