how can I put a close order with a timer in python?

 

hi,

I have some orders that should be stopped when some time goes by ... how could I do this? what do I need?

the problem, is that the script, is in a loop, testing with ia all the pairs, so, not quite sure to how to close the orders by time ... any idea?

 

Your query seems more of a Python language programming problem than it is a MetaTrader API problem.

Maybe consulting Python sources of information or forums would be better suited to your question.

 
Javier Santiago Gaston De Iriarte Cabrera:

hi,

I have some orders that should be stopped when some time goes by ... how could I do this? what do I need?

the problem, is that the script, is in a loop, testing with ia all the pairs, so, not quite sure to how to close the orders by time ... any idea?

As Fernando said, it's not an mql question.

There are several ways to do it, for example see :

Event Loop
Event Loop
  • docs.python.org
Source code: Lib/asyncio/events.py, Lib/asyncio/base_events.py Preface The event loop is the core of every asyncio application. Event loops run asynchronous tasks and callbacks, perform network IO ...