Skip to content

stock_history_eod

End-of-day stock data across a date range. Each row contains the full daily OHLC bar plus closing bid/ask quote data (18 fields total).

FreeValueStandardPro

Code Example

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

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

Parameters

symbolstringrequired
Ticker symbol (e.g. "AAPL")
start_datestringrequired
Start date in YYYYMMDD format
end_datestringrequired
End date in YYYYMMDD format. Range is inclusive on both ends.

Response Fields (EodTick)

ms_of_day / ms_of_day2i32
Timestamps (milliseconds since midnight Eastern Time)
open / high / low / closei32
Fixed-point OHLC prices. Use open_price(), high_price(), low_price(), close_price() to get decoded f64 values.
volumei32
Total daily volume
counti32
Total trade count for the day
bid_size / ask_sizei32
Closing quote sizes
bid_exchange / ask_exchangei32
Closing quote exchange codes
bid / aski32
Closing bid/ask prices (fixed-point). Use bid_price(), ask_price(), midpoint_value().
bid_condition / ask_conditioni32
Closing quote condition codes
price_typei32
Decimal type used for fixed-point price decoding
datei32
Date as YYYYMMDD integer

Notes

  • Python users can use the _df variant to get a pandas DataFrame directly: tdx.stock_history_eod_df(...). Requires pip install thetadatadx[pandas].
  • EOD data includes the closing NBBO quote alongside OHLCV, making it suitable for strategies that need both price and spread information.
  • All dates use YYYYMMDD format. The range is inclusive on both ends.

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