I am familiar with building moving averages (whether SMA or EMA) from candle/OHLC data or indeed from a ticker which reports the price at a fixed interval.
But I would like to extend this to a raw trades feed I have access to. Now clearly trades can come at irregular intervals and depending on the resolution of the feed, likely I may have multiple trades with the same time.
Of course one approach is to aggregate trades into fixed time intervals - basically building my own candles (or 'buckets'). But then some intervals might have zero trades so this approach has issues.
Is there a way to extend SMA/EMA calculations to arbitrary trade times, given a trade time resolution of say 1 second?