Forum

Close at specified Time

Hi all, I need help with a code. I need to trigger at every end of bar (currently testing on 15 bars) a code that closes my trades. So far my code works, but only sometimes. Can´t figure out why. Can anybody help please? Thank you void OnTick() { if (OrdersTotal() > 0) { datetime BarCloseTime =