Script TrailingStopPeak
The description of action:
Script watching the order. Move a level stoploss after minimal (for a long position) or maximal (for a short position) price value of a bar. If the set a pending order the script waits for its execution, and only is open then will watch it. If the order was closed or deleted, the script automatically finished the work. Can be attached to the chart of any currency pair, but thus the time period of the chart is used.
Assignment:
The script allows to automate trade. It is useful to those who uses the maximal or minimal price value of a bar as a level stoploss. Open a position or pending order, start a script and you should not watch a position 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.
offset_from_the_peak = the offset (in points) a new level stoploss from the maximal(minimal) price value of a bar. Positive value - aside the profit, negative value - aside the loss.
number_a_bar = the amount of last closed a bar among which the maximal(minimal) price value is searched; 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.
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:
![TrailingStopMA](images/tsm1.gif)
- moves a level stoploss after value specified MovingAverage.
![MoveToBE](images/mtb1.gif)
- when it will be achieved specified profit, will move a level stoploss in open price.
![LimiteTimeOrder](images/lt1.gif)
- 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 ?
|