The Wikipedia entry on the subject is a bit of a mess, though it does give a simple [tail] recursive formula for computing the EMA. What exactly is your difficulty?