TradingView
KivancOzbilgic
6 mar 2022 13:30

HIGH and LOW Optimized Trend Tracker HOTT LOTT 

Bitcoin / TetherUSBinance

Descrizione

Anıl Özekşi's latest development on his precious OTT - Optimized Trend Tracker:
tradingview.com/script/zVhoDQME/

In this version, there are two lines of OTT which are derived from HIGHEST price values (HOTT) and LOVEST price values (LOTT) which were originally sourced to CLOSE values on default OTT.

Another significant difference is there is no Support Line (Moving Average) in this version.

The area between HOTT and LOTT is FLAT ZONE which developer advises to do nothing.

Bars will be highlighted to Turquoise when candles close over HOTT, means an UPTREND SIGNAL
and to Fuchia when candles begin closing under LOTT line to indicate a DOWNTREND SIGNAL.

FLAT ZONE is highlighted also to have the maximum concentration on sideways market conditions.

There are three quantitative parameters in this indicator:
The first parameter in the OTT indicator set by the two parameters is the period/length.
OTT lines will be much sensitive to trend movements if it is smaller.
And vice versa, will be less sensitive when it is longer.
As the period increases it will become less sensitive to little trends and price actions.
In this way, your choice of period, will be closely related to which of the sort of trends you are interested in.

The OTT percent parameter in OTT is an optimization coefficient. Just like in the period
small values ​​are better at capturing short term fluctuations, while large values
will be more suitable for long-term trends.

The final adjustable quantitative parameter is HIGHEST and LOWEST length which is the source of calculations.


Anıl Özekşi generally works on 1 minute charts so I personally advise traders to optimize parameters to have more accurate signals. Just concentrate on FLAT price zones and indicator will do the rest in trends.


Built in Moving Average type defaultly set as VAR but users can choose from 10 different Moving Average types like:

SMA : Simple Moving Average
EMA : Exponential Moving Average
DEMA : Double Exponential Moving Average
WMA : Weighted Moving Average
TMA : Triangular Moving Average
VAR : Variable Index Dynamic Moving Average a.k.a. VIDYA
WWMA : Welles Wilder's Moving Average
ZLEMA : Zero Lag Exponential Moving Average
TSF : True Strength Force
HULL : Hull Moving Average

Note di rilascio

version updated to v5
Commenti
NiyaziSonmez
Hocam affınıza sığınarak;

OTTFunc(src,length,percent)=>
vCMO = nz((math.sum(src>src[1]?src-src[1]:0,9)-math.sum(src<src[1]?src[1]-src:0,9))/(math.sum(src>src[1]?src-src[1]:0,9)+math.sum(src<src[1]?src[1]-src:0,9)))
VAR = 0.0
VAR := nz(2/(length+1)*math.abs(vCMO)*src)+(1-2/(length+1)*math.abs(vCMO))*nz(VAR[1])
MAvg = VAR
fark = MAvg * percent * 0.01
longStop = MAvg - fark
longStopPrev = nz(longStop[1], longStop)
longStop := MAvg > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = MAvg + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := MAvg < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ? -1 : dir
MT = dir == 1 ? longStop : shortStop
OTT = 0.0
OTT := nz(MAvg > MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200)[2]
KivancOzbilgic
@NiyaziSonmez, çok daha pratik olmuş
ellerinize sağlık
güncellerim ben de ilk fırsatta
fthcyc
@KivancOzbilgic, @NiyaziSonmez tevafuk ise ayrı tabi.
businessduck
@NiyaziSonmez, looks good
Rgootee
@NiyaziSonmez, how to add this to the original indicator sir?
NiyaziSonmez
@Rgootee, Hi, Below I am sharing how to add the function for HOTT-LOTT as an example.

//@version=5

indicator(title='HOTT-LOTT v1.0', overlay=true)

OTTFunc(OTTSrc,percent)=>
fark = OTTSrc * percent * 0.01
longStop = OTTSrc - fark
longStopPrev = nz(longStop[1], longStop)
longStop := OTTSrc > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = OTTSrc + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := OTTSrc < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and OTTSrc > shortStopPrev ? 1 : dir == 1 and OTTSrc < longStopPrev ? -1 : dir
MT = dir == 1 ? longStop : shortStop
OTT = nz(OTTSrc > MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200)[2]

HLength = input.int(20, 'High Period')
Hpercent = input.float(1, 'High OTT Percent', step=0.1)
LLength = input.int(20, 'Low Period')
Lpercent = input.float(1, 'Low OTT Percent', step=0.1)

srcH = ta.highest(high, HLength)
srcL = ta.lowest(low, LLength)

OTTup = OTTFunc(srcH, Hpercent)
OTTdn = OTTFunc(srcL, Lpercent)

OttUp = plot(OTTup, color=color.green, title="OTT High")
OttDn = plot(OTTdn, color=color.red, title="OTT Low")
fill(OttUp,OttDn, color=color.new(color.silver,88), editable=false)
Rgootee
@NiyaziSonmez, Thank you sir , What you put on OTTSrc ? when i create a new script it say " Mismatched input 'fark' expecting 'end of line without line continuation'."
NiyaziSonmez
@Rgootee, OTTSrc becomes the ott indicator of whatever you give as a source. This is how the function works. For error, use tab at the beginning of each line after the first line of the function. the problem needs to be resolved.

Fonction
-TAB-bla bla bla
-TAB-bla bla bla
....
....
....
Spantree2002
Does this indicator repaint on previously closed candles?
Altro