OHLC
FreeValueStandardPro
Get the latest OHLC snapshot for one or more indices.
- Retrieves the real-time current day OHLC.
- Exchanges typically generate a price report every second for popular indices like SPX.
rust
pub fn index_snapshot_ohlc(&self, symbols: &[&str]) -> IndexSnapshotOhlcBuilder<'_>Optional parameters chain on the builder: .min_time(&str). Execute with .await → Result<Vec<OhlcTick>, Error>, or decode chunk-by-chunk with .stream(handler).
Example
rust
let rows = tdx.index_snapshot_ohlc(&["SPX"]).await?;
for t in &rows {
println!("date={} open={} high={} low={} close={}", t.date, t.open, t.high, t.low, t.close);
}Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | symbols | yes | — | Comma-separated ticker symbols (e.g. AAPL,MSFT) |
min_time | string | no | — | Minimum time filter |
timeout_ms | int | no | — | Per-request deadline in milliseconds. 0 means no deadline. |
Response
Rows of OhlcTick:
| Field | Type | Description |
|---|---|---|
ms_of_day | i32 | Opening time of the bar, milliseconds since midnight ET. |
open | f64 | Opening trade price. |
high | f64 | Highest traded price. |
low | f64 | Lowest traded price. |
close | f64 | Closing traded price. |
volume | i64 | Number of contracts or shares traded. |
count | i64 | Number of trades. |
vwap | f64 | Volume-weighted average price of the session. |
date | i32 | Trading date as a YYYYMMDD integer. |