Pine Script v6: How to Use request.security to Fetch Higher-Timeframe Data
When building multi-timeframe indicators in TradingView, one of the most common needs is to overlay a higher-timeframe signal — such as a daily moving average — onto a lower-timeframe chart like a 15-minute view. The request.security() function is the primary tool for this task in Pine Script v6, and understanding its parameters precisely is essential for writing accurate, non-repainting indicators and strategies. 1. What Is request.security() ? request.security() allows a Pine Script to fetch the value of any expression as it would be calculated on a different symbol or timeframe. The result is then mapped back onto the current chart's bar timeline. This is the foundation of multi-timeframe (MTF) analysis in Pine Script. For the full official signature, refer to the Reference Manual: request.security() — Pine Script v6 Reference . 2. Core Parameters Explained The following table describes the most critical parameters you will u...