Indicator · Pine Script v6 · On the chart

Aberration (ABBER)

by mihakralj

This indicator plots Aberration bands on the price chart around a central moving average.

View on GitHub

GitHub stars47on the repository
Pine versionv6current
Lines of code47
Settings5inputs
LicenceMIT
Last update8 months ago28 Feb 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 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

47 lines of Pine Script v6 from indicators/channels/aberr.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

aberr.pine
// The MIT License (MIT)
// © mihakralj
//@version=6
indicator("Aberration (ABBER)", "ABBER", overlay=true)

//@function Calculates Aberration bands measuring deviation from a central moving average
//@param source Series to calculate aberration from
//@param ma_line Pre-calculated moving average line
//@param period Lookback period for deviation calculation
//@param multiplier Multiplier for deviation bands
//@returns [upper_band, lower_band, deviation] Aberration band values and deviation
//@optimized Uses simple deviation averaging with O(n) complexity
abber(series float source, series float ma_line, simple int period, simple float multiplier) =>
    if period <= 0 or multiplier <= 0.0
        runtime.error("Period and multiplier must be greater than 0")
    float deviation = math.abs(nz(source) - nz(ma_line))
    float avg_deviation = ta.sma(deviation, period)
    float upper_band = ma_line + multiplier * avg_deviation
    float lower_band = ma_line - multiplier * avg_deviation
    [upper_band, lower_band, avg_deviation]

// ---------- Main loop ----------

// Inputs
i_source = input.source(close, "Source")
i_period = input.int(20, "Period", minval=1)
i_ma_type = input.string("SMA", "Moving Average Type", options=["SMA", "EMA", "WMA", "RMA", "HMA"])
i_multiplier = input.float(2.0, "Deviation Multiplier", minval=0.1, step=0.1)
i_show_ma = input.bool(true, "Show Moving Average Line")

// Calculate the moving average based on selected type
ma_line = switch i_ma_type
    "SMA" => ta.sma(i_source, i_period)
    "EMA" => ta.ema(i_source, i_period)
    "WMA" => ta.wma(i_source, i_period)
    "RMA" => ta.rma(i_source, i_period)
    "HMA" => ta.wma(2 * ta.wma(i_source, i_period / 2) - ta.wma(i_source, i_period), math.round(math.sqrt(i_period)))
    => ta.sma(i_source, i_period)

// Calculation
[upper_band, lower_band, deviation] = abber(i_source, ma_line, i_period, i_multiplier)

// Plots
p_upper = plot(upper_band, "Upper Band", color=color.yellow, linewidth=2)
p_lower = plot(lower_band, "Lower Band", color=color.yellow, linewidth=2)
plot(i_show_ma ? ma_line : na, "MA", color=color.yellow, linewidth=2)
fill(p_upper, p_lower, color=color.new(color.blue, 90), title="Band Fill")

Overview

Aberration (ABBER) measures the absolute deviation of the source from that average, smooths the deviation with a simple moving average, and offsets the center by a multiplier to form upper and lower bands. The user chooses the source, lookback period, moving-average type, and deviation multiplier, and can hide the center line. The band area is filled between the two boundaries. It does not generate trade signals or manage exits.

Details

Published by

mihakralj on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Moving averages, Volatility & bands

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.

Topics

pinescriptpinescript-indicatorstechnical-analysistradingview-indicators

Settings

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

SettingTypeDefaultVariable
Sourcesourceclosei_source
Periodint20i_period
Moving Average TypestringSMAi_ma_type
Deviation Multiplierfloat2.0i_multiplier
Show Moving Average Linebooltruei_show_ma
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

Hampel Filter

by everget
948 stars

The Hampel Filter indicator identifies and filters out price outliers to smooth price data directly on the main chart. It calculates the rolling median and Median Absolute Deviation (MAD) of the chosen source series over a specified length. When a data point e

Indicator v4 Moving averagesVolatility & bands
Updated 10 days ago · GPL-3.0 GitHub repository of Hampel Filter

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]
318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages

NVDA Trend Ribbon

by longsurf-ai
277 stars

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre

Indicator v6 TrendMoving averages
Updated yesterday · MIT GitHub repository of NVDA Trend Ribbon

Algo AVT

by ricardosantos79
261 stars

This indicator calculates an outlier-filtered moving average based on statistical filtering concepts. It stores close prices in a rolling array over a user-defined length, calculates the mean and standard deviation, and excludes values falling within a specifi

Indicator v4 Moving averagesVolatility & bands
Updated 4 years ago · None stated GitHub repository of Algo AVT

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