Open order on last tick/end of bar (MQL4)

 

Hello forum, good day.

Is it possible to know when the bar ends and place an order right at the last tick? I know that the easy way would be to wait until new bar event and do it on first tick, but I need to check conditions right at the moment the bar is ending and place an order on the last tick of a bar. Could this be done?

Best regards and thank you,

codeMolecules 

 
codeMolecules:

Hello forum, good day.

Is it possible to know when the bar ends and place an order right at the last tick? I know that the easy way would be to wait until new bar event and do it on first tick, but I need to check conditions right at the moment the bar is ending and place an order on the last tick of a bar. Could this be done?

Best regards and thank you,

codeMolecules 

Impossible to know it is the last tick. Could use OnTimer to place order 1 second before bar closes but it wouldn't work in tester though.
 
bendex77:
Impossible to know it is the last tick. Could use OnTimer to place order 1 second before bar closes but it wouldn't work in tester though.

Hello bendex77, good day.

Okay, I´ll try to see what are my options. Thanks for your response.

Best regards,

codeMolecules 

Reason: