Strategies are executed when a a bar closes and they evaluate conditions on the closed bar (which is the CURRENT bar till the next one closes). If conditions are met and a position is immediately opened you will see the arrow under the bar that is being opened.
If you are using a 5-minute bar you may take advantage of the Multi Time Frame feature that allows strategies to use multiple timeframes, to use the 5-minute TF itself and a lower TF, such as 1 minute or 1 second, to be able to access the 5-minute bar while it’s being formed, every 1 minute or 1 second.
The drawback is that your data history will be reduced, 200K 5-minute bars is quite a longer period than 200K 1-second bars!
Searching this forum for the word MTF will return you many links to articles, examples and code snippets about it.
1 user thanked author for this post.