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

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

  2. Stenozar • 298 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 • 94 days ago #

    Caricato ora sulla V12, nessun errore.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
Roland57800 Bonjour Noobywan, si je comprends bien l'utilisation de ce code que je trouve particulièr...
Noobywan Bonjour, quand la question a été posée dans le forum à celui qui avait fait la requête en am...
Fabian This Code draws only a retangle if the condition has been confirmed and NOT before (in that ...
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
simmerseb Bonjour, merci beaucoup pour cet indicateur je le trouve très clair et pertinent.
fazel53 How do i attach this indicator to my mt5 platform?
Nicolas You can't! All indicators here are for ProRealTime trading platform: https://www.prorealtime...
Nicolas c'est exactement ce que je fais entre les lignes 58 et 64 pour pouvoir tracer la ligne complète
Italo Fabian Nicolas, Ces matrices sont-elles des vecteurs unidimensionnels ou multidimensionnels? Depu...
Denis Bonjour Nicolas et RicLg, Merci Nicolas pour cet indicateur intéressant et merci RicLg pour...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Nicolas Il faut l'ajouter sur le prix avec l'icône de la clé situé en haut à gauche du graphique du ...
jerome777 merci de ta réponse
jerome777 bonjour c est bon il fonctionne parfaitement merci beaucoup
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...

Top