Pine Script V5 Request.security Function Documentation Info

request.security(syminfo.tickerid, "60", close, lookahead = barmerge.lookahead_off) ❌

get_htf_ma(ma_len) => request.security(syminfo.tickerid, "1D", ta.sma(close, ma_len)) plot(get_htf_ma(20)) | v4 | v5 | |----|----| | security(sym, tf, expr) | request.security(sym, tf, expr) | | Gaps via set parameter | Explicit gaps= parameter | | No tuple support | Tuple support ✅ | | Lookahead implicit | lookahead= explicit | 🧠 Pro Tip: Accessing Previous HTF Values Because HTF data only changes when a new HTF bar forms: pine script v5 request.security function documentation

// Plot the ratio of BTC to ETH btc_price = request.security("BINANCE:BTCUSDT", "60", close) eth_price = request.security("BINANCE:ETHUSDT", "60", close) ratio = btc_price / eth_price plot(ratio, "BTC/ETH Ratio") No – it must be at the global scope . But you can wrap it in a function: request