This strategy plots directly on the price chart, drawing a multi-line stepped channel calculated from a simple moving average of OHLC4 expanded by Average True Range multipliers.
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
158 lines of Pine Script v5 from Tradingview/current-backtester.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Current Backtester identifies potential mean-reversion setups, executing buy, sell, trim, and exit actions when price reaches band extremes. Trade management incorporates an ATR-based trailing stop adjuster with fixed position sizing. User settings control band length, width multipliers, and signal visibility. Parameter tuning is required for different market volatilities.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show Signals
string
Buy, Sell, Trim, Exit
show_signals
Band Length Adjuster
int
10
band_length
Top Band Width
float
3.00
top_band_width
Bottom Band Width
float
3.00
bottom_band_width
Stop Adjuster
float
2.5
stop_adj
Show Trailing Stop
bool
false
show_trailing_stop
Buy Color
color
#27a69b
buy_color
Sell Color
color
#b63632
sell_color
Neutral Color
color
color.yellow
neutral_color
Outer Band Color
string
Gradient
color_candles
Inner Color
color
color.new(#000000,82)
fill_color
Line Color
color
color.new(color.white,60)
band_line_color
Show all 13 settings
Setting
Type
Default
Variable
Stop Color
color
color.new(#f06292, 30)
stop_color
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.
Greeffer's Scalping Strategy combines multi-timeframe Exponential Moving Averages, Bollinger Bands, and Donchian Channels to execute dip-buying trades directly on the price chart. It triggers long entries when price dips below both the lower Donchian Channel a
This strategy plots Bollinger Bands on the price chart with adjustable length, standard deviation, and offset. It defines buy and sell zones using candle size percentage and body size thresholds. Long positions enter when the lower zone is breached without con
This strategy is designed for 1-minute S&P 500 futures trading using multi-timeframe data and Fibonacci-weighted standard deviation bands around volume-weighted moving averages. It requests data from multiple higher timeframes without lookahead to prevent repa
The Mean Reversion Strategy Template calculates a baseline mean using SMA, EMA, or VWAP alongside upper and lower deviation bands based on standard deviation, ATR, or percentage offsets. It generates long and short entries when price touches, bounces from, or
This strategy backtests a long Bollinger Band deal on the price chart for 3Commas-style bots. It plots short and long simple moving averages, offset bands, and the average entry price of the open deal. A long starts when price crosses the lower band inside a c
This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po