If you’re missing a few candles, you can still get your EMA right, just don’t run the calculation on raw gaps. Fill them first.
If the candles disappeared because of a data glitch, just smooth it out between the last and next prices — either by averaging or just carrying the last one forward if it’s a short gap.
But if those candles are gone because the market was actually closed, then leave them out completely and pick up from where trading starts again.
So yeah, quick rule:
missing from bad data, fill them.
Missing from a closed market, skip them. That keeps your EMA clean and realistic.