OPEN-SOURCE SCRIPT
BB Mean Reversion Long + SL

This strategy exploits statistical price extremes using Bollinger Bands
on a mean reversion logic — when price closes below the lower band,
it's statistically outside 95% of normal price action.
That's the entry. The target is simple : get back to the mean.
━━━ LOGIC ━━━
- Entry → price closes below the lower band (crossunder)
- Take Profit → price returns to the SMA (middle band)
- Stop Loss → fixed % below entry price
━━━ SETTINGS ━━━
- SMA Period (N) → default 20
- Standard Deviations (K) → default 2.0
- Stop Loss % → default 1.5%
- Pyramiding → up to 3 simultaneous entries
━━━ BEST TIMEFRAME ━━━
Tested and works best between 45min and 2h.
Below 30min : too much noise.
Above 2h : price extremes often reflect real trend, not overreaction.
━━━ NOTES ━━━
→ Designed for mean-reverting assets with clear volatility cycles
→ Works particularly well on XAUUSD, indices ETFs
→ Avoid running during major news events (NFP, CPI, Fed)
→ Not recommended to hold positions over the weekend
→ qty is set to fixed lot — adjust to your broker's lot size
Tune N and K to your asset. Default settings are a starting point,
not a final answer. The edge is in the calibration.
on a mean reversion logic — when price closes below the lower band,
it's statistically outside 95% of normal price action.
That's the entry. The target is simple : get back to the mean.
━━━ LOGIC ━━━
- Entry → price closes below the lower band (crossunder)
- Take Profit → price returns to the SMA (middle band)
- Stop Loss → fixed % below entry price
━━━ SETTINGS ━━━
- SMA Period (N) → default 20
- Standard Deviations (K) → default 2.0
- Stop Loss % → default 1.5%
- Pyramiding → up to 3 simultaneous entries
━━━ BEST TIMEFRAME ━━━
Tested and works best between 45min and 2h.
Below 30min : too much noise.
Above 2h : price extremes often reflect real trend, not overreaction.
━━━ NOTES ━━━
→ Designed for mean-reverting assets with clear volatility cycles
→ Works particularly well on XAUUSD, indices ETFs
→ Avoid running during major news events (NFP, CPI, Fed)
→ Not recommended to hold positions over the weekend
→ qty is set to fixed lot — adjust to your broker's lot size
Tune N and K to your asset. Default settings are a starting point,
not a final answer. The edge is in the calibration.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.