All code is read at end of each bar and the trade opened at the beginning of the next bar (few milliseconds after code is read).
In order to achieve what you want, you would need to run your ‘EMA Crossing Strategy’ on, for example, 5 min TF and then run the Conditions to execute a Trade on, for example, 5 Sec TF.
So the ‘trade execute code’ would be checking every 5 secs for a cross in EMA on the 5 min TF (don’t use ‘updateonclose’ on 5 min TF … you will understand after you have read up on MTF).
Here’s a video which may help you, but there is loads more on this website to help understanding of what MTF is all about.
https://www.prorealtime.com/en/videos_tutorial/136_create_multi_timeframe_alerts
1 user thanked author for this post.