The idea of this script is quite simple. Imagine that you have a 200-day and its support or resistance line is the 200-week .
Then if 200 1D > 200 1W then the trend is .
That is, EMA 200 1D is the signal line, and EMA 200 1W is the resistance.
Of course, you can independently set the time interval for the signal line and resistance, as well as the number of periods.
In addition to setting time intervals and period lengths, you can optionally enable the display of additional class EMAs.
You can also set the timeframe for the signal line equal to the current time period.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.