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

Exp TralPartionClose

Partial Close and Trail - assistant EA. Closes a part of a position (Closes part of the lot) during rollback.


Decription

This is an assistant EA fixing part of the profit at the rollback movement of the currency pair.

  • This EA manages your positions.
  • When a price rollback occurs in the opposite direction, the EA measures the price rollback values and closes a part of the profit (Closes part of the lot).
  • After that, the EA can activate trailing stop for the rest of the position.
  • At a repeated rollback, the EA closes a part of the profit again (Closes part of the lot).

You can test the Expert Advisor in the strategy tester and trade with our EAPADPRO toolbar in visual mode!

Demo version

Example

  1. buy 1 2.00 1.29667 0.00000 0.00000
  2. modify 1 2.00 1.29667 1.29667 0.00000
  3. сlose 1 0.40 1.30174 1.29667 0.00000 202.80 10202.80
  4. buy 3 1.60 1.29667 1.29667 0.00000
  5. close 3 0.40 1.30668 1.29667 0.00000 400.40 10603.20
  6. buy 4 1.20 1.29667 1.29667 0.00000
  7. close 4 0.40 1.30982 1.29667 0.00000 526.00 11129.20
  8. buy 5 0.80 1.29667 1.29667 0.00000
  9. s/l 5 0.80 1.29667 1.29667 0.00000 -2.88 11126.32
  • 1 - opened a Buy deal.
  • 2 - after passing StartPointToTral points, set breakeven (при MovingInWLUSE = true).
  • The price goes up, we trail the rollback start line up following the price.
  • 3 - after a rollback from our line of more than OtkatPoint points down, we fix profit, closing PercentLotToClose percent of our lot. In this case, the next level of the rollback start is equal to "our current rollback line" + StepPointToFixLevel points. That is, the price must again pass StepPointToFixLevel points up from the line, and only then the algorithm is active again.
  • 5 - again rollback, again fix profit of 20% of the initial volume. The algorithm is repeated.
  • 9 - trend reversal, the position is closed at the breakeven (+swap). Our profit is about 1,125 dollars.


Settings

  • StartPointToTrail - the number of points in profit to activate the partial closure function.
    For example, StartPointToTral = 200: as soon as the position reaches 200 points of profit, the EA fixes the first level at 200 points.
  • RollbackPoint - the number of points for the price to roll back in order to partially close the position.
    For example, StartPointToTral = 200 RollbackPoint = 100​​​​​​​​​​​​​​: as soon as the price rolls back 100 points from the fixed level (200), a part of the position will be closed.
  • StepPointToFixLevel - the number of points to fix the next level.
    For example, StartPointToTral = 200 RollbackPoint = 100 StepPointToFixLevel = 150​​​​​​​​​​​​​​: after a part of the position is closed, the next level is fixed at 350 points (200+150).
  • DisableLockClose - disable using the partial closure algorithm, if a lock of two positions in different directions with the same lot size has been detected on the account.
    For example: if you use the SafetyLock PRO EA and your positions has been locked in a "safe lock", this option (DisableLockClose = true) disabled partially closing this lock.
  • PercentLotToClose - percent of the initial volume to close a position.
    For example, a position is opened with 2.0 lot at PercentLotToClose = 20%: the EA calculates the lot for partial closure as 2*0.2(%) = 0.4 lot. At a rollback, 0.4 lot will be closed, and at each consequent closure, the lot for closing will be equal to 0.4.
  • FixLotToClose - fixed lot value for closing each step. 0 - considers the lot percentage PercentLotToClose.
  • CloseOnlyOnProfitZone - Apply partial closure only when the position is in profit.
  • NumbersOfClose - Number of partial closures.
    For example, NumbersOfClose = 3, PercentLotToClose = 20%, initial lot = 2.0: when calculating the lot for partial closure, the EA calculated 0.4 lots for closing at each step. The EA can apply closure with 0.4 lot only 3 times, the remaining 0.8 lot of the position will remain open.
  • MovingInWLUSETRAIL - move the position to breakeven at the first partial closure.
    • If the partial closure function is activated, and the first part of the position was closed, the EA moves the stop loss to the opening price.
  • FixTrailingStopLevel - fix the stop loss level when new levels appear.
    For example, FixTrailingStopLevel = 100: if the price breaks the fixing level of StepPointToFixLevel (Orange Violet), then the stop loss is placed at the Current level (Red Blue)+-FixTrailingStopLevel points.


Victor Epand
699
Victor Epand 2017.02.10 13:03 
 

This is a valuable and profitable utility for trailing partial take profits.

Version 18.830 2018.08.30
Partial Close and Trail Update EAPADPRO v20
Version 18.515 2018.05.23
Partial Close and Trail
- Updated EAPADPRO v2.0 info panel;
Version 17.208 2017.11.13
General improvements of EAPADPRO

- Added the DisableLockClose option - disable using the partial closure algorithm, if a LOCK of two positions in different directions with the same lot size has been detected on the account.
For example: if you use the SafetyLock EA and your positions has been locked in a "safe lock", this option (DisableLockClose = true) disabled partially closing this LOCK.
Version 17.121 2017.01.27
- Added parameter
NumbersOfClose - The number of position closures by trailing. 0 - unlimited
- Added parameter
FixLotToClose - Fixed lot value for closing each step. 0 - considers the lot percentage PercentLotToClose.
- Added parameter
FixTrailingStopLevel - Fix the stop loss level when new level appear, for example:
FixTrailingStopLevel = 100. if the price breaks the fixing level of StepPointToFixLevel(Orange Violet),
then the stop loss is placed at the Current level (Red Blue)+-FixTrailingStopLevel points

- Added lines to the chart:
Red Blue - Main lines of the defined levels
Yellow - Rollback level
Orange Violet - Next levels for fixing

If the position passes Red Blue, Yellow line appears for a rollback and Orange Violet line for fixing the next level


Fixed working with long tickets
Fixed errors with StepPointToFixLevel
Otkat was renamed to RollBack
- Added the EAPADPRO information panel
Details on the panel in our blog:
or https://www.mql5.com/ru/blogs/post/687140

The following data has been moved to the Strategy Info block:
"BUY Next Level" - Next fixing level for BUY
"SELL Next Level" - Next fixing level for SELL
"BUY Rollback" - Partial closure level for BUY
"SELL Rollback" - Partial closure level for SELL
"BUY LotToClose" - Partial closure lot for BUY
"SELL LotToClose" - Partial closure lot for SELL

Attention: The data is displayed for 1 BUY and 1 SELL position.
Version 15.126 2015.01.27
Re-compiled for the new build