'Pinescript to generate buy/sell signal on multiple time frames simultaneously

I need one pine script where the buy or signal gets generated on multiple time frames. e.g. I have a strategy which runs on 10 min timeframe I want the final Buy/Sell signal to be generate only if they are generated on lower time frame like 1min, 2min, 3min and 5 min simultaneously.



Solution 1:[1]

You can calculate buy/sell signal conditions from another chart scope (other TF) by using request.security() function and then, based of this calculations, calculate another buy/sell conditions for the current chart:

https://www.tradingview.com/pine-script-docs/en/v5/concepts/Other_timeframes_and_data.html#request-security

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Starr Lucky