TEMA
TEMA is DEMA's lag correction taken one stage further, and the extra stage is measurable in both directions: it reaches a new level in four bars where a plain EMA needs twenty, and it sits outside the recent high-low range more than three times as often as DEMA does. MetaTrader 5 ships it as iTEMA, and the length you set is a third of the history it needs.
- Period set
- 14
- Bars needed
- 39
- Buffers plotted
- 1 of 4
Ilustratif — data sintetis, bukan kutipan langsung.
What TEMA tells you
DEMA takes an EMA, measures how far behind it is running by taking an EMA of that EMA, and adds the difference back. TEMA does the same thing with a third stage, and the coefficients — three, minus three, plus one — are what falls out of cancelling the lag twice rather than once. The result is the fastest line in this family and the one furthest from being an average: on a step change it arrives in a third of the time a plain EMA takes, and it regularly prints values that price never traded. Whether that is useful depends entirely on which side of a trade you put it on, which is the one thing most write-ups of it leave out.
- It reaches a new level in 4 bars where DEMA needs 6 and a plain EMA needs 20
- It leaves the last 14 bars' range on 7.5% of bars — DEMA 2.1%, a plain EMA 0.0%
- The extra stage buys speed and pays in overshoot; nothing about it is smoother
- 1 An EMA of price, an EMA of that, and an EMA of that again
- 2 Three chained lags, cancelled twice rather than once
- 3 TEMA = 3 × EMA − 3 × EMA(EMA) + EMA(EMA(EMA))
Tampilkan rumus & detail perhitungan
TEMA is one line of arithmetic, and every coefficient in it is forced:
TEMA = 3 × EMA(price) − 3 × EMA(EMA(price)) + EMA(EMA(EMA(price)))
DEMA cancels a single EMA’s lag once. Cancel it twice and this is what falls out — three terms with alternating signs whose coefficients sum to one, so the line still lives on the price scale rather than drifting off it. Subtract DEMA from TEMA of the same period and what remains is EMA − 2 × EMA(EMA) + EMA(EMA(EMA)): a second difference of the same chain, checked to within 5.7e-14 over 3,958 bars. The extra stage is not more smoothing. It is curvature.
The speed is real and so is the bill. On a step from 100 to 110 with period 14:
| 95% of the new level | Peak | |
|---|---|---|
| Plain EMA | 20 bars | 110.00 |
| DEMA | 6 bars | 111.17 |
| TEMA | 4 bars | 111.66 |
The peak matters as much as the timing: 111.66 is a price that never traded anywhere in the series. A real moving average cannot do that, because it is a weighted sum of its window with weights that add to one. On a random walk the line sits outside the last fourteen bars’ high-low range on 7.5% of bars — against 2.1% for DEMA and 0.0% for the plain EMA the same test was run on.
Which is why the template does not trade it. The obvious construction — a fast TEMA crossing a slow one — is the loudest thing in this family. Measured on the same random walk, TEMA 14/28 crosses 291 times, DEMA 14/28 crosses 227, and a plain EMA 14/28 crosses 114. Each of those crossings is a spread paid to find out whether the lead meant anything.
So the entries are left to the plain EMA pair and TEMA is put on the exit, where being early costs a re-entry instead of a trade. Against the same entries held until the opposite cross:
- Average hold: 32.5 bars → 20.5
- Share of the peak open profit realised: 16.6% → 22.0%
- Trades closed within two bars of opening: 8.1% → 1.2%
Measured across five random-walk series — 512 trades under the TEMA exit against 593 under the opposite-cross exit. A random walk says nothing about whether the strategy makes money; what it can compare is how much of a move is still there when the position closes.
The period is a third of the history. Each EMA in the chain waits for the one before it, so MT5 sets PLOT_DRAW_BEGIN to 3 × period − 3 and calculates nothing before then. A TEMA(14) needs 39 bars; a TEMA(50) needs 147. Nothing errors — the left of the chart is simply empty.
Sinyal
Sinyal yang dapat di-backtest dari TEMA — dan kondisi pasar yang cocok untuk masing-masing.
Price Against the Line
Siap di BuilderFast / Slow TEMA Cross
Siap di BuilderOvershoot Past the Range
Logika lanjutanImplementasi MT5
Apa yang benar-benar dihitung dan digambar MetaTrader 5 — acuan bagi setiap aturan di halaman ini.
Buffer
| Indeks | Buffer | Digambar di MT5 sebagai | Isinya |
|---|---|---|---|
| 0 | MAIN_LINE | TEMA | The line, and the only series MT5 plots. The indicator declares four buffers; the other three hold the EMA, the EMA of that EMA and the EMA of that, all marked INDICATOR_CALCULATIONS — working storage rather than output. The Builder reads index 0. |
Catatan platform
Bekerja paling baik / gunakan dengan hati-hati
Tidak ada indikator yang merupakan keunggulan universal. Inilah di mana TEMA membantu — dan di mana ia menyesatkan.
Bekerja paling baik
- On the exit side, where arriving early costs a re-entry rather than a losing trade
- Trends steep enough that the overshoot is behind price rather than ahead of it
- As a faster read of a higher timeframe, where its flips are rarer in chart-bar terms
- Anywhere a DEMA has been shortened to get more lead — this is the principled version of that shortening
Gunakan dengan hati-hati
- As an entry trigger: it pokes outside the recent range on 7.5% of bars, and most of those are not moves
- Ranges, where two corrections keep supplying lead to a move that is not there
- Short histories: nothing is drawn until three times the period minus three bars exist
- Reading the line as a level — it sits at prices that never traded more often than DEMA does
Buat strategi TEMA
Hubungkan sinyal ke aturan masuk dan keluar, lalu ekspor EA MT5 yang dapat dikompilasi — tanpa kode.
- One TEMA node on Close at 14, and two plain EMA nodes at 14 and 28
- TEMA falls through the fast EMA → Close the long. Rises through it → Close the short
- EMA 14 crosses above EMA 28 → Open Buy · SL 70 / TP 210. Below → Open Sell
- All three read the last closed bar, so every cross is a settled fact
- The close nodes come before the entries, and that ordering is deliberate
Gabungkan TEMA dengan indikator lain
Satu indikator jarang berdiri sendiri. Kombinasi ini menutupi titik buta TEMA.
TEMA + DEMA
- DEMA at 14
- TEMA at 14
- Compare
No single-flow template pairs them. Start from EMA Cross Entry x TEMA Early Exit, add a DEMA node at 14 on Close, and put it into a Compare against the TEMA node.
Buka Builder →TEMA + ADX
- ADX above 25
- EMA 14 crosses above EMA 28
- Buy
No single-flow template combines them. Add an ADX node with a Compare at 25 to EMA Cross Entry x TEMA Early Exit and join it to the entry Cross with an And gate — leave the exit path untouched.
Buka Builder →TEMA + ATR
- ATR at 14
- Stop loss in ATR mode
- TEMA crosses the fast EMA
The Stop Loss node has an ATR mode, so this needs no extra condition — swap the fixed distance for the ATR setting and the exit path is unchanged.
Buka Builder →Parameter
Nilai awal untuk divalidasi pada pasangan dan timeframe Anda sendiri — bukan pengaturan yang dijamin.
| Parameter | Default | Rentang uji yang disarankan | Fungsinya |
|---|---|---|---|
| Period | 14 | 1–999 | The EMA length used three times — on price, on the result, and on that result. Longer is slower as usual, but the history it consumes is three times what you set: MT5 draws nothing until 3 × period − 3 bars exist, because the third EMA cannot start until the second has. A TEMA(50) needs 147 bars. |
| Applied price | Close | Close / Open / High / Low / Median / Typical / Weighted | Which series the whole calculation runs on. As with DEMA this is a real control rather than a formality — all three stages and therefore both corrections are computed from whatever you choose. |
| Shift | 0 | 0–100 | Which bar to read. The template sets 1 so an exit is decided on a closed bar. This is not iTEMA's own ma_shift, which slides the drawn line sideways — the Builder pins that to 0 and exposes only the bar offset. |
| Timeframe | Current | Current / M1–MN1 | Which timeframe's bars the line is built from. Set above the chart and its flips become rarer in chart-bar terms, which is one of the few ways to keep the lead without paying the full overshoot bill. |
Preset awal
Contoh pasar
Di mana TEMA bekerja, di mana ia gagal, dan bagaimana filter mengubah hasilnya.
Out near the top
A move stalls and the line breaks the fast average several bars before the entry pair would have crossed back. The position closes with most of the excursion still in it — the behaviour the 16.6% to 22.0% measurement is describing.
The exit that was early
A pullback inside a live trend breaks the line, the position closes, and the trend continues. This is the cost of the design, and it is deliberately the cheap side of the trade: the entry rule is still valid and can fire again.
Same stretch, strength required
The identical range with a trend-strength condition on the entry. The exit path is untouched, because closing early in a range was never the problem.
FAQ
- Is TEMA built into MetaTrader 5?
- Yes. iTEMA is a standard MQL5 function taking a symbol, a timeframe, the period, an ma_shift and an applied price, and the terminal also ships a TEMA custom indicator under Indicators\Examples. The Builder calls the built-in, so a generated EA needs no extra files on the terminal that runs it.
- Is TEMA just three EMAs averaged together?
- No. It uses three chained EMAs but combines them as 3 × EMA − 3 × EMA(EMA) + EMA(EMA(EMA)) — two of the three terms are subtractions. Averaging them would be slower than any of them; the alternating signs cancel the lag twice over, which is what makes the line arrive early. The coefficients sum to one, so the result still lives on the price scale.
- How is it different from DEMA?
- One correction stage. Same period, same applied price, same smoothing constant; the difference between the two lines is EMA − 2 × EMA(EMA) + EMA(EMA(EMA)), a second difference of the same chain. In numbers: on a step from 100 to 110, TEMA reaches 95% of the new level in 4 bars against DEMA's 6, and on a random walk it sits outside the recent 14-bar range on 7.5% of bars against DEMA's 2.1%. Faster, and wrong about levels more often.
- How many bars does it need before it draws?
- 3 × period − 3. Each EMA in the chain waits for the previous one, so a period of 14 needs 39 bars and a period of 50 needs 147. MT5 returns without calculating while the history is shorter, so the left of the chart is empty rather than wrong.
- Why does the template use TEMA to close rather than to open?
- Because the measured overshoot makes it an expensive trigger and a cheap exit. It sits outside the recent range on 7.5% of bars, so as an entry it mostly buys round trips — TEMA 14/28 crosses 291 times on a random walk where a plain EMA 14/28 crosses 114. On the exit the same eagerness shortens the average hold from 32.5 bars to 20.5 and raises the realised share of the peak open profit from 16.6% to 22.0% (512 trades against the opposite-cross exit's 593, over five random-walk series), and a wrong exit costs a re-entry rather than a trade.
- Can I build a TEMA EA without coding?
- Yes. The EMA Cross Entry x TEMA Early Exit template enters on a plain EMA 14/28 crossover and closes when TEMA breaks the fast EMA, with the close nodes ahead of the entries so a netting account reverses correctly. The three periods, the applied price, the shift, the stop distances, the lot and the spread limit are all EA inputs.
- How should I validate settings before going live?
- Backtest on quality tick data, then demo, and read the trade list rather than only the curve. Two checks are specific to this indicator. Make sure the test contains ranges as well as trends, because the overshoot only shows its bill in the former. And before lengthening the period to calm the line down, check whether the noise you are seeing is on the entry side — if it is, the entry rule is what needs the filter, and slowing TEMA down removes the one property you selected it for.
Artikel terkait
Glossary