Script MoveToBE
The description of action:
This script is watching for the orders. When the order reach specified profit then script move the level stop-loss to opening price of order or when the order reach specified loss then script move the level take-profit to opening price of order. Or the script can move levels at specified minute from opening time of order. You can set maximum 5 events for move stop-loss and maximum 5 events for move take-profit. You can attach script to any chart. Also is allowed version as EA.
Assignment:
The script allows to automate trade. It is useful to those who moves a level stoploss to the opening price after reached the certain profit. Open a position or pending order, start the script and you should not watch for position any more. Possible use script simultaneously with other scripts that watching orders.
Parameters:
MoveSLtoBE_X_Profit = (positive amount pips) profit when move level stop-loss to opening price. Value "0" - this event is not used.
MoveSLtoBE_X_Minutes = (positive amount minutes) minute from opening time of order when move level stop-loss to opening price. Value "0" - this event is not used.
MoveSLtoBE_X_Offset = (amount pips) offset of a new level stop-loss from the opening price of order. Positive value - offset from opening price to profit, negative value - offset from opening price to loss.
MoveTPtoBE_X_Profit = (positive amount pips) loss when move level take-profit to opening price. Value "0" - this event is not used
MoveTPtoBE_X_Minutes = (positive amount minutes) minute from opening time of order when move level take-profit to opening price. Value "0" - this event is not used.
MoveTPtoBE_X_Offset = (amount pips) of a new level take-profit from the opening price of order. Positive value - offset from opening price to profit, negative value - offset from opening price to loss.
By other words, the parameter MoveYYtoBE_X_Offset difine where place a new level. Example for Buy-position:
1) if opening price = 1.3000, MoveSLtoBE_X_Profit = 20 and MoveSLtoBE_X_Offset = 0 then at Bid = 1.3020 the script move level stop-loss to 1.3000
2) if opening price = 1.3000, MoveSLtoBE_X_Profit = 20 and MoveSLtoBE_X_Offset = 10 then at Bid = 1.3020 the script move level stop-loss to 1.3010
3) if opening price = 1.3000, MoveSLtoBE_X_Profit = 20 and MoveSLtoBE_X_Offset = -10 then at Bid = 1.3020 the script move level stop-loss to 1.2990
Ticket = ticket of order. Value "-1" - script watch for all orders.
MagicNumber = magic number of orders. Value "-1" - all magic numbers. Value "0" - orders that was opened by manual. This parameter is used only if parameter Ticket = -1.
AllSymbols = option "manage orders at all currency pairs"; true - manage orders at all currency pairs, false - manage orders, that have same currency pair as chart where script is attached. This parameter is used only if parameter Ticket = -1.
Slippage = slippage (amount pips).
ArrowColorBuy = color for arrow on chart at closing Buy-order.
ArrowColorSell = color for arrow on chart at closing Sell-order.
PlaySoundAtModify = enable/disable play sound-file at modify order.
PlaySoundAtModify_FileName = the name of sound-file that will played at modify order. This parameter is used only if parameter PlaySoundAtModify = true.
Delay = frequency of a check up price. 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:
- limit duration of an open position.
- moves a level stoploss after peaks price a bar.
Frequently asked questions:
How I can run a script ?
How I can determine that the script works ?
Why the script does not trade ?
|