This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window.
1Copy the scriptPress Copy script above, or the copy button on the code below.
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
163 lines of Pine Script v4 from scripts/118-Adaptive-MA-Slope.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Signals can be filtered by short-term volatility expansion using ATR comparisons, volume momentum via a Hull Moving Average of volume RSI, or both. It plots directly on the price chart and identifies transitions between bullish and bearish market states. As an indicator, it does not include execution logic or risk management rules.
Kaufman Adaptive Moving Average calculation
Slope direction analysis over custom lookback period
Dual filter system using ATR volatility and volume RSI
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Price Type
string
OHL3
ptype
Indicator Lag |2..n|
int
20
lag
Lookback Period |1..n|
int
6
lkb
Filter Signals by
string
Both
ftype
===Information===
bool
false
show_info
Lot Size
float
0.01
lot_size
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 a volume-weighted moving average as a central trend baseline and surrounds it with ATR-based volatility bands. It colors the trend and optional price bars according to whether price is on the bullish or bearish side of those bands. Users c
EMA System plots four exponential moving averages on the price chart and marks a long-only pullback setup. It treats price above the 200 EMA and the 21 EMA above the 50 EMA as a valid trend, then flags a buy when price is near the 21 EMA, volume is below its s
The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha
This indicator plots standard Bollinger Bands and three configurable moving averages directly on the price chart. Users can toggle the Bollinger Bands, adjust their length and multiplier, and choose between exponential or simple moving averages for fast, slow,
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