Skip to content

index_history_eod

FreeValueStandardPro

Retrieve end-of-day data for an index across a date range. Returns one row per trading day with open, high, low, close, and volume.

Code Example

rust
let eod: Vec<EodTick> = tdx.index_history_eod("SPX", "20240101", "20240301").await?;
for t in &eod {
    println!("{}: O={} H={} L={} C={}",
        t.date, t.open_price(), t.high_price(), t.low_price(), t.close_price());
}
python
eod = tdx.index_history_eod("SPX", "20240101", "20240301")
for tick in eod:
    print(f"{tick['date']}: O={tick['open']:.2f} C={tick['close']:.2f}")

# DataFrame variant
df = tdx.index_history_eod_df("SPX", "20240101", "20240301")
print(df.describe())
go
eod, err := client.IndexHistoryEOD("SPX", "20240101", "20240301")
if err != nil {
    log.Fatal(err)
}
for _, tick := range eod {
    fmt.Printf("%d: O=%.2f H=%.2f L=%.2f C=%.2f\n",
        tick.Date, tick.Open, tick.High, tick.Low, tick.Close)
}
cpp
auto eod = client.index_history_eod("SPX", "20240101", "20240301");
for (auto& tick : eod) {
    std::cout << tick.date << ": O=" << tick.open << " H=" << tick.high
              << " L=" << tick.low << " C=" << tick.close << std::endl;
}

Parameters

symbolstringrequired
Index symbol (e.g. "SPX")
start_datestringrequired
Start date in YYYYMMDD format
end_datestringrequired
End date in YYYYMMDD format

Response

dateu32
Date as YYYYMMDD integer
openf64
Opening price/level
highf64
High price/level
lowf64
Low price/level
closef64
Closing price/level
volumeu64
Volume

Notes

  • Returns one row per trading day in the range. Non-trading days are excluded.
  • Python users can use the _df variant to get a pandas DataFrame directly.

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