A long-only strategy that buys stocks after the daily 14-period RSI closes below an oversold level, optionally only above the 200-day average and in a bullish market regime based on an index and VIX.
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
Trades close after a set number of days or earlier when the daily RSI recovers to an exit level. Entry timing has several modes. Settings model turbo products, with leverage, financing, spread and knock-out levels, and a table. The tester reports the underlying stock.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Daily RSI length
int
14
rsiLen
Buy when daily RSI closes below
float
30
oversold
Mark daily RSI closing above
float
70
overbought
Sell at the latest after (trading days)
int
5
holdDays
Sell earlier when daily RSI closes at or above (0 = off)
float
40
exitRsi
Only buy above the 200-day average
bool
true
useTrend
Take trades from
time
timestamp("2000-01-01T00:00:00")
tradeFrom
Entry
string
Close
entryMode
Market index
symbol
AMEX:SPY
spySymbol
Bull when index is above its SMA
int
200
spyLen
VIX symbol
symbol
CBOE:VIX
vixSymbol
...and VIX is below
float
22
vixHigh
Show all 26 settings
Setting
Type
Default
Variable
Leverage in a bull market
float
20
levBull
Leverage otherwise
float
5
levOther
Stake guide (shown in table)
string
1–1.5% of portfolio, max 20–30 open
stakeGuide
Financing cost (% per year)
float
6.5
finRatePct
Round-trip spread (% of turbo price)
float
0.5
spreadPct
My product's financing level (0 = none)
float
0.0
myFinancing
My mini long's stop-loss level (0 = turbo)
float
0.0
myStop
Draw trigger and financing levels
bool
true
showLevels
Knock-out risk for the safe lines
string
20%
koRiskChoice
Mini long: stop-loss above financing level (%)
float
5.0
miniBufferPct
Volatility lookback (days)
int
20
volLen
Tint bars outside a bull market
bool
true
showRegimeBg
Show table
bool
true
showTable
Table position
string
top right
tablePosText
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.
Alert BB + RSI [Alorse] is a multi-symbol mean-reversion strategy designed for cryptocurrency trading. It evaluates Bollinger Bands and the Relative Strength Index (RSI) across up to 20 user-defined ticker symbols simultaneously. The strategy enters long posit
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
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 combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at
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