Open order on last tick/end of bar?

 

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 place the order right at the last tick/end of a bar. Could this be done?

Best regards and thank you,

codeMolecules 

 
There is no way of knowing whether a tick will be the last tick of the bar
 
GumRai:
There is no way of knowing whether a tick will be the last tick of the bar
But you would know when the current bar will reach its time before new bar developed.
 
deysmacro:
But you would know when the current bar will reach its time before new bar developed.

Hello deysmacro, thanks for your response. 

So this could be almost the same as knowing when the last tick of a bar is and then place an order just before new bar, correct? How could this be done?

Your help will be much appreciated. 


Best regards and thank you,

codeMolecules 

 
codeMolecules:

So this could be almost the same as knowing when the last tick of a bar is and then place an order just before new bar, correct?

Sorry. Not the same. Every bar developed in a preset timing. So, get the timing and open new order in the last few seconds of the current bar.
 
deysmacro: . So, get the timing and open new order in the last few seconds of the current bar.
And what if there is no tick in the last few seconds of the bar. During Asian session there can be many minutes between ticks
 

It is not possible to check whether a tick is the last in a bar or not, but if you are using long timeframes like H1 or more, you could check for the last M1 bar for each H1 bar. I know this is not the last tick, but could be a workaround.

 
WHRoeder:
deysmacro: . So, get the timing and open new order in the last few seconds of the current bar.
And what if there is no tick in the last few seconds of the bar. During Asian session there can be many minutes between ticks

I know the workaround. No need to depend on ticks.
Reason: