Almost. If you use the first method, it would be:

vars ac = series(ao[0] - SMA(ao,5));

If ao is already a series, ao[0] is its current value.