Help with using MA as a trailing stop

Forex Trader
114547
Forex Trader  

Hi,

I am a newbie and trying to use a 21 period SMMA as my trailing stop. When I use the following:

MA = iMA(NULL,0,21,0,MODE_SMMA,PRICE_CLOSE,0);

I do not get the current MA value but it seems some value approx 5 bars back?

Thanks