Hello.
I need to close pending orders after x seconds, suppose 10 seconds, but I need to be exactly 10 seconds, not 9, not 11, not anything else...
I wrote these blocks
If a pending order exist, it checks if variable buy_pending_seconds is equal to the given value, if so it sets the variable to 0 and close pending order, else it increments variable buy_pending_seconds by one, and starts again at the next second.
It seemed to work but today I checked it in a very volatile enviroment (EURGBP) and it looked like it is not precise at all.
I put a comment to see if the variable was really incremented once per second, and it wasn't so, it was incremented quite randomly.
I also discovered that there was a lot of pending orders that were not deleted at all... as the counter of the time was stucked.
Can you please suggest any affordable method to do such a thing?
Thanks