Skip to content

Index Endpoints (9)

List

rust
let symbols: Vec<String> = tdx.index_list_symbols().await?;
let dates: Vec<String> = tdx.index_list_dates("SPX").await?;
python
symbols = tdx.index_list_symbols()
dates = tdx.index_list_dates("SPX")
go
symbols, _ := client.IndexListSymbols()
dates, _ := client.IndexListDates("SPX")
cpp
auto symbols = client.index_list_symbols();
auto dates = client.index_list_dates("SPX");

Snapshots

rust
let ohlc: Vec<OhlcTick> = tdx.index_snapshot_ohlc(&["SPX", "NDX"]).await?;
let ticks: Vec<PriceTick> = tdx.index_snapshot_price(&["SPX", "NDX"]).await?;
let ticks: Vec<MarketValueTick> = tdx.index_snapshot_market_value(&["SPX"]).await?;
python
ohlc = tdx.index_snapshot_ohlc(["SPX", "NDX"])
price = tdx.index_snapshot_price(["SPX", "NDX"])
mv = tdx.index_snapshot_market_value(["SPX"])
go
ohlc, _ := client.IndexSnapshotOHLC([]string{"SPX", "NDX"})
price, _ := client.IndexSnapshotPrice([]string{"SPX"})
mv, _ := client.IndexSnapshotMarketValue([]string{"SPX"})
cpp
auto ohlc = client.index_snapshot_ohlc({"SPX", "NDX"});
auto price = client.index_snapshot_price({"SPX"});
auto mv = client.index_snapshot_market_value({"SPX"});

History

rust
let eod: Vec<EodTick> = tdx.index_history_eod("SPX", "20240101", "20240301").await?;

let bars: Vec<OhlcTick> = tdx.index_history_ohlc(
    "SPX", "20240101", "20240301", "60000"
).await?;

let ticks: Vec<PriceTick> = tdx.index_history_price("SPX", "20240315", "60000").await?;
python
eod = tdx.index_history_eod("SPX", "20240101", "20240301")
df = tdx.index_history_eod_df("SPX", "20240101", "20240301")
bars = tdx.index_history_ohlc("SPX", "20240101", "20240301", "60000")
price = tdx.index_history_price("SPX", "20240315", "60000")
go
eod, _ := client.IndexHistoryEOD("SPX", "20240101", "20240301")
bars, _ := client.IndexHistoryOHLC("SPX", "20240101", "20240301", "60000")
priceHist, _ := client.IndexHistoryPrice("SPX", "20240315", "60000")
cpp
auto eod = client.index_history_eod("SPX", "20240101", "20240301");
auto bars = client.index_history_ohlc("SPX", "20240101", "20240301", "60000");
auto price_hist = client.index_history_price("SPX", "20240315", "60000");

At-Time

rust
let ticks: Vec<PriceTick> = tdx.index_at_time_price(
    "SPX", "20240101", "20240301", "34200000"
).await?;
python
result = tdx.index_at_time_price("SPX", "20240101", "20240301", "34200000")
go
atTime, _ := client.IndexAtTimePrice("SPX", "20240101", "20240301", "34200000")
cpp
auto at_time = client.index_at_time_price("SPX", "20240101", "20240301", "34200000");

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