A strategy template that sets up Bollinger Bands, MACD and an RSI with its own Bollinger band, each with adjustable lengths, and uses a share of equity for sizing.
1Copy the scriptPress Copy script above, or the copy button on the code below.
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
116 lines of Pine Script v5 from PineScript/Stg_Boll_MACD_SMI_RSI.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Orders carry a percentage stop loss and take profit, defaulting to 3 and 30. The condition section is mostly empty and the entry and exit signals are not fully defined in the visible code, so its trading rules are incomplete as written.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Equity Usage Percentage
float
0.9
equityUsage
Boll Length
int
21
bollLength
Boll StdDev
float
2.0
bollMult
Fast Length
int
12
fastLength
Slow Length
int
26
slowLength
Signal Length
int
9
signalLength
RSI Length
int
14
rsiLength
RSI Source
source
hlc3
rsiSource
RSI MA Length
int
14
rsiMALength
RSI BB StdDev
float
2.0
rsiBollMult
Stop Loss
int
3
stopLoss
Take Profit
int
30
takeProfit
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
This strategy identifies trend-following entries using a triple exponential moving average alignment and ATR-based exits on the main price chart. Long signals trigger when the fast EMA is above the medium EMA and medium is above slow, accompanied by a close ab
This overlay strategy looks for gold scalps from break of structure and change of character. It enters long when a bullish break, a bullish character change, and an optional volume filter align, and short on the opposite set. Optional RSI levels can block trad
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 educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro
This strategy combines exponential moving averages (EMA 9, 21, 50), RSI, MACD, and Supertrend indicators to enter long positions. It triggers trades using six dynamic setups based on momentum breakouts, EMA crossovers, and pullbacks. Position sizing is compute