• Overview
• Reviews (1)
• What's new

# U Trail and Close Part

U Trail and Close Part™ is a fully automated Expert Advisor for managing trades. The following functions are used in the Expert Advisor:

### Calculation of risk in a position

• StopLoss - used for calculation of risk in a trade.
• LotFixedUse - only a fixed lot is used.
• LotFixed - fixed lot size.
• RiskMM - percentage of risk in the position. The function is active if the fixed lot is disabled.

### Partial profit taking

• PartialOn - enable partial closure (true) by take profit.
• Levels_Part - closure levels (points), each level is set as the number of points from the trade opening price.
• Percents_Part - closure percentage (%), calculated as a percentage of the position volume for each part of the partial closure.

Consider the function of partial position closure on the example of a BUY order (Lot=1.0):

• Levels_Part = "05/10/15/20";
• Percents_Part = "20/40/30/10".

At each Levels_Part level, a part of position specified in Percents_Part is closed:

1. The price passed 05 points up - 20% of position volume was closed (Lot=0.20).
2. The price passed 10 points up - 40% of position volume was closed (Lot=0.40).
3. The price passed 15 points up - 30% of position volume was closed (Lot=0.30).
4. The price passed 20 points up - 10% of position volume was closed (Lot=0.10).

### Break Even Point

• UseBreakeven - enable transferring positions to breakeven (true).
• BreakevenStep - value of profit to move the Stop Loss to breakeven (points).
• BreakevenPoint - the number of breakeven points from the position opening price (points).

### Simple trailing

• UseTrailingSimple - enable simple trailing (true).
• TrailingSimpleStop - simple trailing start (points).
• TrailingSimpleStep - simple trailing step (points).

### Virtual trailing

• UseTrailingVirtual - allow virtual trailing.
• Levels_Virtual - position closure levels (points).
• Percents_Virtual - order closure percentage (%).
• TrailingVirtualStep - the minimum trailing step (points).
• UseDelayVirtual - allow the delay of virtual trailing.
• DistDelayVirtual - delay for the virtual trailing (points).

Virtual trailing - each movement of the levels, responsible for a certain part of the position, does not modify the stop loss value of the position itself (function for managing the first BUY and the first SELL orders simultaneously).

Consider the process of virtual order management with partial closure on the example of a BUY order.

• Levels_Virtual = "15/25/45";
• Percents_Virtual = "40/30/30".

When opening the position, the levels are plotted below the order's Open price at the distances set in Levels_Virtual. At each level, a part of position specified in Percents_Virtual is closed.

1. An order is opened.
2. The levels arrange below the order Open price at the distance: level (1) - 15 points, (2) - 25 points, (3) - 45 points.
3. The price moves up and all levels follow the price. The price reverses and starts moving down. The levels remain in place.
4. The price crosses the first level. 40% of the position is closed (1).
5. If the price moves further down and breaks the level (2), 30% of the position is closed.
6. The price moves up again and the remaining level follows it. If the price reverses, starts moving down and crosses the third level (3) - 30% of the position is closed.
7. Thus, all 100% of the position volume are closed.

### Trailing based on the ZigZag indicator

• UseTrailingZigZag - trailing of stop loss for the structure (ZigZag).
• xExtDepthL - period of the ZigZag of the structure.
• xExtDeviationL - the number of points between extremes (in %).
• xExtBackstepL - the minimum number of candles between all extremes.

### General settings

• Magic - magic number of positions.
• Slippage - slippage.
• Language (English/Russian) - language to display the messages.
• Comment_EA - display information on the screen (true).
• UseSound - enable sounds.
• clModifyBuy - color of modification of Buy positions.
• clModifySell - color of modification of Sell positions.
642
2017.12.29 14:32

трэйлинг по уровням работает.

возможно модифицировать на уже открытых сделках.

больше мне не чего не требуется.

Спасибо Сергей за попытку помочь. разобрался.

Version 1.31 2018.12.02
1.Изменен внешний вид информационной панели.
2.Информационная панель выводится на график при помощи кнопки, нет необходимости изменять внешние настройки.
3.Добавлен КАЛЬКУЛЯТОР - расчёт риска на позицию.
4.Вызов калькулятора - с помощью кнопки.
5.Введён параметр : UseDigitalConv - вкл./откл. автопересчёт между 4/5/6 значными брокерами.