The Trend Continuation Factor is an indicator built to draw trend state. It is a typical momentum indicator calculated with the rate over change price movement, compound over a summation period.
The oscillator is made of 2 lines, the green one for summation of the ROC positive variation over the “sumperiod” and the red one for the negative price movement.
Trade would be initiated when the 2 lines cross, but it is also an effective oscillator to keep an eye on the recent trend momentum continuation.
//parameters
// SUMperiod = 35
r = ROC[1](close)
if r>0 then
pc = r
else
pc = 0
endif
if r<0 then
nc = -r
else
nc = 0
endif
if nc=0 then
ncf = 0
else
ncf = ncf[1]+nc
endif
if pc=0 then
pcf = 0
else
pcf = pcf[1]+pc
endif
TCFplus = SUMMATION[SUMperiod](pc) - SUMMATION[SUMperiod](ncf)
TCFminus = SUMMATION[SUMperiod](nc) - SUMMATION[SUMperiod](pcf)
RETURN TCFplus coloured(0,255,0) as "TCF +", TCFminus coloured(255,0,0) as "TCF -"