OPEN-SOURCE SCRIPT
EMA Cross Strategy (ema_cross)

A trend-following strategy built around a 50/200 EMA cross, filtered by RSI momentum, volume confirmation, and trend strength — designed to avoid low-conviction chop and only fire on trades with volume and momentum behind them.
How it works:
-Trend detection: Fast/slow EMA (default 50/200) establishes directional bias
-Momentum filter: RSI must confirm overbought/oversold conditions in the direction of the trade
-Volume confirmation: Entries require volume to exceed a multiple of its moving average, filtering out low-participation moves
-Trend strength filter: A minimum EMA spread threshold avoids entries during flat/ranging conditions
-Volatility-adaptive TP/SL: Take-profit and stop-loss percentages scale with a short/long ATR ratio, widening in high-volatility regimes and tightening in calm ones
-Volatility-adaptive position sizing: Position size scales inversely with ATR%, so size shrinks automatically in choppy/volatile conditions
-Risk controls: Daily trade cap, daily loss cap (% of equity), and an automatic pause after a configurable streak of consecutive take-profit wins (to avoid over-trading a hot streak into reversal)
-Session filter: Optional block on entries during a low-liquidity UTC window
Inputs are fully configurable — EMA/RSI/ATR lengths, volume and trend thresholds, TP/SL bounds, position sizing caps, leverage, and daily risk limits can all be adjusted to fit different symbols and timeframes.
Notes:
-Backtested with a 0.04% commission and 1-tick slippage assumption to reflect realistic futures execution costs
-Designed for use with webhook-based automation (alerts fire structured JSON on entry/exit) but works standalone as a manual signal tool
-This is a systematic strategy, not financial advice — past performance in the strategy tester does not guarantee future results. Test on paper/small size before live deployment.
How it works:
-Trend detection: Fast/slow EMA (default 50/200) establishes directional bias
-Momentum filter: RSI must confirm overbought/oversold conditions in the direction of the trade
-Volume confirmation: Entries require volume to exceed a multiple of its moving average, filtering out low-participation moves
-Trend strength filter: A minimum EMA spread threshold avoids entries during flat/ranging conditions
-Volatility-adaptive TP/SL: Take-profit and stop-loss percentages scale with a short/long ATR ratio, widening in high-volatility regimes and tightening in calm ones
-Volatility-adaptive position sizing: Position size scales inversely with ATR%, so size shrinks automatically in choppy/volatile conditions
-Risk controls: Daily trade cap, daily loss cap (% of equity), and an automatic pause after a configurable streak of consecutive take-profit wins (to avoid over-trading a hot streak into reversal)
-Session filter: Optional block on entries during a low-liquidity UTC window
Inputs are fully configurable — EMA/RSI/ATR lengths, volume and trend thresholds, TP/SL bounds, position sizing caps, leverage, and daily risk limits can all be adjusted to fit different symbols and timeframes.
Notes:
-Backtested with a 0.04% commission and 1-tick slippage assumption to reflect realistic futures execution costs
-Designed for use with webhook-based automation (alerts fire structured JSON on entry/exit) but works standalone as a manual signal tool
-This is a systematic strategy, not financial advice — past performance in the strategy tester does not guarantee future results. Test on paper/small size before live deployment.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.