Price histogram
get_histogramRetrieve trading volume distribution across price levels for a contract and period to identify support, resistance, and value areas.
Instructions
Return how trading volume was distributed over price levels during a period.
Each entry is a price and IBKR's count (traded volume) at that price, sorted by
price. Useful for volume-at-price, support/resistance and value-area questions.
Default limit 200 price levels, at most 1000; when there are more, the busiest levels
are kept and `truncated` is true. Needs market-data permissions for the instrument.
Errors: not_found (no data for the period), invalid_request (bad period).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of items to return. Omit for the tool's default; larger values are capped. The result's truncated flag says whether more were available. | |
| period | No | Look-back period: '<n> days|weeks|months|years', e.g. '3 days', '1 week', '1 month'. | 1 week |
| use_rth | No | True: regular trading hours only. False: include pre-market, after-hours and overnight data. | |
| contract | Yes | The instrument. A con_id alone is unambiguous; otherwise give symbol and sec_type, plus expiry, strike and right for options. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | How many price levels IBKR returned before the limit. | |
| period | Yes | The period sent to IBKR, e.g. '1 week'. | |
| entries | Yes | Sorted by price, lowest first. When truncated, the busiest price levels (highest count) are the ones kept. | |
| use_rth | Yes | ||
| contract | Yes | ||
| truncated | No | True when the result was cut to the limit. |