Get price history
get_price_historyFetch OHLC candlestick price history for a broker symbol and timeframe, returning recent bars or a specified date window from an account.
Instructions
OHLC candles for one symbol from this account's broker. Returns the most recent limit bars (default 100, max 500) in the window; omit from/to for the latest bars. A window spanning more than 20000 bars is refused (narrow it or pick a larger timeframe). For the current price only, use get_quotes.
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": {
"account_id": "<account_id>",
"symbol": "<symbol>",
"timeframe": "<timeframe>"
},
"name": "get_price_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of the window. Defaults to now. Date (YYYY-MM-DD) or ISO-8601 datetime, in the broker's server time. | |
| from | No | Start of the window. Date (YYYY-MM-DD) or ISO-8601 datetime, in the broker's server time. | |
| limit | No | ||
| symbol | Yes | Exact broker symbol name (see search_symbols). | |
| timeframe | Yes | Bar size, M1 to MN1. The same nine on MT4, MT5 and cTrader. | |
| account_id | Yes | An account_id from list_accounts. |