Script HiddenStopLoss
The description of actions:
The script watch a hidden stop-loss and before closing order it wait for confirmation in during specified time. If the price for this time again will depart from the stoploss-price then the order will not be closed. If the order was closed then the script automatically to finish a work. Should be attached to the chart of currency pair at that will be watch stop-loss level.
Assignment:
The script allows to automate trade. It is useful to those, who wait a comfirmation for level stop-loss. Start a script, set parameters of the stop-loss and you should not watch price any more.
Parameters:
CloseAtSecondHitSL = true - if stop-loss is hit for a second time then close order immediately without delay, false - always wait delay before close order.
StopLoss_Buy = stoploss-price for Buy-orders. Value "0" - don't watch for Buy-orrders.
StopLoss_Sell = stoploss-price for Sell-orders. Value "0" - don't watch for Sell-orrders.
StopLoss_DelaySeconds = delay (amount seconds) before close order. If you set negative value then it is an amount percents from timeframe of chart. Value "0" - script to close order immediately without delay.
Ticket = ticket of order. Value "-1" - script watch for all orders of the same currency pair.
MagicNumber = magic number of orders. Value "-1" - all magic numbers. This parameter is used only if parameter Ticket = -1.
Slippage = slippage (in pips).
ArrowColor = color for arrow on chart at close price of order.
PlaySoundAtStartTimer = enable/disable play sound file at start timer.
PlaySoundAtStartTimer_FileName = the name of sound file that will played at start timer. This parameter is used only if parameter PlaySoundAtStartTimer = true.
PlaySoundAtClose = enable/disable play sound file at close order.
PlaySoundAtClose_FileName = the name of sound file that will played at close order. This parameter is used only if parameter PlaySoundAtClose = true.
ShowLineAtStopLoss = enable/disable drawing horizontal line at price of stop-loss. Then you can modify price of stop-loss if move line by mouse.
ShowLineAtStopLoss_Color = color for horizontal line that show a price of stop-loss. This parameter is used only if parameter ShowLineAtStopLoss = 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:
- automatically to set levels stop loss and take profit with the specified distance for orders that are open without levels.
- pending order that is not visible for broker.
- limit duration of an open position.
Frequently asked questions:
How I can run a script ?
How I can determine that the script works ?
Why the script does not trade ?
|