Price history
br_historyFetch stock price history as Mofid OHLC candles from 1-minute to weekly or Agah daily rows with buy and sell flows, so you can analyze trends and trading activity.
Instructions
Return price history of a stock: Mofid OHLC candles (1 minute to weekly) or Agah daily rows with buy and sell flows.
The two shapes differ. Mofid: open, high, low, close, volume, value, oldest first, time in Tehran time, and it works
for indices, funds and options too. Agah: daily last and close price, volume, value and real/legal buyer and seller
counts, no OHLC, daily only. Prices are Rial. Use br_index for index history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Mofid: calendar days back. Minute candles older than a few weeks may be missing. | |
| limit | No | Newest N rows (Agah: at most 250 trading days). | |
| source | No | mofid (default) = OHLC candles; agah = daily rows with individual vs institutional flows; all = both. | mofid |
| symbol | Yes | Symbol, company name part, or ISIN. Mofid also takes index, fund and option ISINs. | |
| adjusted | No | Mofid: prices adjusted for capital increases and dividends. | |
| resolution | No | Candle size: minutes (1 to 60), '1D' daily or '1W' weekly. Agah has only '1D'. | 1D |