1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Mean Reversion Trading Bot seeks entry opportunities when price reaches extreme Bollinger Band boundaries alongside overbought or oversold RSI levels. Long and short trades can be selectively enabled, with optional volume moving average filtering. Risk management features include ATR-based stop loss and take profit multipliers. The strategy draws directly on the main price chart.
RSI and Bollinger Bands entry signals
ATR-based dynamic stop loss and take profit targets
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Length
int
14
rsi_length
RSI Oversold Level
int
30
rsi_oversold
RSI Overbought Level
int
70
rsi_overbought
RSI Neutral Low
int
45
rsi_neutral_low
RSI Neutral High
int
55
rsi_neutral_high
Bollinger Bands Length
int
20
bb_length
BB Standard Deviation
float
2.0
bb_mult
Short EMA
int
20
ema_short
Long EMA
int
100
ema_long
ATR Length
int
14
atr_length
ATR Stop Loss Multiplier
float
1.5
atr_mult_sl
ATR Take Profit Multiplier
float
2.0
atr_mult_tp
Show all 19 settings
Setting
Type
Default
Variable
Max Risk Per Trade (%)
float
2.0
max_risk_per_trade
Max Drawdown (%)
float
20.0
max_drawdown
Profit Target (%)
float
3.0
profit_target_pct
Enable Long Trades
bool
true
enable_long
Enable Short Trades
bool
true
enable_short
Use Volume Filter
bool
true
use_volume_filter
Volume MA Length
int
20
volume_ma_length
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This mean-reversion strategy combines multi-timeframe exponential moving averages, Bollinger Bands, and the Relative Strength Index. It generates long and optional short trade signals when price interacts with the Bollinger Bands alongside RSI threshold confir
This strategy plots a simple moving average basis and upper and lower Bollinger bands on the price chart, with a fill between the bands. It also calculates RSI. It opens one long trade when RSI is above 25, price is at or below the lower band, and no position
This strategy plots on the price chart and combines up to seven optional modules that vote for long or short conditions. The modules use a 20-period simple moving average, a five-period RSI, Bollinger Band squeezes, a simplified prior-bar break, stacked expone
BB RSI Strategy combines Bollinger Bands, RSI, and multiple simple moving averages directly on the main price chart. It enters long positions when price drops below the lower Bollinger Band while RSI is below a set limit, and enters short positions when price
Calculates a reversal confidence score combining Bollinger Band overextension, RSI exhaustion, and price distance from a exponential moving average. The strategy overlays VWAP, EMA, and Bollinger Bands directly on the price chart. Long signals trigger when pri
This strategy plots an anchored volume-weighted average price and two standard-deviation bands on the price chart. It buys dips below the inner band when a short RSI is oversold and an optional EMA trend filter agrees, and it can sell rallies above the inner b