Duplicate: ALMA, was: How to use indicator from internet in coding?

I download a indicator formula called ALMA from internet but I can't use it in coding.

If I want to use MA in afl coding, I will type MA(ARRAY, Range); . But that doesn't work with ALMA. How can I put alma indicator in my afl? Here is ALMA.

//
function ALMA(priceField, windowSize, sigma, Offset)
{
	m = floor(Offset * (windowSize - 1));
	s = windowSize / sigma;

	w = 0;
	wSum = 0;

	for(i = 1; i < windowSize; i++)
	{
		w[i] = exp(-((i-m)*(i-m))/(s*s)); // 2 should be there?
		wSum += w[i];
	}

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

	outalma = Null;

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

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

			outalma[j] = alSum;
		}
	}
	
	return outalma;
}

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);

Plot(ALMA(p, windowSize, sigma, Offset),"ALMA", ParamColor("Color",
colorBlue), ParamStyle("Style"));

Please help. Thank you.

Moderator comment: Follow forum rules and USE CODE TAGS. I added them for you, but really it is not fun having to fix dozens of improperly formatted posts.

You did not SEARCH THE FORUM before posting. The code you have included is wrong. Instead of looking over random places on the Internet you should just have searched the forum https://forum.amibroker.com/search?q=ALMA

Correct code is here: Arnaud Legoux Moving Average