Optimized Trend Tracker

Category: Indicators By: Nicolas Created: March 24, 2021, 2:35 PM
March 24, 2021, 2:35 PM
Indicators
2 Comments

Optimized Trend Tracker OTT is an indicator that provides traders to find an existing trend or in another words to know which side of the current trend we are on.

We are under the effect of the uptrend in cases where the prices are above OTT , under the influence of a downward trend, when prices are below OTT it is possible to say that we are.

The first parameter in the OTT indicator set by the two parameters is the period/length. OTT 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.

(description from original author: KivancOzbilgic)

 

//PRC_Optimized Trend Tracker | indicator
//24.03.2021
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from pinescript

// --- settings 
length=2 //OTT Period
percent=1.4 //OTT Percent
mav = 0// MA type (0=SMA,1=EMA,2=WMA,3=Wilder,4=Triangular,5=End point,6=Time series,7 = Hull,8 = ZeroLag, 9=VAR
ShowSupport = 1 //show MA ; 1=true / 0=false
// --- end of settings 

src = customclose

if barindex>length*2 then 
 if mav>8 then //VAR (vidya MA)
  once Period = MAX(length, 4)
  series = src
  Smooth = 5
  once SC = 2 / (Smooth + 1)
  AbsCMO = (ABS(Chandle[Period](Series))) / 100
  IF BarIndex < Period THEN
   mavg = Series
  ELSE
   mavg = (SC * AbsCMO * Series) + (1 - (SC * AbsCMO)) * mavg
  ENDIF
 else
  mavg = average[length,mav](src)
 ENDIF

 fark=MAvg*percent*0.01
 longStop = MAvg - fark
 if longstop[1]>0 then 
  longStopPrev = longStop[1]
 else
  longStopPrev = longStop
 endif
 if MAvg > longStopPrev then 
  longStop = max(longStop, longStopPrev)
 endif
 shortStop =  MAvg + fark
 if shortStop[1]>0 then 
  shortStopPrev = shortStop[1]
 else
  shortStopPrev = shortStop
 endif 
 if MAvg < shortStopPrev then 
  shortStop= min(shortStop, shortStopPrev)
 endif

 once dir = 1

 if dir=-1 and mavg>shortstopprev then 
  dir = 1
 elsif dir=1 and mavgMT then 
  OTT = MT*(200+percent)/200 
 else
  OTT = MT*(200-percent)/200
 endif 

 mavgshow=undefined
 if showsupport then 
  mavgshow = mavg
 endif

endif 

return OTT[2] style(line,3), mavgshow

Download
Filename: PRC_Optimized-Trend-Tracker.itf
Downloads: 588
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...