Adaptive Moving Average in TradingView: Formula, Settings and Testing
An Adaptive Moving Average changes its smoothing coefficient as market data changes. However, AMA is not one universal formula. Pineify's current AMA preset uses the source's position within a rolling range; Kaufman's KAMA uses a path-efficiency ratio. Confusing them changes the indicator being tested.
This guide describes the current AMA controls and calculation, then shows how to inspect signals and build a test specification without assuming that adaptive smoothing eliminates lag or false signals.
What Is the Adaptive Moving Average Indicator?
Pineify's AMA has a source input, a length default of 14, a fast length of 2, and a slow length of 30. The generator takes the highest and lowest source values across length plus one bars. It measures the absolute distance of the current source from the range midpoint relative to half the range. This factor is zero at the midpoint and one at either extreme; a zero-width range is handled as zero.
The factor interpolates between fast and slow EMA coefficients, then the result is squared and used in a recursive average update. A hypothetical range of 90 to 110 with a current source of 105 gives a factor of 0.5. Being near either extreme raises the coefficient, regardless of whether the path to that extreme was smooth.
Kaufman's familiar efficiency ratio instead divides absolute net change by the sum of absolute successive changes. That denominator measures sampled changes, not every transaction or tick. A net change alone does not determine the ratio: a move of 5 with total absolute movement of 50 gives 0.1, while the same net move with total movement of 5 gives 1.
These are different models. Pineify separately lists KAMA; choose and inspect the implementation that matches the intended hypothesis. The current AMA configuration references the original Adaptive Moving Average script, but the generated source remains the relevant implementation to inspect.
How to Add the AMA to TradingView
- Open the Visual Pine Editor and find Adaptive Moving Average.
- Inspect the source, length, fast length, and slow length. Check whether movement highlighting is enabled.
- Generate the script, copy it into TradingView Pine Editor, and compile it.
- Inspect several values and the first part of the series before relying on the line. Keep the script version with its visual configuration.
The current generator initializes its recursive value using a zero fallback. Early values therefore need particular attention; allow a documented warm-up and inspect convergence. A generated script is not automatically deployed into a TradingView account by the workflow described here.
How to Read the AMA
Price above or below the line and the slope of the line are separate observations. A movement color describes the configured slope rule, not whether a trade will win. A crossover can be used as a candidate entry or exit, but it can reverse on the next bar or change while the current bar is still open.
An average is sometimes used as a pullback reference. Calling it support or resistance is a hypothesis about later prices, not a property guaranteed by its formula. Compare any extra RSI or volume filter with the same base rule, period, costs, and execution assumptions. This article does not claim a measured reduction in false signals.
Settings to Compare
The following are illustrative parameter candidates, not recommended profitable settings:
| Candidate | Length | Fast length | Slow length | Question to test |
|---|---|---|---|---|
| Shorter window | 10 | 2 | 20 | How much more turnover and sensitivity appears? |
| Preset defaults | 14 | 2 | 30 | What behavior does the current preset produce? |
| Longer window | 20 | 3 | 50 | How much response delay accompanies smoothing? |
Changing a parameter changes both response and the sampled data relationships. No fixed setting is established as best for Bitcoin, forex, day trading, or swing trading. Choose a small search space before evaluating a held-out period, and retain unsuccessful variants in the record of your research.
How to Backtest the AMA
Use strategy mode for supported entry and exit conditions, then inspect the generated strategy in TradingView Strategy Tester. Pineify's visual configuration and TradingView's simulated execution are separate parts of that workflow.
A hypothetical baseline could enter when a completed close crosses above the average and exit on a completed cross below. Before running it, specify position size, fill timing, commissions, slippage, warm-up, and how unclosed positions are treated. Stops, targets, and additional filters are distinct variants; don't add them only because they improve the same historical sample.
Inspect individual crossovers and order timestamps, then compare trade count, net return, drawdown, average trade, and exposure. Test sensitivity to costs and a separate period. There is no NVDA win-rate result or AAPL comparison dataset supplied with this article, so no performance advantage over EMA is established.



