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
Optimized BTC Mean Reversion (RSI 20/65) buys when RSI is below its oversold level, Stochastic K is oversold, and price is above ninety percent of a 200-period EMA. It sells short when RSI and Stochastic are overbought and price is below the EMA. Position size is the full equity, and pyramiding is off. Risk inputs set a four percent stop loss and a six percent take profit. Lengths, thresholds, risk percentages, and dates are adjustable, but the shown date filter stays always true.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
EMA Period
int
200
emaLength
RSI Period
int
14
rsiPeriod
RSI Oversold Level (BUY)
float
20
rsiBullLevel
RSI Overbought Level (SELL)
float
65
rsiBearLevel
Stochastic K Period
int
14
stochLength
Stochastic D Period
int
3
stochSmooth
Stochastic Overbought
float
75
stochOverbought
Stochastic Oversold
float
25
stochOversold
Stop Loss %
float
4.0
stopLossPct
Take Profit %
float
6.0
takeProfitPct
Start Date
input
timestamp("2025-01-01 00:00")
startDate
End Date
input
timestamp("2099-12-31 23:59")
endDate
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 draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,
This strategy implements Larry Connors' 2-period RSI mean-reversion algorithm overlaid on the price chart. It filters trades using a long-term Simple Moving Average (SMA), entering long positions when the price trades above the SMA and the short-term RSI drops
This strategy combines multi-timeframe RSI analysis with exponential moving average filters to execute trades on price bounces. It evaluates daily and weekly RSI levels alongside pip-distance thresholds between fast, slow, and long-term EMAs. Position entries
This strategy plots on the price chart and trades fair value gaps filtered by RSI and two EMAs. It opens a long when a bullish gap, a rising candle, RSI below the oversold level, and price under both EMAs align, and a short on the opposite conditions. Each tra
Burgle Bounce is a price-chart strategy that treats a move toward one of up to four simple or exponential moving averages as a test when price comes within a user-set percentage of ATR, then exits toward a target average under a separate error margin. Longs an