OPEN-SOURCE SCRIPT
8/21 EMA Cross with 50 SMA Filter

Key Features:
8/21 EMA Crossover: Detects when the 8 EMA crosses above/below the 21 EMA
50 SMA Filter: Only shows signals when:
Bullish cross occurs AND price is above 50 SMA
Bearish cross occurs AND price is below 50 SMA
Visual Signals: Green "BUY" labels for filtered bullish crosses, red "SELL" labels for filtered bearish crosses
Comparison: Small gray triangles show unfiltered crosses that were rejected by the 50 SMA filter
Trend Background: Light green when above 50 SMA, light red when below
Alerts: Built-in alert conditions for both filtered signals
8/21 EMA Crossover: Detects when the 8 EMA crosses above/below the 21 EMA
50 SMA Filter: Only shows signals when:
Bullish cross occurs AND price is above 50 SMA
Bearish cross occurs AND price is below 50 SMA
Visual Signals: Green "BUY" labels for filtered bullish crosses, red "SELL" labels for filtered bearish crosses
Comparison: Small gray triangles show unfiltered crosses that were rejected by the 50 SMA filter
Trend Background: Light green when above 50 SMA, light red when below
Alerts: Built-in alert conditions for both filtered signals
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.