The exponential moving average gives more weight to the latest prices and includes all of the price data in the life of the instrument. It is defined by taking:

EMA(i) = f * price(i) + (1-f)*EMA(i-1)

For the first period we take the simple average as above.