//@version=4
// Copyright (c) 2020-present, Alex Orekhov (everget)
// Mean Absolute Deviation Bands script may be freely distributed under the terms of the GPL-3.0 license.
study("Mean Absolute Deviation Bands", shorttitle="MADB", overlay=true)
length = input(title="Length", defval=20, minval=2)
mult = input(title="Bands Multiplier", defval=2.0, type=input.float, step=0.1)
src = input(title="Source", defval=close)
basis = sma(src, length)
dev = mult * dev(src, length)
upper = basis + dev
lower = basis - dev
plot(basis, title="Basis", color=#351c75, transp=0)
upperPlot = plot(upper, title="Upper", color=#45818e, transp=0)
lowerPlot = plot(lower, title="Lower", color=#45818e, transp=0)
fill(upperPlot, lowerPlot, title="MADB Background", color=color.new(#ffd966, 84))
Overview
Mean Absolute Deviation Bands draws upper and lower bands using a multiplier on the mean absolute deviation, with the background between them filled. The length setting adjusts the period of the moving average, and the multiplier changes the band width. The indicator is plotted directly on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Length
int
20
length
Bands Multiplier
float
2.0
mult
Source
source
close
src
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.
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
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
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
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
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
This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc