EMA = Closing price x multiplier + EMA (previous day) x (1-multiplier)
So, the multiplier can be a constant or a simple calc, it's just
[2 ÷ (number of observations + 1)]
Then at the required frequency .....
EMA = price x multiplier + EMAprev x (1-multiplier)
EMAprev = EMA
..and repeat
The calc only needs to remember the prev EMA not a whole history. The shorter the number of observations, the larger the multiplier, and that gives more weight to the current price (the
price x multiplier part) than the previous EMA (the
EMAprev x (1-multiplier) part). Long observations, smaller muliplier, opposite effect.
You'll need to translate that into Guardianese. That part is beyond my pay grade

Hope it helps.