request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol) → Use code with caution. Copied to clipboard Parameters
Think of it as: "Go to this symbol and timeframe, run this code there, then bring the result back to my current chart." pine script v5 request.security function documentation
// Plot the close price on the current chart plot(aaplClose) request
request.security(sym, resolution, expr, [options]) run this code there
//@version=5 indicator("Daily Close on Intraday", overlay=true) // Fetch daily close price for the current symbol dailyClose = request.security(syminfo.tickerid, "D", close) plot(dailyClose, color=color.new(color.blue, 0), linewidth=2) Use code with caution. Copied to clipboard