Script LimiteTimeOrder
The description of action:
Script watching the order. It limits the maximal duration of an open position on time. If the position is open longer the specified restriction the script will close it at the current price and finished the work. If the set a pending order the script waits for its execution, and only is open then watches duration of an open position. If the order was closed or deleted before the expiration of the specified restriction on time, the script automatically finished the work. Can be attached to any chart.
Assignment:
The script allows to automate trade. It is useful to those who limits duration of an open position on time. Open a position or pending order, start a script and you should not watch time any more. Simultaneous use together with other scripts watching the order is supposed.
Parameters:
ticket = the unique identifier of the order. It can be found in a column "Order" of the tab "Trade" of the terminal.
duration_in_minutes = the maximal duration of an open position in minutes; value should be more than 0.
delay = frequency of a check up status of orders. It is set in milliseconds, for example value 5000 means periodicity of 5 seconds. It is necessary to remember, that too often periodicity can brake the terminal. For example, if restriction is specified to several hours for decrease of loading this parameter can appropriate value 60000 (time one minute).
The status: Free-of-charge, it is possible to download the full version.
Platform: MetaTrader 4.
![To download the full version](images/edl1.gif)
See also these scripts:
![LimiteTimeALLOrder](images/lta1.gif)
- limit duration of all open positions.
![CloseAtTimeOrder](images/cto1.gif)
- at the specified time, closes open position or deletes pending order.
![OpenAtTime](images/ot1.gif)
- open order at the specified time.
Frequently asked questions:
How I can run a script ?
How I can determine that the script works ?
Why the script does not trade ?
|