Please help me correct my code for Error 31

Dear All,
I am new and learning AFL. I 've just update Amibroker Ver6.49.1 and have error 31 as :

//_SECTION_BEGIN("MA-T3 Setting");
#include T3_include.afl;
p=Param("Cross Period 1",4,1,20,1); 
Map=T3(C,p);
k=Param("Cross Period 2",5,1,20,1);//6
MAk=T3(C,k);
y=p*T3(C,p)-(p-1)*Ref(T3(C,p-1),-1);
tClose=(p*(k-1)*T3(C,k-1)-k*(p-1)*T3(C,p-1))/(k-p);
DescCrossPrediction=Cross(tClose,C);
AscCrossPrediction=Cross(C,tClose);
ExpectMAcross=DescCrossPrediction OR AscCrossPrediction;
Confirmed=Cross(MAk,MAp) OR Cross(MAp,MAk);
UR=2*Highest(ROC(C,1));LR=2*Lowest(ROC(C,1));
Ucoeff=1+UR/100;Lcoeff=1+LR/100;
Filter=tClose<Lcoeff*C OR tClose>Ucoeff*C;
AddColumn(MAp,"MAp");
AddColumn(MAk,"MAk");
//Plot(C,"",7*Filter+1,64); //No. '64' designates price chart as candle
//Plot(MAp,"",7,1); //Red Line - The No. '4' designates the red color & No. '1'
//Plot(MAk,"",2,1); //Green Line - - The No. '4' designates the red color & No. '1'
bars=BarsSince(Cross(MAp,MAk) OR Cross(MAk,MAp));
expect=NOT(Filter);

Error 31. Syntax error, expecting at Map=T3(C,k);

function T3(price,periods) //AMA-based
{
s=Param("Hot ?",0.618,0,100,0.001,0);
periods = 2/(periods+1);
e1=AMA(price,periods);
e2=AMA(e1,Periods);
e3=AMA(e2,Periods);
e4=AMA(e3,Periods);
e5=AMA(e4,Periods);
e6=AMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}
P = ParamField("Price field");
periods = Param( "Periods", 3, 1, 100, 1 );

My goal how to call file include .
Please help me correct them . Thanks for your help.

@Huynq99, Map() is now a function in Amibroker. So you can't use it as a variable name.

Please, see this post by @Tomasz:

https://forum.amibroker.com/t/amibroker-6-49-1-beta-released/35891/2

To avoid the error, change the variable name to something else wherever you reference it in your code.
For example:

MapT3 = T3(C,p);

By the way, if you press F1 on the error line you will see a description regarding the cause of the error:

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.