ZERO LAG TEMA: An Advanced Approach to Reducing Trend Detection Lag

ZERO LAG TEMA: An Advanced Approach to Reducing Trend Detection Lag

Introduction

The ZERO LAG TEMA indicator is an advanced technical analysis tool that combines Exponential Moving Averages (EMA) and Triple Exponential Moving Averages (TEMA) to provide precise trading signals and minimize lag in detecting trend changes. This indicator is especially useful for traders seeking to identify early trend changes and optimize their entry and exit strategies.

Indicator Components

The ZERO LAG TEMA is based on two sets of Exponential Moving Averages: one with a fast period and the other with a slow period. The input parameters allow adjusting these periods to fit different timeframes and trading styles.

src: Custom close price (customclose).
inpPeriodFast: Fast period for the fast TEMA (default 22).
inpPeriodSlow: Slow period for the slow TEMA (default 144).
showsigs: Show signals on the chart (1 to show, 0 to hide).
colorbars: Color the chart bars based on the TEMA conditions (1 to color, 0 not to color).

Indicator Calculation

Fast TEMA

To calculate the fast TEMA, three Exponential Moving Averages are applied sequentially:

Slow TEMA

Similarly, the slow TEMA is calculated using a longer period:

Theory of Exponential Moving Averages and TEMA

Exponential Moving Average (EMA)

The Exponential Moving Average (EMA) is a variant of the simple moving average that gives more weight to recent data. This allows the EMA to respond more quickly to price changes. The EMA formula is as follows:

\[ \text{EMA}_t = (\text{Price}_t \times \alpha) + (\text{EMA}_{t-1} \times (1 – \alpha)) \]

Where:
– \( \text{EMA}_t \) is the current EMA value.
– \( \text{Price}_t \) is the current price.
– \( \alpha \) is the smoothing factor, calculated as \( \frac{2}{n + 1} \), where \( n \) is the EMA period.

Triple Exponential Moving Average (TEMA)

The Triple Exponential Moving Average (TEMA) is an advanced moving average that seeks to reduce the lag observed in simple and exponential moving averages. TEMA was introduced by Patrick Mulloy in 1994 and is calculated using three EMAs, making it more responsive to price changes, eliminating market noise, and providing clearer signals.

The TEMA formula is:

\[ \text{TEMA} = 3 \times \text{EMA1} – 3 \times \text{EMA2} + \text{EMA3} \]

Where:
– \( \text{EMA1} \), \( \text{EMA2} \), and \( \text{EMA3} \) are sequentially calculated exponential moving averages.

Advantages of Using TEMA

– **Lag Reduction**: TEMA offers a faster response to price changes compared to simple and exponential moving averages.
– **Greater Precision**: By using three layers of exponential smoothing, TEMA better eliminates market noise, providing more accurate signals.
– **Improved Trading Signals**: TEMA is ideal for traders looking to identify early trend changes and react promptly.

Trading Signals

The indicator generates buy and sell signals based on the crossovers between the fast TEMA and the slow TEMA:

Bar Coloring

The indicator can also color the chart bars to visually highlight market conditions:

Complete Code in ProBuilder

Below is the complete code for the ZERO LAG TEMA indicator in ProBuilder language:

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Ciccarelli Franco • 215 days ago #

    Indicatore interessante, ma non sono convinto se è meglio del Super trend, che cosa ne dici?

  2. Stenozar • 215 days ago #

    Ciao mi restituisce errore line 1; forse è perchè utilizzo la versione 11 ? in questo caso dovrei modificare qualche riga di codice?

  3. Stenozar • 197 days ago #

    Ciao IVAN , mi da errore per la riga 49 “print tema low”; puoi suggerirmi la modifica da metttere?
    grazie

    • Iván • 196 days ago #

      Avete provato a scaricare il file .itf?

  4. AndyB72 • 11 days ago #

    Caricato ora sulla V12, nessun errore.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
okeus Ivan, riesci a creare un indicatore per le "evolventi paraboliche" ? grazie
groelandes Impagable tu trabajo cada semana. ¡Gracias!
Iván de nada! :)
Iván
2 months ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
P. Marlowe Muy bueno. ¿Podría hacerse para señalar extremos por el lado bajista? Lo mismo a la inversa....
Miro Esta es una versión del indicador, para ambos extremos. //-------------------------------...
P. Marlowe Muchas gracias ¡¡
MaoRai54 dear Ivan, it seems to be very interesting but please clarify what are all the lines I see i...
Iván Hi! you have the answer in the last line of code... MacdMiddle as "histo" style(histogra...
kats Le Top , a utiliser avec le nuage violet et alerte TN pour plus de précision.
roccafragius Hello Ivan, very good job! May I ask you to translate teh script from TradingView named Tre...
Iván Hi! yes. You can ask for it here: https://www.prorealcode.com/free-code-conversion/
roccafragius Thank you so much Ivan! I created this request in english Translate from TradingView Indicat...
Regisnew très bel indicateur merci
jordan //---settings MAmode=0 Period=150 NumberOfMA=100 //---end of settings MA2=undefined ...
jordan dites moi si cela correspond à ce que vous cherchez
kats bonjour merci de ta reponse mais non ca fonctionne pas sympa quand même d'avoir essayé cdlt
Jean2139 Bonjour Yvan, Merci pour ton indicateur que je trouve très intéressant. Je suppose que tu ...
Suffi Hier eine kleine Korrektur: //-----Inputs-----------------------------------------// MALengt...
kats Bonjour, J'ai une question etes vous trader? Je m'explique , j'ai téléchargé tous les indi...
Faisalx Hola Ivan. Thanks for your great job. I would appreciate if you have look at my request http...
roccafragius Thank you for all these useful information!! Very great job Ivan! THank you so much
geroniman Merci Ivan, super travail. On peut toujours compter sur toi pour apporter des innovations su...
Iván Allora crei un nuovo post. Lo aspetterò.
Stenozar Ciao Ivan, ho inserito il post con la richiesta di traduzione. Se puoi vedere, grazie!
Iván perfect!
kats BONSOIR c bon merci j ai trouve ce weekend merci de votre reponse cdlt
the_giorgio Hi, nice work I would like to understand something about prorealtime code. With your ...
Iván Hello. When you use the drawcandle() instruction then in the configuration window you add ...
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
9 months ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
Bernard13 (Je réécris mon commentaire -français- en français car certains mots ne correspondaient pas ...
Iván 1000 indicateurs !!! brutaux
Lean Me parece muy buen indicador, y se complementa muy bien en mi sistema, ¿podrías crear un scr...
Iván Gracias! Para el screener sólo tienes que copiar el indicador y poner como condición de búsq...
Lean Muchas gracias Iván, ya lo he podido crear.
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.

Top