Strategy · Pine Script v5 · On the chart

Bollinger bands + Aroon [Alorse]

by Alorse· code credited to relevantLeader16058

This strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities.

View on GitHub

GitHub stars330on the repository
Pine versionv5runs as is
Lines of code30
Settings6inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago25 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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

30 lines of Pine Script v5 from strategies/mean-reversion/BB + Aroon.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

BB + Aroon.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © relevantLeader16058

//@version=5
strategy(title='Bollinger bands + Aroon [Alorse]', shorttitle='BB + Aroon [Alorse]', overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)

// BB inputs and calculations
lengthBB = input.int(20, minval=1)
src = input(close, title='Source')
mult = input.float(2.0, minval=0.001, maxval=50, title='StdDev')
basis = ta.sma(src, lengthBB)
dev = mult * ta.stdev(src, lengthBB)
upper = basis + dev
lower = basis - dev


lengthAr = input.int(288, minval=1)
AroonUP = 100 * (ta.highestbars(high, lengthAr + 1) + lengthAr) / lengthAr
AroonDown = 100 * (ta.lowestbars(low, lengthAr + 1) + lengthAr) / lengthAr


Confirmation = input(90, 'Aroon Confirmation')
Stop = input(70, 'Aroon Stop')

Bullish = ta.crossunder(close, lower)
Bearish = ta.crossunder(close, upper)

//Entry 
strategy.entry('Long', strategy.long, when=Bullish and AroonUP > Confirmation)
strategy.close('Long', when=Bearish or AroonUP < Stop)

Overview

Bollinger bands + Aroon [Alorse] enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specified confirmation level. The strategy closes open positions when the price drops below the upper band or Aroon Up drops below a designated threshold. Main settings configure the band length, standard deviation multiplier, Aroon period, and threshold levels. Plotted directly on the price chart, it lacks hard stop-loss orders and short trade logic.

Details

Published by

Alorse on GitHub

Code credit

relevantLeader16058, as written in the script's header

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Mean reversion, Volatility & bands, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Topics

pinescriptpinescript-indicatorspinescript-strategiestrading-strategiestradingviewtradingview-alerttradingview-strategy

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
lengthBBint20lengthBB
Sourcesourceclosesrc
StdDevfloat2.0mult
lengthArint288lengthAr
Aroon Confirmationint90Confirmation
Aroon Stopint70Stop
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.

Similar Pine Scripts

[TradersPost] Sick Sigma

by TradersPost
218 stars

Sick Sigma detects extreme statistical standard deviation moves (sigma events) to execute trades directly on the main price chart. The strategy supports both momentum and mean-reversion trading styles. Traders can configure calculation lookback periods, sigma

Strategy v6 Volatility & bandsMean reversion Repaints
Updated 3 months ago · None stated GitHub repository of [TradersPost] Sick Sigma

This strategy combines Volume Weighted Moving Average (VWMA) Bollinger Bands with 200-period and 50-period Exponential Moving Averages (EMAs). It identifies long trade opportunities when the 50 EMA is above the 200 EMA and price falls to or below the lower Fib

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with Fib Golden Ratio (0.618)

Bollinger Bands Strategy

by cklose2000
105 stars

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

Strategy v5 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Strategy

Keltner Channel Trend - Eterna

by EternaHybridExchange
9 stars

This strategy plots a Keltner channel from an EMA basis and ATR bands on the price chart. It enters long when price crosses back above the lower band while trading above a slower trend EMA, and short when price crosses back below the upper band while below tha

Strategy v5 TrendVolatility & bands
Updated 7 months ago · MIT GitHub repository of Keltner Channel Trend - Eterna
285 stars

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

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy
257 stars

This overlay strategy targets one-minute ES futures and plots volume-weighted moving-average bands from the open, scaled by a standard-deviation multiple, plus a slower band from ten-minute opens. A higher-timeframe exponential moving average can filter trades

Strategy v6 Moving averagesVolatility & bands
Updated 6 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers