request.security
Value of an expression on another timeframe and/or symbol. The expression runs on the requested bars (its ta.* calls use those bars) and the script sees the value of the newest requested bar that has closed by the end of the current bar, so there is no look-ahead: a daily value appears once the day has ended. Returns a series, or several for a tuple expression.
request.security(symbol: simple string, timeframe: simple string, expression: any, gaps: const bool = false, lookahead: const bool = false) -> float
Parameters
symbolsimple string: a platform symbol such as "NQ", or syminfo.tickerid / "" for the chart symboltimeframesimple string: "5m", "1h", "4h", "1D", "1W", "1M" (also "D", "W", "M", "60", "240"); "" = the chart timeframeexpressionany: any number, bool or color expression, or a tuple [a, b]; may use inputs, functions and variables declared once with =gapsconst bool: barmerge.gaps_on: na except on the bar where a new value first appearslookaheadconst bool: only barmerge.lookahead_off (the default); barmerge.lookahead_on is a compile error because scripts never see future values
Example
dailyClose = request.security(syminfo.tickerid, "1D", close)