Script ExitMartingale
The description of action:
Script watching the order. It realizes an exit from a unprofitable position by method "Martingale". If the set a pending order the script waits for its execution, and only is open then will trade. If the order was closed or deleted, then the script automatically finished the work and close all orders by current price. It can be attached to any chart.
Assignment:
The script allows to automate trade. It is useful to those who use method "Martingale" for exit from a unprofitable position. Open a position or pending order, start a script and you should not watch a position any more.
Parameters:
Ticket = the unique identifier of the order. It can be found in a column "Order" of the tab "Trade" of the terminal. If the set a value "-1", then script will find ticket by last arrow on chart.
Interval = the distance between orders (in points); the value should be more than 0.
TargetProfit = the target profit (in currency of account) when to closs all orders.
MaxNumberOrders = maximal amount orders of script; the value should be more than 0.
MaxLotSize = maximal size of lot that allow to open for script; the value should be more than 0.
Slippage = maximum price slippage at open orders (in points); the value should be more or equal than 0.
PlaceOrders = amount pending orders that placed simultaneous; the value should be more than 0.
MagicNumber = "Magic" number for orders of script. Value should be unique in all terminal.
ShowComment = the option "show information at chart comment"; true - show comment at chart, false - not show comment at chart.
ColorBuy = color to which long positions are shown on the chart.
ColorSell = color to which short positions are shown on the chart.
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.
The status: Free-of-charge, it is possible to download the full version.
Platform: MetaTrader 4.
See also these scripts:
- the system of two pending orders: "one cancels other".
- at the specified time, closes open position or deletes pending order.
- 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 ?
|