Skip to content

option_snapshot_ohlc

FreeValueStandardPro

Get the latest OHLC (open, high, low, close) snapshot for an option contract.

Code Example

rust
let bars: Vec<OhlcTick> = tdx.option_snapshot_ohlc("SPY", "20241220", "500000", "C").await?;
python
bars = tdx.option_snapshot_ohlc("SPY", "20241220", "500000", "C")
go
bars, err := client.OptionSnapshotOHLC("SPY", "20241220", "500000", "C")
cpp
auto bars = client.option_snapshot_ohlc("SPY", "20241220", "500000", "C");

Parameters

symbolstringrequired
Underlying symbol
expirationstringrequired
Expiration date in YYYYMMDD format
strikestringrequired
Strike price as scaled integer (e.g. "500000" for $500)
rightstringrequired
"C" for call, "P" for put
max_dteintoptional
Maximum days to expiration
strike_rangeintoptional
Strike range filter
min_timestringoptional
Minimum time of day as milliseconds from midnight

Response

openfloat
Opening price
highfloat
High price
lowfloat
Low price
closefloat
Closing price
volumeint
Volume
datestring
Date
ms_of_dayint
Milliseconds from midnight

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