The BB + ADX Strategy triggers entries when price crosses Bollinger Bands during low-trend market conditions as filtered by the Average Directional Index (ADX).
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
73 lines of Pine Script v4 from Bollinger Bands + ADX Strategy.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
BB + ADX Strategy enters long when price crosses above the lower band and short when price crosses below the upper band, provided ADX remains below the set threshold. Positions are automatically closed when ADX rises above the threshold if enabled. Optional risk controls include swing high and low stop loss and take profit levels with ATR expanders. It plots Bollinger Bands and exit targets on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Reverse Trades
bool
false
i_reverse
ADX Close
bool
true
i_ADXClose
Use Swing Lo/Hi Stop Loss & Take Profit
bool
false
i_SL
Swing Lo/Hi Lookback
int
20
i_SwingLookback
SL Expander
int
0
i_SLExpander
TP Expander
int
0
i_TPExpander
ADX Smoothing
int
14
adxlen
DI Length
int
20
dilen
adxlevel
int
20
adxlevel
-----------BB Inputs-----------
bool
false
BBCALC
length
int
20
length
mult
float
2.0
mult
Show all 13 settings
Setting
Type
Default
Variable
MAlen
int
9
MAlen
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 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
Greeffer RSI Strategy is a trading strategy that generates buy and sell entries based on Bollinger Bands and RSI levels. It places stop orders at upper and lower Bollinger Bands on band crossovers, and adds positions when RSI reaches extreme levels. Users can
This strategy overlays the price chart to trade DAX futures during European market hours. It calculates exponential and simple moving averages, RSI, MACD, Bollinger Bands, ATR, and realized volatility to simulate VIX levels. Trades execute when session time fi
Calculates a combination of the Relative Strength Index, MACD histogram, and Bollinger Bands contraction to identify long trade entries. The strategy signals a long position on a bullish bar when the MACD histogram turns upward while negative, RSI remains belo
This strategy calculates a smoothed Relative Strength Index and plots self-adjusting linear regression bands with overbought and oversold boundaries in a separate pane. It enters long positions through dollar-cost averaging orders scaled across market phases a