Color CoeffOfLine

Category: Indicators By: Nicolas Created: July 26, 2019, 7:59 AM
July 26, 2019, 7:59 AM
Indicators
7 Comments

CoeffofLine indicator shows the most likely future price direction (2-3 bars).

The indicator depends on symbol, timeframe and period. If the indicator is turned up, it’s a signal to open long position. A signal to close long position is: turn down of the indicator and a confirmation from lower timerframe (negative values). The similar rules for short position: turn down on the current timeframe, for closing of short position it needs a confirmation from lower timeframe (positive values).

description found on the web. Indicator converted from MT4 by a request in the indicators forum section.

//PRC_CoeffOfLine | indicator
//26.07.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

ndot=5

TYVar=0
ZYVar=0
N=0
M=0
TIndicatorVar=0
ZIndicatorVar=0

for cnt=ndot downto 1 do 
 ZYVar=ZYVar+(High[cnt-1]+Low[cnt-1])/2*(6-cnt)
 TYVar=TYVar+(High[cnt-1]+Low[cnt-1])/2
 N=N+cnt*cnt
 M=M+cnt
 wa=wilderaverage[5](medianprice)[3]
 ZIndicatorVar=ZIndicatorVar+wa[cnt-1]*(6-cnt)
 TIndicatorVar=TIndicatorVar+wa[cnt-1]
next 

AY=(TYVar+(N-2*ZYVar)*ndot/M)/M
AIndicator=(TIndicatorVar+(N-2*ZIndicatorVar)*ndot/M)/M

cfl=(-1000)*Log(AY/AIndicator)

if cfl>cfl[1] then 
 if cfl>0 then 
  r=0
  g=255
  b=0
 endif
 if cfl<0 then 
  r=255
  g=0
  b=255
 endif
else
 if cfl>0 then 
  r=0
  g=0
  b=255
 endif
 if cfl<0 then 
  r=255
  g=0
  b=0
 endif
endif

return cfl coloured(r,g,b) style(histogram)

 

 

Download
Filename: PRC_CoeffOfLine.itf
Downloads: 278
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...