TradingView
causecelebre
25 de Abr. de 2019 9:08

Trend Direction Force Index - TDFI [wm] 

USD/JPYOANDA

Descripción

TDFI can range from -1 to 1 and thus indicate the direction of the trend.

In periods of consolidation ratios take very low values ​​close to zero as a rule, do not exceed the value of 0.05 (and -0.05), which have set arbitrarily as horizontal signal lines. Rate accelerates rapidly to higher values ​​when the consolidation ends and is a good chance of becoming a permanent trend.

As an extension, the trader can assume that as long as the pointer moves above the signal line and does not come down to the low value of less than 0.05 for at least two bars the trend continues. So the descent below signal line and a return to higher values ​​should be interpreted as a temporary weakening trend. Not before rate remains below 0.05 for at least 2 bars, can we consider that the market is likely to begin to consolidate

In addition, we can assess the strength of the trend, depending on the value of the index – the index reaches 1 trend is strong (-1 is a strong downward trend) and generally values ​​above 0.6 should be so interpreted. Less than in decline should be considered that the trend is losing its momentum.

Notas de prensa

For v2 of this indication see tradingview.com/script/HUpIful1-Trend-Direction-Force-Index-v2-TDFI-wm/

Change Log:

* Refactored tdfi implementation. Functionally exactly the same
* Added selectable smoothers
* Added finer grained inputs fora each smoother
Comentarios
AliKlc
great indicator. We can't set an alarm to its properties and receive a signal. I would appreciate your help. Thank you.
erickbabu92
@AliKlc, true
laurentg
HI how do I add Tema in the source code or other moving averages?
causecelebre
@laurentg, AFAIK there is no pine TEMA so you would have to implement your own function and replace the call to ema(....) by referring to that, e.g.

tema(src, len) =>
ema1 = ema(src, len)
ema2 = ema(ema1, len)
ema3 = ema(ema2, len)
(3 * ema1) - (3 * ema2) + ema3

mma = tema(price * 1000, lookback)
smma = tema(mma, lookback)
causecelebre
Note the above won't be interpreted correctly as the tema function body needs to be indented correctly
laurentg
@causecelebre, I don't know what you mean? If i givve pinescript the calculation of tema it should work right ? so i know have this
tema(src, len) =>
ema1 = ema(src, len)
ema2 = ema(ema1, len)
ema3 = ema(ema2, len)
(3 * ema1) - (3 * ema2) + ema3

mma = tema(price * 1000, lookback)
smma = tema(mma, lookback)

impetmma = mma - mma[1]
impetsmma= smma - smma[1]
divma = abs(mma - smma)
averimpet = (impetmma + impetsmma) / 2

number = averimpet
pow = 3
result = na

for i = 1 to pow - 1
if i == 1
result := number
result := result * number

tdf = divma * result
ntdf = tdf / highest(abs(tdf), lookback * 3)

c = ntdf > filterHigh ? green : ntdf < filterLow ? red : gray
plot(ntdf, linewidth = 2, color = c)

hline(filterHigh, color = black)
hline(filterLow, color = black)
But i go the error line 9, mismatched ema1 expcting end of line without continuation.
causecelebre
Of course, other MA'a can be used by simply replacing ema with such
laurentg
@causecelebre, yes i backtested it on mt4 tema seems best option ;p
causecelebre
@laurentg, I've had a few other request for different smoothers. I will implement a v2 and share it. What TEMA settings did you use?
laurentg
@causecelebre, That would be awesome I use setting 10
Más