Indicator · Pine Script v5 · On the chart

Adaptive Wave Interference Indicator with Bollinger Band Strategy

by angrysky56· code credited to angrysky

Combines three moving averages, MACD, RSI, a volatility length and Bollinger Bands on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code93
Settings14inputs
LicenceMIT
Last update11 months ago24 Nov 2025

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 indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

93 lines of Pine Script v5 from core_bot_instruction_concepts/AWIIBBS_indicator_system.txt, published under MIT. Keep the author's credit and licence lines when you reuse it.

AWIIBBS_indicator_system.txt
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © angrysky

//@version=5
indicator("Adaptive Wave Interference Indicator with Bollinger Band Strategy", overlay=true)

// User-defined inputs for moving averages
shortMaLength = input.int(5, "Short-Term MA Length")
midMaLength = input.int(13, "Mid-Term MA Length")
longMaLength = input.int(21, "Long-Term MA Length")

// User-defined inputs for MACD settings
macdFastLength = input.int(12, "MACD Fast Length")
macdSlowLength = input.int(26, "MACD Slow Length")
macdSignalSmoothing = input.int(9, "MACD Signal Smoothing")

// User-defined input for RSI
rsiLength = input.int(7, "RSI Length")
rsiOverbought = input.int(70, "RSI Overbought Threshold")
rsiOversold = input.int(30, "RSI Oversold Threshold")

// User-defined inputs for volatility threshold
volatilityLength = input.int(21, "Volatility Length")
volThresholdMultiplier = input.float(0.6, title="Volatility Threshold Multiplier", minval=0.1, step=0.1)  // Allows smaller increments

// User-defined input for close signal distance
closeSignalOffset = input.int(1, title="Close Signal Offset")  // Controls how far above/below the bar the close signal appears

// Bollinger Bands settings
bbLength = input.int(21, title="Bollinger Band Length")
bbMultiplier = input.float(2, title="Bollinger Band Multiplier")

// Bollinger Band Calculation
basis = ta.sma(close, bbLength)
dev = ta.stdev(close, bbLength)
upperBB = basis + bbMultiplier * dev
lowerBB = basis - bbMultiplier * dev

// Bollinger Band Buy/Sell Logic
bbBuy = ta.crossover(close, lowerBB)  // Buy when price crosses above the lower BB
bbSell = ta.crossunder(close, upperBB)  // Sell when price crosses below the upper BB

// Moving averages for wave structure
shortWave = ta.wma(close, shortMaLength)  // Short-term wave
midWave = ta.wma(close, midMaLength)      // Mid-term wave
longWave = ta.wma(close, longMaLength)    // Long-term wave

// Constructive/Destructive Interference Logic
waveInterference = (shortWave - midWave) + (midWave - longWave)  // Summing wave interference

// Volatility as Energy (Fluid Dynamics)
volatility = ta.stdev(close, volatilityLength)  // Volatility measured as standard deviation of price
volThreshold = ta.sma(volatility, volatilityLength) * volThresholdMultiplier  // Volatility threshold
highVol = volatility > volThreshold  // When volatility spikes above its mean

// Momentum Indicators for Phase Shifts
rsiValue = ta.rsi(close, rsiLength)

// Corrected MACD extraction with user inputs
[macdLine, signalLine, _] = ta.macd(close, macdFastLength, macdSlowLength, macdSignalSmoothing)

// Detect phase shifts based on MACD crossover and crossunder
momentumPhaseShiftUp = ta.crossover(macdLine, signalLine)   // Crossover for buy
momentumPhaseShiftDown = ta.crossunder(macdLine, signalLine) // Crossunder for sell

// Buy and Sell Signals based on Interference Patterns, MACD Momentum, and Volatility
buySignal = ta.crossover(shortWave, midWave) and waveInterference > 0 and highVol and rsiValue > rsiOversold and momentumPhaseShiftUp
sellSignal = ta.crossunder(shortWave, midWave) and waveInterference > 0 and highVol and rsiValue < rsiOverbought and momentumPhaseShiftDown

// Close Signals (Buy Above, Sell Below)
closeBuySignal = ta.crossunder(shortWave, midWave) and waveInterference < 0  // Condition for closing buy
closeSellSignal = ta.crossover(shortWave, midWave) and waveInterference < 0  // Condition for closing sell

// Plot Waves
plot(shortWave, color=color.green, title="Short-Term Wave")
plot(midWave, color=color.orange, title="Mid-Term Wave")
plot(longWave, color=color.red, title="Long-Term Wave")

// Plot Bollinger Bands
plot(upperBB, "Upper Bollinger Band", color=color.blue)
plot(lowerBB, "Lower Bollinger Band", color=color.blue)

// Plot Buy/Sell Signals 
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.flag, size=size.small)
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.flag, size=size.small)

// Plot Close Signals Above and Below the Bars with Offset
plotshape(series=closeBuySignal, title="Close Buy Signal", location=location.abovebar, color=color.yellow, style=shape.triangledown, offset=-closeSignalOffset, size=size.tiny)
plotshape(series=closeSellSignal, title="Close Sell Signal", location=location.belowbar, color=color.yellow, style=shape.triangleup, offset=closeSignalOffset, size=size.tiny)

// Plot Bollinger Buy/Sell Signals (BBS and BBB)
plotshape(series=bbBuy, title="Bollinger Buy", location=location.belowbar, color=color.green, style=shape.circle, size=size.tiny, text="BBB")
plotshape(series=bbSell, title="Bollinger Sell", location=location.abovebar, color=color.red, style=shape.circle, size=size.tiny, text="BBS")

Overview

Bollinger signals mark a buy when price crosses back above the lower band. Settings set the three average lengths, MACD fast, slow and signal values, RSI length with overbought and oversold levels, and the volatility length. It is an indicator with signals only, with no position sizing, stop loss or take profit.

Details

Published by

angrysky56 on GitHub

Code credit

angrysky, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Volatility & bands, Moving averages

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

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

SettingTypeDefaultVariable
Short-Term MA Lengthint5shortMaLength
Mid-Term MA Lengthint13midMaLength
Long-Term MA Lengthint21longMaLength
MACD Fast Lengthint12macdFastLength
MACD Slow Lengthint26macdSlowLength
MACD Signal Smoothingint9macdSignalSmoothing
RSI Lengthint7rsiLength
RSI Overbought Thresholdint70rsiOverbought
RSI Oversold Thresholdint30rsiOversold
Volatility Lengthint21volatilityLength
Volatility Threshold Multiplierfloat0.6volThresholdMultiplier
Close Signal Offsetint1closeSignalOffset
Show all 14 settings
SettingTypeDefaultVariable
Bollinger Band Lengthint21bbLength
Bollinger Band Multiplierfloat2bbMultiplier
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

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup

This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre

Indicator v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner IND [Alorse]

LiqSpikeBounceLong Feb2026

by agutinbaigo28
147 stars

LiqSpikeBounceLong Feb2026 is an indicator designed to identify long bounce entries following high-volume liquidation cascades in bearish market contexts. It checks if price is below an exponential moving average, then detects large single-bar drops exceeding

Indicator v5 Volatility & bandsVolume
Updated 6 weeks ago · MIT GitHub repository of LiqSpikeBounceLong Feb2026

8zz反指標v2

by hansai-art
121 stars

The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab

Indicator v6 Moving averagesOscillators & momentum
Updated 3 months ago · None stated GitHub repository of 8zz反指標v2
114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers