OPEN-SOURCE SCRIPT
Aggiornato Buy/Sell EMA Trend Filter v6

Buy/Sell EMA Trend Filter v6
This indicator provides a comprehensive trading system based on EMA crossovers with trend filtering for TradingView. It's designed to identify high-probability buy and sell signals by combining short-term crossovers with longer-term trend direction confirmation.
Key Features:
EMA Crossover System: Uses fast and slow EMAs (9 and 21 by default) to generate initial signals
Trend Filtering: Confirms signals with longer-term trend direction (50 and 200 EMAs)
Automatic TP/SL Calculation: Displays clear take profit and stop loss levels based on fixed risk points
Visual Alerts: Clear buy/sell markers at the point of signal with detailed labels
Risk Management: Pre-calculated risk-to-reward setup (default 1:2 ratio)
How It Works:
Buy Signal: When the fast EMA crosses above the slow EMA while the 50 EMA is above the 200 EMA (bullish trend)
Sell Signal: When the fast EMA crosses below the slow EMA while the 50 EMA is below the 200 EMA (bearish trend)
Customizable Parameters:
Fast EMA period (default: 9)
Slow EMA period (default: 21)
Trend EMA periods (default: 50 and 200)
Fixed risk in points (default: 20)
Reward ratio (default: 2.0)
The indicator displays clear entry points with predefined stop loss and take profit levels, making it ideal for traders looking for a systematic approach to the markets. Perfect for both day trading and swing trading timeframes.
This tool combines both trend following and momentum principles to filter out low-probability trades and focus on high-quality setups where the trend and momentum align.
This indicator provides a comprehensive trading system based on EMA crossovers with trend filtering for TradingView. It's designed to identify high-probability buy and sell signals by combining short-term crossovers with longer-term trend direction confirmation.
Key Features:
EMA Crossover System: Uses fast and slow EMAs (9 and 21 by default) to generate initial signals
Trend Filtering: Confirms signals with longer-term trend direction (50 and 200 EMAs)
Automatic TP/SL Calculation: Displays clear take profit and stop loss levels based on fixed risk points
Visual Alerts: Clear buy/sell markers at the point of signal with detailed labels
Risk Management: Pre-calculated risk-to-reward setup (default 1:2 ratio)
How It Works:
Buy Signal: When the fast EMA crosses above the slow EMA while the 50 EMA is above the 200 EMA (bullish trend)
Sell Signal: When the fast EMA crosses below the slow EMA while the 50 EMA is below the 200 EMA (bearish trend)
Customizable Parameters:
Fast EMA period (default: 9)
Slow EMA period (default: 21)
Trend EMA periods (default: 50 and 200)
Fixed risk in points (default: 20)
Reward ratio (default: 2.0)
The indicator displays clear entry points with predefined stop loss and take profit levels, making it ideal for traders looking for a systematic approach to the markets. Perfect for both day trading and swing trading timeframes.
This tool combines both trend following and momentum principles to filter out low-probability trades and focus on high-quality setups where the trend and momentum align.
Note di rilascio
What it doesA EMA crossover indicator that signals BUY when EMA 9 crosses above EMA 21 in an uptrend and SELL when EMA 9 crosses below EMA 21 in a downtrend, filtered by 50/200 EMAs to trade with the prevailing trend. It auto-labels Entry/TP/SL and fires actionable alerts with prices.
How it works
Signals: 9/21 EMA crossover aligned with 50/200 EMA trend filter.
Risk tools: Fixed points for stop loss and take profit with user-defined R:R.
Visuals: Clean labels showing Entry, TP, and SL on the chart.
Alerts: Buy/Sell alerts on bar close with price, TP, and SL details.
Inputs
Fast EMA, Slow EMA, Trend EMA (Short) 50, Trend EMA (Long) 200, Fixed Risk in Points, Reward Ratio (R), Enable Alerts.
Usage
Best for trending markets on intraday or swing timeframes.
Consider additional confirmation (ATR/volume/SR) in choppy ranges.
Set alerts: “Buy Alert” or “Sell Alert” to receive entry with TP/SL.
Alerts included
Buy Alert: EMA 9 > EMA 21 with bullish trend filter.
Sell Alert: EMA 9 < EMA 21 with bearish trend filter.
Tags
EMA, EMA9, EMA21, EMA50, EMA200, crossover, trend filter, buy sell signals, TP SL, alert, day trading, swing trading, risk management
Note di rilascio
What it doesAn EMA crossover indicator that signals BUY when EMA 9 crosses above EMA 21 in an uptrend and SELL when EMA 9 crosses below EMA 21 in a downtrend, filtered by 50/200 EMAs to trade with the prevailing trend. It auto-labels Entry/TP/SL and fires actionable alerts with prices, with risk managed via either Fixed Ticks or ATR multiples.
How it works
Signals: 9/21 EMA crossover aligned with 50/200 EMA trend filter.
Risk tools: Choose Fixed Ticks (ticks × tick size) or ATR × multiple for adaptive SL/TP; TP is set by the user-defined R:R.
Visuals: Clean labels showing Entry, TP, SL, and the risk mode used.
Alerts: Buy/Sell alerts on bar close with Entry/TP/SL and risk mode details.
Inputs
Fast EMA, Slow EMA, Trend EMA (Short) 50, Trend EMA (Long) 200, Risk Mode (Fixed Ticks / ATR × Multiple), Fixed Risk (Ticks), ATR Length, ATR Multiple, Reward Ratio (R), Round Distances to Tick, Enable Alerts.
Usage
Best for trending markets on intraday or swing timeframes.
Start with Fixed Ticks (default 20-tick SL, 2:1 R:R), then compare ATR mode for volatility-adjusted sizing.
Set alerts: “Buy Alert” or “Sell Alert” to receive entries with TP/SL and mode info.
Alerts included
Buy Alert: EMA 9 > EMA 21 with bullish 50/200 trend filter.
Sell Alert: EMA 9 < EMA 21 with bearish 50/200 trend filter.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.