Requests an expression on a timeframe lower than the chart's and returns every intrabar value as an array.
request.security_lower_tf evaluates an expression on smaller bars and collects the values that fall inside each chart bar. A 1-hour chart bar with 1-minute data returns an array of up to 60 values.
The array is oldest first and its length changes from bar to bar. Read it with array.get, array.size or the array.* statistics.
Syntax
request.security_lower_tf(symbol: series string, timeframe: series string, expression: variable, object or function of series int/float/bool/string/color/enum, or a tuple of these, ignore_invalid_symbol: series bool (optional), currency: series string (optional), ignore_invalid_timeframe: series bool (optional), calc_bars_count: simple int (optional)) -> array<type>Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| symbol | series string | required | The symbol to read. syminfo.tickerid is the chart's own symbol. |
| timeframe | series string | required | A timeframe lower than the chart's, such as "1". |
| expression | variable, object or function of series int/ | required | What to calculate on the intrabars: a series, a call, or a tuple. |
| ignore_invalid_symbol | series bool | false | When true, an unknown symbol returns an empty array instead of stopping the script. |
| currency | series string | the symbol's own currency | Currency to convert price values to. |
| ignore_invalid_timeframe | series bool | false | When true, a timeframe not lower than the chart's returns an empty array. |
| calc_bars_count | simple int | 0 | Limits how many bars are calculated. 0 means all. |
Returns
array<type>: an array with the expression's value from each intrabar inside the chart bar.
Remarks
- A timeframe equal to or above the chart's is an error unless ignore_invalid_timeframe is true.
- On Sidechair: lower-timeframe data is not available yet. The call warns and returns an empty array, so
array.sizegives 0.
Example
//@version=6
indicator("Intrabars")
bars = request.security_lower_tf(syminfo.tickerid, "1", close)
plot(array.size(bars), "Intrabars", color = color.blue, style = plot.style_columns)See also
Runs on Sidechair in part