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

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

  2. Stenozar • 346 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 • 328 days ago #

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

    • Iván • 327 days ago #

      Avete provato a scaricare il file .itf?

  4. AndyB72 • 142 days ago #

    Caricato ora sulla V12, nessun errore.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
tradingpro salve io faccio spread trading e volevo sapere come impostare un profitto da chiudere in a...
Nicolas Per favore non fare domande generali, non correlate al post. Usa invece il forum.
Bard Incredible, that is the clearest depiction of the trend I've ever seen Nicolas. (I just chan...
Vonasi Discussion on this indicator/filter can be found here: https://www.prorealcode.com/topic/121...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
Domenec Claro Juanjo de todas maneras en deinversoratrader.com tienes estsos osciladores evolucionad...
Dron Hola Domenec, en la descripción hablas del indicador velas de colores, no lo encuentro en la...
Domenec Hola Dron mira en el blog deinversoratrader.com en formacion indicadores ahi hay varios grat...
rama I want to use this indicator in trading system, it says zig zag is obsolete and not supported
Nicolas Right, due to its repainting behavior, the zigzag is not allowed in automated trading with r...
rama I noticed it changes as time progress, I am 7 as the average, how many period it wont chang...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
Rafa And the PriceMAPeriod? aren´t the same?
Nicolas The PriceMAPeriod is the period to make the average of all the last X medianprice found.
Rafa Thanks a lot Nicolás. Have a nice day
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
ullle73 nicolas, can you somehome make this to be in the background of the price chart?
jonpt88 none did that yet right?
Nicolas You can ask for a code modification on forums, please open a new topic with your request.
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
bolsatrilera
7 years ago
Rainbow Oscillator
Rainbow Oscillator
1
Indicators
Maxime Baudin Interesting, thanks! Combine this indicator with the bollinger bands there is enough to make...
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
supertiti Bonsoir à tous For those who like me want to calibrate this indicator on a scale of 0 to ...
verdi55 You can find me at www.FXautomate.com Ahh. So i got it ? 4 different supertrends without th...
juanj What? This has nothing to do with the website. The site is simply a service to help people ...
Nicolas Advertising is allowed,as long as people are helping others and if provided services are abo...
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...

Top