Trend Regularity Adaptive Moving Average

The following moving average adapt to the average number of highest high/lowest low made over a specific period, thus adapting to trend strength. Interesting results can be obtained when using the moving average in a MA crossover system or as a trailing support/resistance .


  • Length : Period of the indicator, with higher values returning smoother results.
  • Src : Source input of the indicator.


The trend regularity adaptive moving average (TRAMA) can be used like most moving averages, with the advantage of being smoother during ranging markets.

Notice how the moving closer to the price the longer a trend last, such effect can be practical to have early entry points when using the moving average in a MA crossover system, such effect is due to the increasing number of average highest high/lowest low made during longer trends. Note that in the case of a significant uptrend followed by a downtrend, the moving average might penalize the start of the downtrend (and vice versa).

The moving average can also act as an interesting trailing support/resistance .


The moving average is calculated using exponential averaging, using as smoothing factor the squared simple moving average of the number of highest high/lowest low previously made, highest high/lowest low are calculated using rolling maximums/minimums.

Using higher values of length will return fewer highest high/lowest low which explains why the moving average is smoother for higher length values. Squaring allows the moving average to penalize lower values, thus appearing more stationary during ranging markets, it also allows to have some consistency regarding the length setting.

🧙 this moving average would not be possible without the existence of corn syrup 🦎
Versionshinweise: License update
Versionshinweise: Minor Changes.
Open-source Skript

Ganz im Sinne von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es verstehen und überprüfen können. Ein Hoch auf den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Publikation unterliegt den Hausregeln. Sie können das Skript den Favoriten hinzufügen, um es auf dem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?
Our Website to get access to our invite-only scripts:

Lux Algo Documentation:

Join our Discord Group:


What's a good MA to pair with this indicator for crossovers?
+11 Antworten
alexgrover TheJakeness
@TheJakeness, Hard to say, a faster adaptive moving average or maybe a low lag moving average, these can potentially provide early crosses.
+1 Antworten
this should be added to the Editor's Picks list
+3 Antworten
alexgrover Iceman0929
@Iceman0929, the editor's picks selection process is quite mysterious ;)
+1 Antworten
Great stuff!
+1 Antworten
this is a good indicator
Works great with setting 21 for Intraday Or Swing Trading
@LuxGecko is this new indicator the same / similar to your "Percentile Nearest Rank Using Arrays indicator?" TIA
LuxGecko Trix79
@Trix79, Hi :) Both could be used in similar ways e.g. the classical support resistance/crosses approach however the way they work is totally different. They may be used as a powerful combination. This moving average is adaptive and based off the average number of highest high/lowest low made over a specific period whereas the other is of course a percentile moving rank.
Hope this helps :)
Trix79 LuxGecko
@LuxGecko, thanks for your reply!
Startseite Aktien-Screener Forex-Screener Krypto-Screener Wirtschaftskalender Über Chartmerkmale Preise Einen Freund empfehlen Hausregeln Hilfe Center Webseite & Brokerlösungen Widgets Charting Lösungen Lightweight Charting Library Blog & News Twitter
Profil Profileinstellungen Konto und Abrechnung Angeworbene Freunde Coins Meine Support Tickets Hilfe Center Private Nachrichten Chat Abmelden