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 de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.