DislikedOhka and KingSizePips provided TS code for the regular Laguerre in the main forum. I will try to modify to get the MA= 1 - 3 (I don't know how to make general loop in TS). Since I have never seen TS, I am not sure it will work. If it generates any error or the values don't match the Laguerre-ACS1, Ohka can correct it.
Hi Ohka, if you read this, please check it and correct if necessary. Thanks.
Hope it works. Let us know.
chandra
{Start of TS-Laguerre-ACS1 code}
inputs: gamma(0.5), MA(2) ;
Vars: L0(0) ,
L1(0) ,
L2(0) ,
L3(0) ,
CU(0) ,
CD(0) ,
dummy(0),
LaguerreRSI(0) ;
L0 = (1 - gamma) * close + 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] ;
CU = 0 ;
CD = 0 ;
if L0 >= L1 then CU = L0 - L1 Else CD = L1 - L0 ;
if L1 >= L2 then CU = CU + L1 - L2 Else CD = CD + L2 - L1 ;
if L2 >= L3 then CU = CU + L2 - L3 Else CD = CD + L3 - L2 ;
if CU + CD <> 0 then dummy = CU / (CU + CD) ;
if MA < 2 then LaguerreRSI = dummy ;
if MA = 2 then LaguerreRSI = (dummy + dummy[1])/2 ;
if MA > 2 then LaguerreRSI = dummy + dummy[1] + dummy[2])/3 ;
Plot1(LaguerreRSI, "LaguerreRSI") ;
Plot2(.85) ;
Plot3(.15) ;
{End of TS-Laguerre-ACS1 code}Ignored
Chandra,
as I'm on the road for a couple of weeks, I won't have access to a client with TS installed, so I can't verify TS code. TS does have a MA function, so there's no need to do your 'three IF...' lines. It can done be directly with one call.
bye
Ohka