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

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

  2. Stenozar • 297 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 • 279 days ago #

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

    • Iván • 278 days ago #

      Avete provato a scaricare il file .itf?

  4. AndyB72 • 93 days ago #

    Caricato ora sulla V12, nessun errore.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas
2 years ago
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
manfeber Buenos dias,alguien me podria decir como se descargar el archivo o el indicador Q-Trend??,ya...
BriceE Bonjour Nicolas, Je suis a la recherche d'indicateurs pour me donner la meilleure indicatio...
Nicolas
2 years ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
mortezaali14 Salut Nicholas, comment exécuter ce fichier dans les métadonnées
Nicolas
2 years ago
FXtonio Bonjour Nicolas, merci pour cette merveille, je l'utilise en compl2ment du "magical buy sell...
xpe74 Bonjour Nicolas, quelle est la valeur de MA que l'on doit prendre en compte pour intégration...
Nicolas Il faut faire un CALL de l'indicateur et y placé en paramètre les valeurs des périodes souha...
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
xpe74 Utilitaire vraiment top, d'autant qu'ajouter des filtres de seuil peux aider a limiter le no...
supertiti Bel outil si on ne se tape pas sur les doigts avec ! Comment ajoute-on une image avec le co...
magnus59 Hi Nicolas, thaks for your great work here, I need a scanner for the swedish OMX when ma...
Nicolas Yes, sure please open a new topic in the ProScreener forum section, thank you.
paullyons Hello! Thanks for post your indicators. I'd like you to let me know how to draw lines for ...
Rafa Hi Nicolas! I can´t install this indicator. it installs in a separate window not as an av...
Nicolas Add it on the price, see how: https://www.prorealcode.com/blog/video-tutorials/how-to-add-an...
Frankyslo1 No consigo instalarlo en el precio en PRL-version 10
Jiacky
3 years ago
Kalman Filter
Kalman Filter
0
Indicators
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...

Top