Learn
Scripting Tips and Tricks

How do I use different time frames in a strategy?

if you want to use a higher timeframe in your strategy, you have to use the resize() function this can be done in 2 ways resize a close and use this to calculate the ema this will update every candle close1h = resize(close, "1h") ema1h = ema(close1h,21) resize an entire function this will only update every resized candle res = resinput("mtf", "1d", \["4h", "6h", "12h", "1d", "1w"]) def std = resize(res) { stdev(close, ma len) } an example can be found in the public library click here for the link https //app tuned com/editor/public/3531