Laguerre candles

Category: Indicators By: Bruno Carnazzi Created: March 1, 2021, 11:23 AM
March 1, 2021, 11:23 AM
Indicators
2 Comments

Here is an original way to represent price fluctuations. This type of candle is very similar to the heiken ashi candles, but are, in my opinion, more logical in their construction and interpretation. The gamma parameter allows you to select the desired level of smoothness, from 0 (more reactive) to 1 (smoother).


// --- settings 
gamma = 0 //(0 to 1)
// end of settings 

OSeries = Open

once ol0 = OSeries
once ol1 = OSeries
once ol2 = OSeries
once ol3 = OSeries

IF BarIndex = 0 THEN
OL = OSeries
ELSE
ol0 = (1 - gamma) * OSeries + gamma * ol0[1]
ol1 = -gamma * ol0 + ol0[1] + gamma * ol1[1]
ol2 = -gamma * ol1 + ol1[1] + gamma * ol2[1]
ol3 = -gamma * ol2 + ol2[1] + gamma * ol3[1]
OL = (ol0 + 2 * ol1 + 2 * ol2 + ol3) / 6
ENDIF

CSeries = CustomClose

once cl0 = CSeries
once cl1 = CSeries
once cl2 = CSeries
once cl3 = CSeries

IF BarIndex = 0 THEN
CL = CSeries
ELSE
cl0 = (1 - gamma) * CSeries + gamma * cl0[1]
cl1 = -gamma * cl0 + cl0[1] + gamma * cl1[1]
cl2 = -gamma * cl1 + cl1[1] + gamma * cl2[1]
cl3 = -gamma * cl2 + cl2[1] + gamma * cl3[1]
CL = (cl0 + 2 * cl1 + 2 * cl2 + cl3) / 6
ENDIF

DRAWCANDLE(OL, high, low, CL)

return

Download
Filename: Laguerre-candles.itf
Downloads: 236
Bruno Carnazzi Senior
https://market.prorealcode.com/store/digital-filters-workshop/
Author’s Profile

Comments

Logo Logo
Loading...