RSI Laguerre self adjusting gamma with Fractals Energy

Category: Indicators By: Nicolas Created: March 26, 2017, 10:18 AM
March 26, 2017, 10:18 AM
Indicators
12 Comments

The Laguerre RSI technical indicator is a trend indicator based on a Laguerre filter.

The Laguerre indicator plots the weighted price trend line in a different window in the price graph window.

The Laguerre RSI indicator plots the weighted RSI indicator value filtered with a Laguerre filter. The gamma sensibility of the Laguerre filter is self adjusted with the “fractals energy” as the original author describes it.
This “energy” is the curve of yellow color, while the Laguerre RSI adjusted with this energy is the blue one.

Indicator translated from TOS code, requested on English forum.

//PRC_LaguerreRSI Fractals Energy | indicator
//23.03.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from original code from TOS (author:Mobius)

// --- settings
//nFE=13 //length for Fractal Energy calculation
// --- end of settings

// Calculations
if barindex>nFE then
 o = (open + close[1]) / 2
 hh = Max(high, close[1])
 ll = Min(low, close[1])
 c = (o + hh + ll + close) / 4
 gamma = Log(Summation[nFE](Max(high, close[1]) - Min(low, close[1])) / (Highest[nFE](high) - Lowest[nFE](low)))/ Log(nFE)

 L0 = (1 - gamma) * c + gamma * L0[1]
 L1 = -gamma * L0 + L0[1] + gamma * L1[1]
 L2 = -gamma * L1 + L1[1] + gamma * L2[1]
 L3 = -gamma * L2 + L2[1] + gamma * L3[1]
 if L0 >= L1 then
  CU1 = L0 - L1
  CD1 = 0
 else
  CD1 = L1 - L0
  CU1 = 0
 endif

 if L1 >= L2 then
  CU2 = CU1 + L1 - L2
  CD2 = CD1
 else
  CD2 = CD1 + L2 - L1
  CU2 = CU1
 endif

 if L2 >= L3 then
  CU = CU2 + L2 - L3
  CD = CD2
 else
  CU = CU2
  CD = CD2 + L3 - L2
 endif
 
 if CU + CD <> 0 then
  lagRSI = CU / (CU + CD)
 else
  lagRSI=0
 endif
endif

RETURN gamma coloured(200,200,0) as "gamma", lagRSI coloured(0,128,255) style(line,2) as "Laguerre RSI self adjusting", 0.2 style(dottedline,1) as "oversold level", 0.8 style(dottedline,1) as "overbought level"

 

Download
Filename: PRC_LaguerreRSI-FractalsEnergy.itf
Downloads: 557
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...