# "Kolkata Meet Band Indicator" AFL

#### shravank30

##### Member
I have seen the "Kolkata Meet Band Indicator" mentioned in several posts.
But i could not find the AFL for the same.
I shall be grateful if the AFL for the same can be posted or the link where the same can be found

Thanks

##### Active Member
Here it is :

function KolIndicator(Price_Field, Angle)
{
a = (22/7)*(Angle/180);
Num = sin(1*a) * Price_Field + sin(2*a) * Ref(Price_Field,-1) + sin(3*a) * Ref(Price_Field,-2) + sin(4*a) * Ref(Price_Field,-3) + sin(5*a) * Ref(Price_Field,-4);
Den = sin(a) + sin(2*a) + sin (3*a) + sin(4*a) + sin(5*a);
kolkata = Num / Den;
return kolkata;
}

Angle = Param("ANGLE", 30, 0, 360, 1);
Field = ParamField("Price Field", 3);

Plot(KolIndicator(Field, Angle), "Kol Indicator", ParamColor("Color", colorLightGrey));

#### pride1760

##### Member
how can I convert this to metastock expert advisor?

thanks!

#### shravank30

##### Member
Thanks for posting the AFL

However, it is showing a syntax error on "return Kolkata;" line (line6)

Please correct the same and post again for which i shall be obliged

Thanks

##### Active Member
There is no error in the code. I have tried it thousands of time.
Please copy and paste it correctly!!!

----TIZ---------

Thanks for posting the AFL

However, it is showing a syntax error on "return Kolkata;" line (line6)

Please correct the same and post again for which i shall be obliged

Thanks

#### sikandar

##### Active Member
Here it is :

function KolIndicator(Price_Field, Angle)
{
a = (22/7)*(Angle/180);
Num = sin(1*a) * Price_Field + sin(2*a) * Ref(Price_Field,-1) + sin(3*a) * Ref(Price_Field,-2) + sin(4*a) * Ref(Price_Field,-3) + sin(5*a) * Ref(Price_Field,-4);
Den = sin(a) + sin(2*a) + sin (3*a) + sin(4*a) + sin(5*a);
kolkata = Num / Den;
return kolkata;
}

Angle = Param("ANGLE", 30, 0, 360, 1);
Field = ParamField("Price Field", 3);

Plot(KolIndicator(Field, Angle), "Kol Indicator", ParamColor("Color", colorLightGrey));