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

Bollinger Band mean reversion strategy — backtest & Pine Script

Backtest 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.

✓ 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 Bollinger Band mean reversion strategy works

Bollinger Bands put a band two standard deviations above and below a 20-period moving average. When price closes back inside the lower band after a sharp drop, the move is often stretched and may snap back to the average.

Rules

  • Buy when the close crosses back above the lower band.
  • Exit when the close reaches the middle band (SMA 20), or at a 6% stop-loss.

For a breakout version instead, buy when the close crosses above the upper band and exit below the middle band.

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 Bollinger Band mean reversion strategy?

Buy when the close crosses back above the lower band.. Exit when the close reaches the middle band (SMA 20), or at a 6% stop-loss.. For a breakout version instead, buy when the close crosses above the upper band and exit below the middle band.

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.