request
Functions
security
pine
request.security(
simple string symbol,
simple string timeframe,
instructions<T> expression,
simple string gaps = barmerge.gaps_off,
simple string lookahead = barmerge.lookahead_off,
simple bool ignore_invalid_symbol = false,
simple string currency = na,
simple int calc_bars_count = na
) → series TRequests data from another symbol and/or timeframe.
Evaluates the expression argument using bars from the specified symbol and timeframe and returns the result as a series on the current chart.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
symbol | simple string | The symbol to request data for. | |
timeframe | simple string | The timeframe string (e.g. "D", "60", "W"). | |
expression | instructions<T> | The expression to evaluate against the requested data. | |
gaps | simple string | barmerge.gaps_off | Gap-fill strategy. Use barmerge.gaps_off (default) to fill gaps with the previous value, or barmerge.gaps_on to keep gaps as na. |
lookahead | simple string | barmerge.lookahead_off | Lookahead mode. Use barmerge.lookahead_off (default) to avoid lookahead bias, or barmerge.lookahead_on to allow it. |
ignore_invalid_symbol | simple bool | false | If true, returns na for unknown symbols instead of raising an error. |
currency | simple string | na | Optional currency for price conversions. |
calc_bars_count | simple int | na | Optional maximum number of historical bars to calculate. |
Returns: series T
security_lower_tf
pine
request.security_lower_tf(
simple string symbol,
simple string timeframe,
instructions<T> expression,
simple bool ignore_invalid_symbol = false,
simple string currency = na,
simple bool ignore_invalid_timeframe = false,
simple int calc_bars_count = na
) → series array<T>Requests data from a lower timeframe, returning an array of values — one element per lower-timeframe bar within the current chart bar.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
symbol | simple string | The symbol to request data for. | |
timeframe | simple string | The timeframe string (e.g. "1", "5"). Must be lower than or equal to the chart timeframe. | |
expression | instructions<T> | The expression to evaluate for each lower-TF bar. | |
ignore_invalid_symbol | simple bool | false | If true, returns na for unknown symbols instead of raising an error. |
currency | simple string | na | Optional currency for price conversions. |
ignore_invalid_timeframe | simple bool | false | If true, returns na when the requested timeframe is not lower than the chart timeframe instead of raising an error. |
calc_bars_count | simple int | na | Optional maximum number of historical bars to calculate. |
Returns: series array<T>