NonLagDot trend indicator

Category: Indicators By: Nicolas Created: December 23, 2016, 4:26 PM
December 23, 2016, 4:26 PM
Indicators
11 Comments

Nonlagdot is an indicator, which gives an interpretation of market trends. Notation of trends is conducted in accordance with dominant market forces.

If the bulls (buyers) are dominant, it will be marked with green dots on a chart. In the case of dominance of the bears (sellers) on the schedule this will be indicated by red dots. Please remind of changing the way the returned values are set on chart (set them to points, not lines) and change the color accordingly to the trend direction.

(description found on internet). Converted from Metatrader4 version by request on forums.

//PRC_NonLagDot | indicator
//23.12.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//Converted from MT4 version

// --- parameters
Price         = customclose
//Length        = 10
//Filter        = 0
//Deviation     = 0
// ---

cCycle= 4
if barindex>Length then
 pi=3.1415926535
 Coeff= 3*pi
 Phase=Length-1
 Len=Length*cCycle + Phase

 Weight=0
 Sum=0
 t=0

 for i =0 to Len-1 do
  g=1.0/(Coeff*t+1)
  if (t<=0.5) then
   g=1
  endif
  beta=Cos(pi*t)
  alfa=g * beta
  pprice = price[i]//average[1](price)[i]
  Sum=Sum+(alfa*pprice)
  Weight=Weight+alfa
  if(t < 1) then
   t=t+(1.0/(Phase-1))
  elsif (t < Len-1)then
   t=t+((2*cCycle-1)/(cCycle*Length-1))
  endif
 next

 if (Weight > 0)  then
  MABuffer=(1.0+Deviation/100)*Sum/Weight
 endif
 if (Filter>0) then
  if(Abs(MABuffer-MABuffer[1]) < Filter*Pointsize) then
   MABuffer=MABuffer[1]
  endif
 endif
endif

return MABuffer

 

Download
Filename: PRC_NonLagDot.itf
Downloads: 267
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...