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
symbolstringrequiredIndex symbol (e.g.
"SPX")start_datestringrequiredStart date in
YYYYMMDD formatend_datestringrequiredEnd date in
YYYYMMDD formatResponse
dateu32Date as
YYYYMMDD integeropenf64Opening price/level
highf64High price/level
lowf64Low price/level
closef64Closing price/level
volumeu64Volume
Notes
- Returns one row per trading day in the range. Non-trading days are excluded.
- Python users can use the
_dfvariant to get a pandas DataFrame directly.