ABC = MA( Open , 20 ) > MA ( Open , 200 )
DEF = TEMA (Close , 50 ) > DEMA ( Close , 150 )
Buy = ABC > DEF
Sell = DEF > ABC
What's wrong with that? Error 30 in DEF. Please help, thanks.
ABC = MA( Open , 20 ) > MA ( Open , 200 )
DEF = TEMA (Close , 50 ) > DEMA ( Close , 150 )
Buy = ABC > DEF
Sell = DEF > ABC
What's wrong with that? Error 30 in DEF. Please help, thanks.
You are missing SEMICOLONS at the end of lines.
Read the manual please AFL Reference Manual
Language structure
Each formula in AFL contains of one or more expression statements. Each statement MUST be terminated by semicolon (;). In this way you are able to break long expressions into several physical lines (in order to gain clarity) and AmiBroker will still treat it like a single statement until terminating semicolon.
Examples:
x = ( y + 3 ); /* x is assigned the value of y + 3 */
x = y = 0; /* Both x and y are initialized to 0 */
proc( arg1, arg2 ); /* Function call, return value discarded */
y = z = ( f( x ) + 3 ); /* A function-call expression */
my_indicator = IIf( MACD() > 0,
Close - MA(Close,9),
MA( Close, 9 ) - Close );
/* one statement in several lines */