PROTECTED SOURCE SCRIPT
XMR/USDT Bollinger Band Mean Reversion

This strategy is a mean-reversion system designed for $BINANCE:XMRUSDT (originally tuned on 30m). It looks for price excursions outside Bollinger Bands and trades the reversion back toward the moving average, while filtering for “ranging” conditions using an ADX cap and a minimum ATR% (to avoid dead markets).
Core idea
Entries
Exits & risk management
How to use
Key inputs snapshot
Pine Script®
Core idea
- Enter on extremes: take trades when price crosses beyond the Bollinger outer band.
- Filter with RSI: require oversold/overbought confirmation before entering.
- Prefer range markets: only trade when ADX is below a maximum (avoid strong trends).
- Avoid low volatility: require ATR% above a minimum so moves are tradable.
Entries
- Long: price crosses below the lower band + RSI <= threshold + regime ok.
- Short: price crosses above the upper band + RSI >= threshold + regime ok.
Exits & risk management
- Primary exit: mean reversion back through the BB basis (SMA), for smoother equity.
- Stop Loss: fixed % from entry.
- Take Profit (optional): fixed % from entry (basis-exit remains the main exit).
- Cooldown: blocks new entries for N bars after any exit-to-flat.
How to use
- Start on $BINANCE:XMRUSDT with 30m. This logic is sensitive to volatility/trend regimes; re-tune if you change timeframe or exchange.
- Disable the date filter for live usage; it exists to reproduce a backtest slice.
- Mean-reversion can suffer in strong trends—this is why the ADX cap exists, but it is not a guarantee.
Key inputs snapshot
Bollinger Bands:
Length 20, Mult 1.5
Filters:
RSI(12): long when RSI <= 40, short when RSI >= 70
ADX(27) <= 25 (prefer ranging)
ATR(14) / close >= 0.08%
Risk:
SL 3.75%
TP 1.5% (optional)
Cooldown: 11 bars
Educational use only. This is not financial advice. Validate with forward tests and realistic costs (fees/slippage).
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.