Running TradingView indicators on higher time frames is a very common question by users. Thankfully, TradingView and the PineCoders team have introduced a way to make this easy for us.
Take a look at the following chart. What we did was add the same indicator to the chart three times, but we changed the new resolution
parameter in the study()
function each time.
Here, the red moving average uses the resolution of the time frame you’re looking at. Yellow uses the resolution of 240
(which is 4 hours). And blue uses the resolution D
which is one day.
Here’s the code that shows the resolution
parameter being used to set this script to run on data from the daily "D"
chart.
If you usually look at charts on a smaller time frame, but like to run your indicators on a higher time frame, this new parameter might just be your new best friend.
One thing to keep in mind, is this doesn’t work when the resolution specified is smaller than the timeframe you’re looking at.
Here’s the same exact chart setup, but looking at the weekly W
chart. Without changing the code or the indicators, we can see that the red line still shows properly. (Remember the red line is a smoothed moving average of the current time frame.) But the yellow and blue lines are essentially invisible. They’re so close to the price action that they’re essentially unusable here.
Did this help you? Give us a Like or Follow in TradingView, and join our Discord for more Pine Script tutorials and help.