Explainers / Bollinger + RSI Double Strategy by Chart
Bollinger + RSI Double Strategy by ChartArt, explained from the source
Bollinger + RSI, Double Strategy (by ChartArt) v1.1 is an open-source TradingView strategy by ChartArt, published in January 2016, with about 49,700 boosts. Its notes say it buys when price is below the lower Bollinger Band and RSI is oversold, and sells when price is above the upper band and RSI is overbought. This page walks through the published code in order, says what each part really does, and ends with where it fails. It does not say whether the strategy makes money, and it gives no trades.
The surprise: overbought and oversold are both RSI 50
The code sets the oversold level to 50 and the overbought level to 50, and neither is an input you can change. So "RSI oversold" in this strategy means RSI crossing up through 50 on the bar, and "RSI overbought" means RSI crossing down through 50. That is a momentum turn, not an extreme. The description's "overbought or oversold condition" is not what the code tests.
Step 1: the two indicators
RSI uses a length of 6 on the close. The Bollinger Bands use a 200-bar simple average of the close plus and minus 2 standard deviations. The 200 is an input; the 2 is fixed in the code (the input line for it is commented out).
Step 2: when it enters
A long order is sent on a bar where two things happen at once: the close crosses back above the lower band, and RSI(6) crosses up through 50. A short order is the mirror: the close crosses back below the upper band, and RSI(6) crosses down through 50. Note the direction: it buys when price comes back inside the band, not while price is below it.
Each order is a stop order placed at the band. Because the close has already crossed the band when the order is sent, price is already past the stop, so by TradingView's order rules it fills at the next bar's open, like a market order. If the condition is not true on the next bar, any unfilled order is cancelled. We read this from the code and TradingView's documented order handling; we did not watch it fill live.
Step 3: when it exits
It has no exit. There is no stop loss, no target and no time limit. A long is closed only when a short entry fires, and the other way round, so after the first trade the strategy is always in the market, long or short.
Step 4: the colours are a different rule
The bar and background colours do not follow the trades. A bar turns red when the close crosses back below the upper band while the 200-bar average is falling, and green when the close crosses back above the lower band while the average is rising. The colour rule tests the number 50 as if it were true or false, so RSI plays no part in it. And the average's slope plays no part in the trades. In our port only about 2 or 3 of every 100 long entries fell on a green bar, and about 7 of every 10 coloured bars had no trade.
What the settings change
"RSI Period Length" (6) and "Bollinger Period Length" (200) are the only inputs that change trading. The two switches turn the bar and background colours on and off. The band width (2) and both RSI levels (50) can only be changed by editing the code.
What we checked in Python
We ported the logic to Python and ran it on invented random-walk prices with a typical move of 1% a bar: 50 runs of 5,000 bars at the default settings.
The RSI filter does little filtering. Of all band crosses, about one in three also had RSI(6) crossing 50 on the same bar, so most of the work is done by the band.
Few trades. A median of 10 trades per 5,000 bars (6 to 18 across runs), and the strategy was in the market about 93% of the time, holding each position for hundreds of bars. A backtest built on about ten trades says very little, whatever its profit figure.
Random prices, coin-flip results. 26 of the 50 runs ended with a positive sum of trade returns. On prices with nothing to find, that is what chance looks like.
Tuning to the backtest. The script's notes say version 1.1 was "made more successful in backtesting". We tried the same move: for each of 20 random series we picked the best of 36 settings (RSI 2 to 14, band 20 to 250). The chosen settings showed a profit on all 20 series they were picked on (median +135% summed). Run on 20 fresh random series, the same settings were positive on 9 of 20, median -6%. Choosing settings by the backtest makes the backtest look good and tells you nothing new.
These figures describe the code on invented data, not any market.
Where it fails
- "Overbought" and "oversold" are both RSI 50. The levels are fixed in the code; the strategy tests a cross of 50, not an extreme.
- No exit rule. No stop, no target, no time limit; it is always long or short after the first trade.
- The colours are not the trades. They follow a different rule that ignores RSI, so the chart's colours and the strategy's entries rarely agree.
- Too few trades to judge. About ten trades per 5,000 bars in our port, so any backtest of it rests on a tiny sample.
- Settings tuned to the backtest. The author's own notes say the update was made to backtest better; in our port, tuned settings lost their edge on fresh data.
- Stop orders that act as market orders. The stop sits at a band price is already past, so the fill is the next open, and any gap goes into the fill.
- Old code. It is written in Pine v2 and uses the strategy tester's defaults for size and costs unless you set them.
Educational only. Not financial advice. Nothing here is a recommendation to buy or sell anything. Bollinger + RSI, Double Strategy (by ChartArt) is by ChartArt on TradingView; this page describes its published open-source code in our own words and is not affiliated with the author. Simulation figures come from synthetic random-walk prices and say nothing about how the script trades on any market.
Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue, Volume Flow Indicator by LazyBear, FVG Order Blocks by BigBeluga, CM_Williams_Vix_Fix by ChrisMoody, Ultimate Moving Average MTF by ChrisMood, Fibonacci Bollinger Bands by Rashad, Candlestick Patterns Identified by repo3, MACD + SMA 200 Strategy by ChartArt, Pine Script v5 to v6, Moving Average Cross Alert, Multi-Timefr, WaveTrend Oscillator [WT] by LazyBear, WaveTrend with Crosses [LazyBear], CM_Price-Action-Bars by ChrisMoody, RSI Candles by glaz, CM RSI-2 Strategy Lower Indicator by Chr, CM Stochastic Multi-TimeFrame by ChrisMo, CM_Ultimate RSI Multi Time Frame by Chri, TonyUX EMA Scalper - Buy / Sell by tux, MACD 4C by vkno422, My Pine Script is valid. What did the va
Get the next teardown by email
One short email when a new teardown or free tool goes live, about twice a month. No signals, no hype. Unsubscribe in one click.
Almost done. Check your inbox and click the confirmation link.
Sent with Kit. Your address is used only for these emails. Privacy
No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.