Set Limit Price to SMA

Can anyone assist with explaining how to make a limit price out of a moving average?

I can't seem to be able to use

for security in context.STOCKS_TO_BUY.index
WeightOrder=float(1.00/context.MaxOrders)
CurrentPrice= float(data.current([security], 'price'))