Not sure how to do this.
Ideally I would not use such a discontinued EMA, the following reason for it.
On one minute chart , the EMA line will start after the 21st bar , ie.around 9:35 am.
On a 5 minute chart , the EMA line will start after the 21st bar , ie.around 11:00 am.
An expert help is needed for this.