Read a range
The app reads one period of a chart: the open, close, high, low, change, volume, biggest moves, and your indicators at the start and end.
Details#
Read one period of a chart as a summary: the facts of the bars from from to to, on closed bars only. Use it when the member asks about a period, for example a range they selected on the chart, before you explain the move or search for what caused it. The period is the bar that contains from through the bar that contains to, like set_visible_range. A period that reaches the bar still forming ends at the newest closed bar and the answer has forming_bar excluded. A start before the chart's history starts at its first bar; clamped says which side was moved (start, end, min_bars). A period entirely outside the history is refused with range_outside_history. The answer has market, range (from, to: the first and last bar's dates in UTC; bars: how many), open (the first bar's open), close (the last bar's close), change and change_pct (from that open to that close), high and low (the highest high and lowest low, each with the time of its bar), high_low_pct (the high above the low, in percent), volume (the sum of the bars' volumes, or null with volume_note when the market has none), biggest_moves (at most 3 single bars with the largest move, close against the previous bar's close, biggest first: time, change_pct, close), indicators (each built-in study line on that layout at the first and the last bar of the period: { id, type, inputs, name, start: { time, value }, end: { time, value } }, at most 12 rows), studies (every copy on the layout as { id, type, inputs }), history_start and history_end (the chart's closed history). It never returns the period's bars, so it does not count toward date-focused reads. BullScript™ scripts are listed in studies but not computed here: call read_chart with bar set to a date, or run_bullscript, for their values. It works on the chart the member is viewing when symbol, venue, timeframe and layout are omitted, and does not change the chart. Example, 3 March to 10 June 2024 on BTC/USDT 1D: {"symbol": "BTC/USDT", "venue": "BINANCE", "timeframe": "1D", "from": "2024-03-03", "to": "2024-06-10"}.
Inputs#
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Optional | Ticker or pair, for example BTCUSDT or AAPL. |
| venue | string | Optional | Optional venue, for example BINANCE, COINBASE, BITSTAMP or NASDAQ. BINANCE is Binance spot, not Binance futures. |
| kind | string | Optional | Optional. spot or perp. Omit to open a spot market. Perpetuals are only opened when kind is perp or the venue is a futures venue. |
| timeframe | string | Optional | One of 1H, 4H, 1D, 1W, 1M. Example: 1D. |
| layout | string | Optional | Layout name from list_layouts, or "Default" (the member's own chart). Omit to use the layout the member has open, or Default when no chart is open. |
| from | string or number | Required | Start of the period: a UTC date "2024-03-03" (00:00 UTC), a UTC date and time "2024-03-03 14:00", an ISO 8601 time with an offset, or unix seconds (not milliseconds). The period starts at the bar that contains it. |
| to | string or number | Required | End of the period, in the same formats as from. A date alone means the end of that UTC day, so to 2024-06-10 includes 10 June. The period ends at the bar that contains it. |