ibkr_historical_bars
Retrieve historical price bars for any IBKR contract using configurable bar size, duration, and data source. Access read-only market data directly from IBKR Gateway for analysis.
Instructions
Fetch read-only historical bars for a contract from IBKR Gateway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useRTH | No | If true, restrict bars to regular trading hours. | |
| barSize | No | Historical bar size. | 5 mins |
| contract | Yes | A specific IBKR contract. For reliable results, include symbol, secType, exchange, and currency. | |
| formatDate | No | 1 for string timestamps, 2 for Unix epoch timestamps. | |
| whatToShow | No | IBKR data source for the bars. | TRADES |
| durationStr | No | IB duration string such as "1 D", "2 W", or "1 M". | 1 D |
| endDateTime | No | Optional end datetime in IB format (YYYYMMDD HH:mm:ss) or omit for now. |