Skip to main content

JMA Function Include afl for Amibroker (AFL)

kaiji over 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:

Put this in Includes folder and call it JMA_Include.afl so that you can use other indicators that need it.

Indicator / Formula

Copy & Paste Friendly
function JMA( array, per )
{
	TN1=MA(array,per);
	s1=0;
	for( i = 0; i < per; i=i+1 )
	{
		s1=s1+((per-(2*i)-1)/2)*Ref(array,-i);
	}
	return TN1+(((per/2)+1)*S1)/((per+1)*per);
}

P = ParamField("Price field");
Periods = Param("Periods", 15, 2, 100, 1, 10);

0 comments

Leave Comment

Please login here to leave a comment.