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.

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:

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. • 53 days ago #

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

2. • 53 days ago #

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

3. • 35 days ago #

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

• • 34 days ago #

Avete provato a scaricare il file .itf?

Register or

Likes

Related users ' posts
davidelaferla
1 month ago
0
Indicators
Iván
1 month ago
4
Indicators
Hola Ivan. Thanks for your great job. I would appreciate if you have look at my request http...
Thank you for all these useful information!! Very great job Ivan! THank you so much
Merci Ivan, super travail. On peut toujours compter sur toi pour apporter des innovations su...
Iván
3 months ago
6
Indicators
Allora crei un nuovo post. Lo aspetterò.
Ciao Ivan, ho inserito il post con la richiesta di traduzione. Se puoi vedere, grazie!
perfect!
Iván
3 months ago
5
Indicators
Bonsoir, Pensez vous pouvoir répondre à ma question posée ci dessus? Ce serait vraiment tr...
Bonjour L'ensemble de l'indicateur est alimenté à partir de la ligne 9 avec la définition d...
BONSOIR c bon merci j ai trouve ce weekend merci de votre reponse cdlt
Iván
3 months ago
1
Indicators
Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
3 months ago
4
Indicators
Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
Iván
3 months ago
3
Indicators
Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
i love it !!! thanks.
:)
Iván
4 months ago
11
Indicators
Me parece muy buen indicador, y se complementa muy bien en mi sistema, ¿podrías crear un scr...
Gracias! Para el screener sólo tienes que copiar el indicador y poner como condición de búsq...
Muchas gracias Iván, ya lo he podido crear.
Iván
4 months ago
6
Indicators
Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván
5 months ago
4
Indicators
Hi You should delete from the indicator code all drawing functions and all variables not us...
I've created a screener to show [longcondition or shortcondition]
Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
Iván
5 months ago
6
Indicators
Thanks, now it's OK. in your first code at line 15-16 it's missing.
Hello Ivan Did you try a strategy with this indicator
Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
5 months ago
6
Indicators
Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
Gracias!!
i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
5 months ago
3
Indicators
Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
5 months ago
0
Indicators
Iván
5 months ago
3
Indicators
Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Hi, Yes I can translate it but please, create a new topic for it.
Fgats
6 months ago
3
Indicators
quelques explications en Français ici : Some explanations in French here : https://www.p...
Merci pour cette contribution, j'apprécie ! :)
Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
jacquesgermain
8 months ago
6
Indicators
Bonjour non pas de soucis car src=customclose donc dans le menu configuration/propriété me...
Merci Jacques , indic tres utile. J'ai un indic à programmer avec du price action. es tu dis...
ok pour regarder ...
Nicolas
10 months ago
1
Indicators
I really like it when you develop ideas around price movement! I am much less a fan of all t...
LucasBest
11 months ago
0
Indicators
LucasBest
11 months ago
1
Indicators
Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.

Top