Call Custom Function Error

When I call trin() function, it show the error "Error 31 syntax error,unexpected USER_FN,expecting IDENTIFIER, any suggestion?

function trin(){
shape = Buy * shapeUpTriangle + Sell * shapeUpTriangle;
priceAtBuy = ValueWhen( Buy, BuyPrice );
PlotShapes( shape, IIf( Buy, colorBrown, colorRed ) ,0,BuyPrice,-200);

}``

if (Name() == “01882”){
Buy =DateNum()==DateToDateDum(“20170831”); // custom entry on a fixed date
Sell = 0;
BuyPrice = 22.2;
trin(); //CALL FUNCTION

}

Trin() is a built-in function. http://www.amibroker.com/f?trin
You can not define user functions that have same identifier as built-in functions.

I try to user other function name e.g. 123, it dont work

@chunwai
123 is an illegal function name too… Did you read the language manual?

https://www.amibroker.com/guide/a_language.html

In particular:

Tokens
Identifiers are arbitrary names of any length given to functions and variables. Identifiers can contain the letters (a-z, A-Z), the underscore character ("_"), and the digits (0-9). The first character must be a letter.
AFL identifiers are NOT case sensitive.

3 posts were split to a new topic: Drag-drop creates new file (as documented)