It is based on Nick Radge's broader market filter weekend trend trader system, but can be applied to other timeframes if you want to confirm if the index is in an up trend or down trend.
• Green means the underlying index price is above the EMA
• Red means the underlying index price is below the EMA
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.