Calculates mean reversion signals using statistical deviation metrics such as MAD, Standard Deviation, ATR, Z-Score, IQR, or Mean AD relative to customizable moving averages.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Deviation Based Reversion with Stats applies optional volume spike thresholds and trend filters to generate bullish and bearish reversion setups directly on the price chart. Additionally, the indicator tracks signal performance by evaluating price progression over a set look-forward period against custom success and failure targets.
Multiple statistical deviation options including MAD, ATR, and Z-Score
Versatile moving average selection including T3, ALMA, and KAMA
Integrated volume spike and trend filtering
Forward-looking performance tracking with custom success thresholds
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Lookback Period
int
20
bull_length
Enable Trend Filter
bool
true
bull_trendFilter
Cooldown Period (Bars)
int
10
bull_cooldownBars
Deviation Measure
string
MAD
bull_deviation_type
Deviation Multiplier
float
2.7
bull_madMult
Volume Avg Period
int
14
bull_volLength
Volume Spike Threshold
float
1.7
bull_volThreshold
Look-Forward Bars
int
7
bull_lookForwardBars
Success Threshold
float
20.0
bull_successThreshold
Failure Threshold
float
20.0
bull_failureThreshold
Threshold Type
string
Points
bull_successThresholdType
Conviction Arrow Color
color
color.blue
bullish_conviction_color
Show all 38 settings
Setting
Type
Default
Variable
MA Type
string
T3
bull_ma_type
ALMA Offset
float
6
bull_alma_offset
ALMA Sigma
float
0.85
bull_alma_sigma
TVMA Length (>1)
int
3
bull_tvma_length
T3 Factor
float
0.7
bull_t3_factor
KAMA Fast EMA Length
int
2
bull_kama_fast_len
KAMA Slow EMA Length
int
30
bull_kama_slow_len
Lookback Period
int
8
bear_length
Enable Trend Filter
bool
true
bear_trendFilter
Cooldown Period (Bars)
int
10
bear_cooldownBars
Deviation Measure
string
MAD
bear_deviation_type
Deviation Multiplier
float
2.0
bear_madMult
Volume Avg Period
int
14
bear_volLength
Volume Spike Threshold
float
1.5
bear_volThreshold
Look-Forward Bars
int
5
bear_lookForwardBars
Success Threshold
float
20.0
bear_successThreshold
Failure Threshold
float
20.0
bear_failureThreshold
Threshold Type
string
Points
bear_successThresholdType
Convexity Arrow Color
color
color.purple
bearish_conviction_color
MA Type
string
EMA
bear_ma_type
ALMA Offset
float
6
bear_alma_offset
ALMA Sigma
float
0.85
bear_alma_sigma
TVMA Length (>1)
int
3
bear_tvma_length
T3 Factor
float
0.7
bear_t3_factor
KAMA Fast EMA Length
int
2
bear_kama_fast_len
KAMA Slow EMA Length
int
30
bear_kama_slow_len
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 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
Kalman Percentile Bands plots a volatility-adaptive Kalman mean along with three empirical percentile bands on each side of the price chart. It calculates a local-level Kalman filter as the fair value mean, normalizes price deviations by an EWMA of volatility,
This indicator classifies price action into four distinct market regimes: Trend, Expansion, Compression, or Mean Reversion. It determines states using a simplified Hurst exponent estimate, ADX slope thresholds, and realized volatility measurements. Based on th
Greeffer's Scalping Indicator overlays higher-timeframe exponential moving averages, Bollinger Bands, and Donchian channels on the price chart. It flags a long when price touches the lower Donchian and lower band while the faster averages are not stacked beari
This indicator builds a channel from a Hull moving average of the source and an ATR scaled by a band multiplier, then normalizes price inside that channel into a 0 to 100 oscillator. It smooths the result with a weighted moving average and plots the line in a
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