Arambag, West Bengal · Since 2020 +91 7699462154 |
BullishBrush logo BULLISHBRUSHLearn Today, Lead Tomorrow

EMA 9/21 crossover strategy — backtest & Pine Script

Backtest the 9 and 21 EMA crossover strategy on any crypto pair and timeframe. See win rate, profit factor and drawdown, then export to TradingView.

✓ Free backtests✓ EMA · SMA · RSI · MACD · Bollinger · Stochastic · Breakouts★ Pine Script export with Pro
Market
Entry when
Exit when
Risk & costs

0 = no stop-loss / take-profit.

Net profit—
Buy & hold—
Trades—
Win rate—
Profit factor—
Max drawdown—
Avg trade—
Time in market—

Price & trades

Equity curve

Strategy vs buy & hold

Trades

Run a backtest to see trades.

Strategy library

Golden Cross (50/200 SMA)Backtest the golden cross strategy (50-day SMA crossing above the 200-day SMA) on Bitcoin and other markets for free, then export it to TradingView Pine Script.Backtest free →EMA 9/21 crossoverBacktest the 9 and 21 EMA crossover strategy on any crypto pair and timeframe. See win rate, profit factor and drawdown, then export to TradingView.Backtest free →RSI oversold bounceBacktest the RSI 30/70 strategy: buy when RSI crosses up from oversold, sell when it reaches overbought. Free backtest with stop-loss and Pine Script export.Backtest free →MACD crossover + trend filterBacktest the MACD signal-line crossover strategy with a 200 EMA trend filter. Free results, equity curve and TradingView Pine Script export.Backtest free →Bollinger Band mean reversionBacktest a Bollinger Bands mean-reversion strategy: buy back inside the lower band, exit at the middle band. Free backtest with stop-loss and Pine export.Backtest free →Donchian 20-day breakout (Turtle)Backtest the classic Turtle Trading breakout: buy a new 20-day high, exit at a 10-day low. Free backtest on crypto and Pine Script export for any market.Backtest free →Trend pullback (EMA 200 + RSI)Buy pullbacks in an up-trend: price above the 200 EMA and RSI turning up from 40. Backtest it free with stop-loss and export to TradingView.Backtest free →Stochastic oversold in up-trendBacktest a stochastic oscillator strategy: buy %K crossing up through 20 while price is above the 50 SMA, sell at 80. Free and exportable to TradingView.Backtest free →

How the EMA 9/21 crossover strategy works

The 9/21 EMA crossover is one of the most popular swing-trading signals. Exponential moving averages react faster than simple ones, so the system enters trends earlier than the golden cross — and also gets more false signals.

Rules

  • Buy when EMA 9 crosses above EMA 21.
  • Exit when EMA 9 crosses back below EMA 21.

On lower timeframes, fees matter a lot: check the effect of the trading fee setting. Adding a filter such as “close above EMA 200” often removes many losing trades in down-trends.

Backtests use historical data and simplified fills. Past performance does not guarantee future results. Education only — not investment advice.

FAQ

What are the rules of the EMA 9/21 crossover strategy?

Buy when EMA 9 crosses above EMA 21.. Exit when EMA 9 crosses back below EMA 21.. On lower timeframes, fees matter a lot: check the effect of the trading fee setting. Adding a filter such as “close above EMA 200” often removes many losing trades in down-trends.

Can I test Indian stocks, Nifty or forex?

Export the strategy as Pine Script (Pro) and paste it into TradingView’s Pine Editor. TradingView then backtests it on any symbol — Nifty, Bank Nifty, Reliance, EUR/USD, gold and more.

How are trades executed in the backtest?

Signals are checked at the close of each bar and orders are filled at that close. Stop-loss and take-profit are checked against each later bar’s high and low; if both are touched in the same bar, the stop-loss is assumed first. Fees are charged on entry and exit.

Does a good backtest mean the strategy will make money?

No. A backtest only shows how rules behaved on past data. Over-optimised rules often fail in live markets. Test on several symbols and timeframes, keep rules simple and always use risk management. This tool is for education, not investment advice.