OPEN-SOURCE SCRIPT
AK EMA 200 Trend Filter Strategy

Strategy Description – EMA 200 Trend Filter
This strategy uses the 200-period Exponential Moving Average (EMA) as a trend filter:
Entry Rule (Long only):
A long position is opened when the price crosses above the EMA 200 and closes above it.
Exit Rule:
The long position is closed if price closes back below the EMA 200.
Optional Short Trades (disabled by default, can be enabled):
A short position is opened when the price crosses below EMA 200 and closes below it.
The short is exited when price closes back above EMA 200.
Risk Management:
Configurable Stop Loss (%) and Take Profit (%) from entry price.
If enabled, trades are automatically protected with SL/TP levels.
Visualization:
EMA 200 is plotted in orange on the chart.
Green arrows mark long entries, red arrows mark exits.
✅ Use cases:
Works best on higher timeframes (1H, 4H, Daily) as a trend-following filter.
You can combine with additional indicators (RSI, MACD) to reduce false signals.
Always test in TradingView Strategy Tester before using in live trading.
This strategy uses the 200-period Exponential Moving Average (EMA) as a trend filter:
Entry Rule (Long only):
A long position is opened when the price crosses above the EMA 200 and closes above it.
Exit Rule:
The long position is closed if price closes back below the EMA 200.
Optional Short Trades (disabled by default, can be enabled):
A short position is opened when the price crosses below EMA 200 and closes below it.
The short is exited when price closes back above EMA 200.
Risk Management:
Configurable Stop Loss (%) and Take Profit (%) from entry price.
If enabled, trades are automatically protected with SL/TP levels.
Visualization:
EMA 200 is plotted in orange on the chart.
Green arrows mark long entries, red arrows mark exits.
✅ Use cases:
Works best on higher timeframes (1H, 4H, Daily) as a trend-following filter.
You can combine with additional indicators (RSI, MACD) to reduce false signals.
Always test in TradingView Strategy Tester before using in live trading.
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.