chunwai
November 28, 2017, 12:53pm
#1
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
}
Tomasz
November 28, 2017, 2:48pm
#2
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.
chunwai
November 28, 2017, 3:17pm
#3
I try to user other function name e.g. 123, it dont work
beppe
November 28, 2017, 5:17pm
#4
@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.
Tomasz
Split this topic
February 3, 2019, 3:07pm
#5