# Trend Regularity Adaptive Moving Average

Trend Regularity Adaptive Moving Average is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

An adaptive moving average whose smoothing keys off trend regularity: the more new highs or lows price prints, the tighter it hugs the move, while ranges flatten it into a stable line. Use it for crossovers that can fire earlier in persistent trends, or as trailing support and resistance. A LuxAlgo original for trend traders tired of one-speed averages.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Dec 1, 2020.
- Access: free.
- Concepts: [TRAMA](https://www.luxalgo.com/library/concept/trama/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn6rls009kvhsgkw14a083
- Page: https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average/

**Trend Regularity Adaptive Moving Average** (TRAMA) is the LuxAlgo original that re-times its own smoothing to match the regularity of the trend it is tracking. The [TRAMA calculation](https://www.luxalgo.com/library/concept/trama/) squares the average number of highest highs and lowest lows recorded over the lookback and uses the result as its smoothing factor, so the line hugs price through persistent trends and settles into a stable shelf when the market goes quiet. That single property makes it useful twice over: as a crossover average and as trailing support and resistance.

## How to Trade the Trend Regularity Adaptive Moving Average?

- **Price crossing the line**: works in any MA crossover system; because TRAMA tightens toward price as a trend extends, crossovers can arrive earlier than a fixed-speed average allows.
- **Flat line**: no new highs or lows are being recorded, a built-in regime filter telling you the market is ranging.
- **Trailing support/resistance**: trail stops behind the line in established moves; its stability in chop makes it a practical risk anchor in volatile markets.

One caveat comes straight from the math: after a prolonged uptrend the smoothing factor is still elevated, so TRAMA can be slow to adapt when the market flips abruptly into a downtrend, and the same applies in reverse. Like its siblings in the [trend family](https://www.luxalgo.com/library/family/trend/), it rewards persistence, not sudden reversals.

## Trend Regularity Adaptive Moving Average Settings

- **Length**: the indicator period; longer settings record fewer new extremes, producing a smoother, slower line.
- **Src**: the price source the average is computed on.

## Frequently Asked Questions

### What makes TRAMA different from a classic EMA?

An EMA's smoothing constant is fixed by its length; TRAMA recomputes its own every bar from trend regularity. Squaring the factor suppresses small values, which is why the line stays nearly motionless in sideways conditions where an EMA would wobble.

### Which adaptive average should I compare it against?

The [UHL Adaptive MA](https://www.luxalgo.com/library/indicator/uhl-adaptive-ma/) is a natural cross-check: both adjust their responsiveness to conditions, but from different premises. Running the two side by side quickly shows how TRAMA's extreme-counting approach behaves on your market.

### Is TRAMA free to use?

Yes. It ships in the free tier of the LuxAlgo Library, and Quant, our coding agent, can backtest a TRAMA crossover for you directly from this page. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Machine Learning Moving Average](https://www.luxalgo.com/library/indicator/machine-learning-moving-average/) (Adaptive-lookback MA): markdown at https://www.luxalgo.com/library/indicator/machine-learning-moving-average.md
- [ZLEMA](https://www.luxalgo.com/library/indicator/zlema/) (Trend): markdown at https://www.luxalgo.com/library/indicator/zlema.md
- [Moving Average Converging](https://www.luxalgo.com/library/indicator/moving-average-converging/) (EMA): markdown at https://www.luxalgo.com/library/indicator/moving-average-converging.md
- [MLMA](https://www.luxalgo.com/library/indicator/mlma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/mlma.md
- [Volume-adjusted MA](https://www.luxalgo.com/library/indicator/volume-adjusted-ma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/volume-adjusted-ma.md
- [JMA](https://www.luxalgo.com/library/indicator/jma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/jma.md
- [T3](https://www.luxalgo.com/library/indicator/t3/) (Trend): markdown at https://www.luxalgo.com/library/indicator/t3.md
- [Hull Butterfly Oscillator](https://www.luxalgo.com/library/indicator/hull-butterfly-oscillator/) (HMA): markdown at https://www.luxalgo.com/library/indicator/hull-butterfly-oscillator.md

---

Source: https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
