Convert PLdot to ALMA ?

#1
AFL expert here
Pls convert PLdot code to ALMA average code
PLdot code is as follows

_SECTION_BEGIN(" PLDot");

D1=(High+Low+Close)/3;

D2=(Ref(High,2)+Ref(Low,2)+Ref(Close,2))/3;

D3=(Ref(High,3)+Ref(Low,3)+Ref(Close,3))/3;

PLDot=(D1+D2+D3)/3;

Plot(PLDot," PLDot",colorYellow,styleLine);

_SECTION_END();

As this gives different values (Inherent nature of averages) bcoz of smoothness makes real time decision making difficult :annoyed: so pls convert it to more fixed variable than dynamic one without losing its responsive value
What could be the solution pls help.............
I am zero in coding
I had seen on net ALMA averages which is best than EMA so can this code be converted to ALMA taking core value for average from PLdot
Pls somebody try this if solution is workable
Code for ALMA avg is as follows

_SECTION_BEGIN("ALMA");
p = ParamField("Price Field");
windowSize = Param("Window Size", 9, 5, 201, 2);
sigma = Param("Sigma", 6, 1, 20);
Offset = Param("Offset", 0.85, 0.05, 1.0, 0.05);

m = floor(Offset * (windowSize - 1));
s = windowSize / sigma;

w = 0;
wSum = 0;

for(i = 1; i < windowSize; i++)
{
w = exp(-((i-m)*(i-m))/(2*s*s));
wSum += w;
}

for(i = 1; i < windowSize; i++)
{
w = w / wSum;
}

alma = Null;

for(j = 1; j < BarCount; j++)
{
alSum = 0;

if(j < windowSize)
{
alma[j] = Null;
}
else
{
for(i = 1; i < windowSize; i++)
{
alSum += p[j - (windowSize - 1 - i)] * w;
}

alma[j] = alSum;
}
}

Plot(alma, "ALMA("+windowSize+","+sigma+","+Offset+")", ParamColor("ALMA Color", colorRed), ParamStyle("ALMA Style", styleLine|styleThick|styleNoLabel), maskDefault);
_SECTION_END();

Regards,
Pan
 
#2
AFL expert here
Pls convert PLdot code to ALMA average code
PLdot code is as follows
As this gives different values (Inherent nature of averages) bcoz of smoothness makes real time decision making difficult :annoyed: so pls convert it to more fixed variable than dynamic one without losing its responsive value
What could be the solution pls help.............
I am zero in coding
I had seen on net ALMA averages which is best than EMA so can this code be converted to ALMA taking core value for average from PLdot
Pls somebody try this if solution is workable
Code for ALMA avg is as follows

Regards,
Pan
AFL expert pls help here with code
 

Similar threads