about writting cmp

Please can anybody help me regarding afl .
i want to type an condition which says current market price (cmp) is greater than previous days close and vise versa.

prev_dcl = TimeFrameGetPrice("C", inDaily, -1);// previous day's close
cmp = C;

up_cond = cmp > prev_dcl;// array condition 
dn_cond = NOT up_cond;// array condition 

last_upcond = LastValue(up_cond);// condition at last bar
last_dncond = LastValue(dn_cond);// condition at last bar

printf( "CMP: %g, previous day's close: %g\n", LastValue(C), LastValue(prev_dcl));
printf( "CMP > previous day's close? %s\n", StrExtract("NO,YES", last_upcond));
printf( "CMP < previous day's close? %s", StrExtract("NO,YES", last_dncond));

9

4 Likes