historical_data
Fetch OHLCV historical bars for Interactive Brokers contracts by symbol or conId with configurable duration, bar size, and data type to analyze price trends.
Instructions
Get OHLCV historical bars. Supports durations like "1 D", "1 W", "1 M", "1 Y". Bar sizes: "1 min", "5 mins", "1 hour", "1 day", etc.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"durationStr": "<durationStr>",
"barSizeSetting": "<barSizeSetting>"
},
"name": "historical_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conId | No | ||
| symbol | No | ||
| useRTH | No | Regular trading hours only (default: true) | |
| secType | No | ||
| currency | No | ||
| exchange | No | ||
| whatToShow | No | Data type: TRADES, MIDPOINT, BID, ASK, etc. | |
| durationStr | Yes | Duration: "1 D", "5 D", "1 W", "1 M", "3 M", "1 Y" | |
| endDateTime | No | End date/time (YYYYMMDD HH:mm:ss TZ or empty for now) | |
| barSizeSetting | Yes | Bar size: "1 min", "5 mins", "15 mins", "1 hour", "1 day" |