Skip to content

Trade ​

FreeValueStandardPro

Fetch the trade at a specific time of day across a date range.

Real-time request: ​

  • Returns a real-time session from the Nasdaq Basic feed if the account has a stocks standard or pro subscription.
  • Returns a 15-minute delayed session from the UTP & CTA feeds account has the stocks value subscription subscription.

Historical request: ​

Returns the last trade reported by UTP & CTA feeds at a specified millisecond of the day. Trade condition mappings can be found here.

AAPL · 20250303 · 20250306 · 10:30:00.000
Client
Auth
Style
from thetadatadx import Client

client = Client.from_env()

rows = client.market_data.stock_at_time_trade(
    "AAPL", "20250303", "20250306", "10:30:00.000",
)
for t in rows:
    print(t.date, t.ms_of_day, t.price, t.size)
Sample response · JSON
[
  {
    "condition": 115,
    "exchange": 57,
    "ext_condition1": 255,
    "ext_condition2": 255,
    "ext_condition3": 255,
    "ext_condition4": 115,
    "price": 475.28,
    "sequence": 405549,
    "size": 1,
    "timestamp": "2024-01-16T09:30:00.088"
  }
]

Parameters ​

NameTypeRequiredDefaultDescription
symbolstringyes-Ticker symbol (e.g. AAPL)
start_datedateyes-Start date YYYYMMDD
end_datedateyes-End date YYYYMMDD
time_of_daystringyes-ET wall-clock time in HH:MM:SS.SSS (e.g. 09:30:00.000 for 9:30 AM ET; legacy 34200000 is also accepted)
venuestringnonqbVenue/exchange filter. Accepted values: nqb, utp_cta.
timeout_msintno-Per-request deadline in milliseconds. 0 means no deadline.

Response ​

Rows of TradeTick:

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. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column.
sizei32Number of contracts or shares traded.
exchangei32Exchange code where the trade executed. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column.
pricef64Trade price.
condition_flagsi32Trade condition flags bitmap.
price_flagsi32Trade price flags bitmap.
volume_typei32Volume reporting mode, as sent. The vendor does not define this column.
records_backi32Offset of this record behind the most recent record.
datei32Trading date as a YYYYMMDD integer.

Released under the Apache-2.0 License.