The U Trend Sensor oscillator is derived from the step percent variation of 2 different types of triangular moving average. When the oscillator return values over the zero level, a bullish trend is occuring, while a bearish one occurs when the oscillator navigate below this level.
Because of treshold of variations are inherit from percentage of price movement, this parameters must be adapted to the instrument and the timeframe where the indicator is attached.
Trades signals can also be taken more agressivly by crossing of the signal line and the UTS one. Signal line can be desactivated into parameters.
Parameters (example on DAX 2h timeframe)
once fss = close
once sss = close
fMA = TriangularAverage[periodf](close)
sMA = TriangularAverage[periods](close)
if(fMA > fss + (fMA/100)*fpercent) THEN
fss = fMA
ELSIF (fMA < fss - (fMA/100)*fpercent) THEN
fss = fMA
ELSE
fss = fss
ENDIF
if(sMA > sss + (sMA/100)*spercent) THEN
sss = sMA
ELSIF (sMA < sss - (sMA/100)*spercent) THEN
sss = sMA
ELSE
sss = sss
ENDIF
U = fss - sss
UMM = exponentialaverage[p](U)
if(plotsignal) THEN
signal = average[psignal](UMM)
ENDIF
RETURN UMM as "U Trend Sensor", signal as "signal", 0 as "zero level"