AI Sniper is an intelligent, self-optimizing trading robot designed for both MT4 and MT5 terminals. It leverages a smart algorithm…
The xCustomEA Advisor on the PipFinite Trend PRO. Automatic EA
The X and The xCustomEA: Testing and Optimization
Main
Documentation
Settings
FAQ
Changelog
Reviews
Comments
Extra
About Partial Close and Trailing
Partial Close and Trailing is an EA assistant that closes a portion of a position (i.e., part of the lot) during a rollback.
The EA closes a profitable position partially when the price first moves in the direction of profits and then retraces.
When the price moves towards profit and then reverses, the advisor closes the profitable position with a partial lot.
- The EA monitors the position (deals).
- If the price moves in the direction of profits, the EA sets the first level of rollback price at a certain distance.
- If the price continues to move in the direction of profits, this level of profit continues to modify the rollback level.
- If the price retraces by a specified number of points (pips), the EA closes a portion of the lot (volume) from the position (deal).
- The EA sets the next price level at which the next portion of the position will be closed.
- The EA activates the TrailingStop function when a portion of the position is closed.
- The EA continues to operate until the entire position is closed.
You can test the Expert Advisor TralPartionClose in the Strategy Tester and trade with our EAPADPRO toolbar in visual mode!
Example
- buy 1 2.00 1.29667 0.00000 0.00000
- modify 1 2.00 1.29667 1.29667 0.00000
- close 1 0.40 1.30174 1.29667 0.00000 202.80 10202.80
- buy 3 1.60 1.29667 1.29667 0.00000
- close 3 0.40 1.30668 1.29667 0.00000 400.40 10603.20
- buy 4 1.20 1.29667 1.29667 0.00000
- close 4 0.40 1.30982 1.29667 0.00000 526.00 11129.20
- buy 5 0.80 1.29667 1.29667 0.00000
- s/l 5 0.80 1.29667 1.29667 0.00000 -2.88 11126.32
How does Partial Close and Trailing work?
What do people write about Partial Close and Trail?
You can Download free Partial Close and Trail
FULL for FREE!
This is FULL FREE version without limits!u003cbru003eYou can download and install our program for free!
Links
Useful links
Table of Contents (click to show)
Description
The EA closes a profitable position partially when the price first moves in the direction of profits and then retraces (rollback).
- The EA monitors the position (deals).
- If the price moves in the direction of profits, the EA sets the first level of rollback price at a certain distance.
- If the price continues to move in the direction of profits, this profit level continues to modify the rollback level.
- If the price retraces by a specified number of points (pips), the EA closes a portion of the position.
- The EA sets the next price level at which the next portion of the position will be closed.
- The EA activates the TrailingStop function when a portion of the position is closed.
- The TralPartionClose EA continues to operate until the entire position is closed.
The rollback in Forex is the price movement in the opposite direction of the current trend, often resulting from the currency pair being overbought or oversold.
How to make a profit during rollbacks?
We will discuss this in this article.
- This Expert Advisor accompanies your positions.
- When a price rollback occurs in the opposite direction, the advisor sets the rollback values and closes a portion of the profit.
- After this, the EA can activate the trailing stop for the remaining position.
- Upon a second rollback, the advisor again closes a portion of the profit.
You can test the Expert Advisor in the Strategy Tester and trade with our EAPADPRO toolbar in visual mode!
EAPadPRO – Information panel for our experts. Dashboard for Expert Advisors
Information panel for all our advisors and utilities for the MetaTrader terminal. Detailed instructions on the basics of managing and using the EAPADPRO panel in our trading Expert Advisors. Friendly, intuitive user interface for convenient and successful work with our utilities. Even in the strategy tester!
Work Tactics and Logic of Partial Close on Rollback
First, let’s understand the concept of rollback or trend correction.
1. Ascending Market Correction.
Occurs in a downtrend when the majority of market participants recognize that the price of the financial instrument is oversold and begin to take profits on previously open SELL orders.
2. Descending Market Correction.
Occurs during an uptrend when the majority of market participants recognize that the price of the financial instrument is overbought and begin to take profits on previously open BUY orders.
For example, consider the following chart:
As shown in this figure, the Main Trend is up, but there is an ascending rollback.
In this case, using a trailing stop with inaccurately calculated levels may cause your position to close before the actual trend ends.
The situation is undesirable because the main profit is not fully realized.
Profit not fully realized? Let us help.
Exiting early from a potential trend captures all the profits that could have been obtained by following the full direction.
Known tactics of experienced traders involve securing a portion of the profit during such rollbacks.
Suppose you have a BUY position with a lot size of 2.0. You anticipate that the price will rise by 1000 points (pips). One effective strategy is to set the Take-Profit at 1000 pips.
But what do you do if the uptrend does not reach 1000 pips and, say, reverses at 500 pips?
Without reaching your take-profit, the price may reverse and enter another downward trend. In such cases, using a Trailing Stop could result in triggering the stop-loss at 200-300 pips, which is not ideal.
What to do in this situation?
Secure profits or a portion of them during rollbacks.
Using the above example, close, for instance, 20% of the existing lot after a rollback of more than 50 pips.
Subsequently, when the price returns to the point, start a new rollback – if the next rollback exceeds 50 pips, close another 20% of the lot (0.4 lot).
In this case, you should start the new rollback not from the previous rollback point, but 50 pips above the last rollback point.
Thus, with rollbacks of 50 pips, you can lock in profits multiple times.
The remaining portion of the position will safely reach its take-profit level.
In this scenario, you may not achieve the desired 500 pips of net take-profit from 2 lots. However, your trade will be protected from premature closure by the trailing stop and from trend reversals.
I also recommend setting the current position to breakeven at the first rollback.
The Stop Loss is set to the opening position. Thus, when the price retraces, your position will close at 0.
In this tactic, an assistant was created.
Exp – TralPartionClose is an Expert Advisor assistant that closes a portion of the profit during rollbacks.
At what point does the trend line, or rather the beginning point of a rollback, last for the price?
When you experience a rollback of a specified number of points (pips) in the opposite direction, a portion of the profit is closed.

EA Example of Partial Close on Rollback
As seen in this chart, I initiated two positions for SELL and BUY to conduct the test.
Then, the events unfold exactly according to the given algorithm:
- 1 2013.03.07 00:00 buy 1 2.00 1.29667 0.00000 0.00000
- 3 2013.03.07 04:07 modify1 2.00 1.29667 1.29667 0.00000
- 4 2013.03.07 11:07 close 1 0.40 1.30174 1.29667 0.00000 202.80 10202.80
- 5 2013.03.07 11:07 buy 3 1.60 1.29667 1.29667 0.00000
- 6 2013.03.07 15:49 close 3 0.40 1.30668 1.29667 0.00000 400.40 10603.20
- 7 2013.03.07 15:49 buy 4 1.20 1.29667 1.29667 0.00000
- 8 2013.03.07 16:51 close 4 0.40 1.30982 1.29667 0.00000 526.00 11129.20
- 9 2013.03.07 16:51 buy 5 0.80 1.29667 1.29667 0.00000
- 10 2013.03.08 16:08 s/l 5 0.80 1.29667 1.29667 0.00000 -2.88 11126.32
Decoding the Expert Advisor:
- 1 – opened a BUY deal
- 2 – Upon reaching StartPointToTral points – set to breakeven (* MovingInWLUSE = true)
- The price rises; we trail the rollback starting point line upwards,
- 3 – When the price rolls back our line by more than RollbackPoint pips downward – secure the profit by closing PercentLotToClose percent of our lot.
- This sets the next rollback start level to = current rollback line + StepPointToFixLevel pips. The price should then rise above the StepPointToFixLevel pips. Only then does the algorithm engage again.
- 5 – Another rollback occurs, securing another 20% of the first lot. The algorithm repeats.
- 10 – Trend reversal; the position is closed with no loss (+ swap). Our profit was approximately $1,125.
When testing the EA, we obtained this profit from two positions moving in different directions:

Additional utilities
Additionally, I recommend studying our assistant Exp – Averager, which is activated when moving against the trend and averages the total Take-Profit for all positions.
Averager. Averaging trading positions. Opening deals against the trend and on the trend!
Averaging positions. Opening of additional positions on the trend and against the trend with the function of the general trailing stop of the profit! The adviser can open additional positions on the trend and against the trend! Includes average trailing stop for a series of positions! Increasing and decreasing the lot.
Duplicator – Duplication of deals/positions on the MetaTrader terminals
The Exp-Duplicator is an automatic Expert Advisor designed to duplicate trades and positions a preset number of times on your MetaTrader account. It seamlessly copies all positions—whether opened manually or by another EA—and allows you to increase the lot size (volume) of these positions.
CLP CloseIfProfitorLoss with Trailing. Control of the total profit or loss with profit trailing.
The Expert Advisor (EA) offers advanced features for managing and closing positions in MetaTrader, specifically upon reaching a predetermined level of total profit or loss. With the profit trailing function enabled, the EA dynamically adjusts stop levels to secure profits as they grow.
SafetyLOCK PRO Protect your positions by locking using the opening of opposite pending orders. Lock Hedge
SAFETYLOCK: Secure Your Trades Against Sharp Market Reversals Trading on financial markets involves high risks, particularly during sharp market reversals. SAFETYLOCK is a unique tool that helps traders minimize losses by automatically placing a counter order for an existing position. You can now trade with confidence,
External Variables and Settings
| Name | Description |
|---|---|
| General settings | |
| StartPointToTral | StartPointToTrail is the number of points (pips) in profit to activate the partial closure function. For example, StartPointToTral = 200: Once the position reaches 200 points (pips) of profit, the EA sets the first level at 200 points. |
| RollbackPoint | RollbackPoint is the number of points (pips) the price must retrace to trigger a partial position (deal) closure. For example, StartPointToTral = 200 and RollbackPoint = 100: Once the price retraces 100 points (pips) from the fixed level (200), a portion of the position (deal) will be closed. |
| StepPointToFixLevel | StepPointToFixLevel is the number of points (pips) for setting the next level. For example, StartPointToTral = 200 RollbackPoint = 100 StepPointToFixLevel = 150 After closing part of the position, the next fixation level is 350 points (pips) (200 + 150). |
| DisableLockClose | DisableLockClose is the percentage of the initial lot to close the position. For example: Open position with lot size 2.0 PercentLotToClose = 20% The EA calculates the lot size for partial closing = 2 * 0.2 = 0.4 lots. When a rollback occurs, 0.4 lots will be closed. At each closure, the lot size to close will be equal to 0.4. |
| PercentLotToClose | PercentLotToClose is the percentage of the initial volume to close a position. For example: A position (deal) is opened with 2.0 lots (Volume). If PercentLotToClose = 20%, then the EA calculates the lot size (Volume) for partial closure as 2 * 0.2 = 0.4 lot. Upon a rollback, 0.4 lot will be closed, and at each closure, the lot size to close will remain at 0.4. |
| FixLotToClose | FixLotToClose is a fixed lot (volume) value for closing each step. If set to 0, the percentage from the lot PercentLotToClose is used. |
| CloseOnlyOnProfitZone | With partial closure, the EA can close only when the position (deal) is in profit. |
| NumbersOfClose | NumbersOfClose is the number of partial closures. For example, NumbersOfClose = 3 PercentLotToClose = 20% Starting Lot = 2.0 When calculating the lot size (Volume) for partial closing, the EA calculates 0.4 lots for each closure step. The EA can only perform 3 partial closures of 0.4 lots each. The remaining 0.8 from the position (deal) will remain in the market. |
| MovingInWLUSETRAL | MovingInWLUSETRAL enables the Breakeven function. Sets the Stop Loss of the position to the breakeven level upon the first partial closure. If the partial closure function is activated and the first portion of the position is closed, the Expert Advisor (EA) will set the stop loss at the opening price. If the price continues to move to the opening price, the stop loss will be activated, and the position will close with a profit of 0. In this case, part of the position (deal) will be closed in advance. |
| FixTrailingStopLevel | FixTrailingStopLevel modifies the stop loss to the previous level if a new level has been created. FixTrailingStopLevel sets the stop-loss level when new levels occur. For example: FixTrailingStopLevel = 100. If the price breaks the fixation level StepPointToFixLevel (Orange Violet), then the stop-loss of the position (deal) is set to the Current level (Red Blue) + FixTrailingStopLevel pips. |
| OrderToTrailPartionClose | Specifies the types of orders (Buy, Sell, ALL) for monitoring by the EA. |
| MagicToTrailPartionClose | Specifies the magic numbers for monitoring by the EA. |
FAQ about Partial Close and Trail
Our General FAQ
FAQ Answers to the most popular questions
Thank you for your feedback.
You can download my EA in the Files section!
If you wish to thank the author for this project – you can click the Thank You button.
What is the Exp – TralPartionClose Expert Advisor?
The Exp – TralPartionClose is an Expert Advisor designed to manage and optimize your Forex trading positions by implementing partial closes during rollbacks, enhancing profit protection and maximizing gains.
How does the partial closing function work?
The partial closing function automatically closes a portion of your position when the price experiences a rollback, securing profits while allowing the remaining position to potentially gain further.
What is a rollback in Forex?
A rollback refers to a price movement opposite to the current trend, often caused by market conditions like overbought or oversold levels, leading to temporary reversals.
How does the EA handle price movements in the direction of profits?
When the price moves in the direction of profits, the EA adjusts the rollback price level to lock in gains, continuously modifying this level as the trend strengthens.
What happens when the price rolls back?
Upon a rollback of a specified number of points, the EA closes a portion of the position to secure profits and sets the next rollback level for potential future closures.
How do I set the StartPointToTral parameter?
The StartPointToTral defines the number of points (pips) in profit required to activate the partial closure function. For example, setting it to 200 pips means the EA will begin managing partial closes once your position gains 200 pips.
What is the purpose of the TrailingStop function in the EA?
The TrailingStop function automatically adjusts your stop-loss level as the market moves in your favor, helping to protect profits by locking in gains as the trend continues.
How does the EA manage multiple rollback levels?
The EA sets successive rollback levels by adding the StepPointToFixLevel after each partial close, allowing it to lock in profits multiple times as the price fluctuates.
Can the EA handle both BUY and SELL positions?
Yes, the Exp – TralPartionClose EA is designed to manage both BUY and SELL positions, monitoring each for rollbacks and applying partial closures accordingly.
How does the EA ensure the position is protected from premature closure?
By implementing trailing stops and setting multiple rollback levels, the EA prevents premature closure, ensuring that profits are secured while allowing the position to remain open for further gains.
What are the external variables and settings available in the EA?
The EA includes settings like StartPointToTral, RollbackPoint, StepPointToFixLevel, PercentLotToClose, and others, allowing traders to customize how the EA manages partial closes and trailing stops.
How do I calculate the PercentLotToClose?
PercentLotToClose determines the percentage of the initial lot size to close during a rollback. For example, setting it to 20% on a 2.0 lot position means 0.4 lots will be closed when a rollback occurs.
What is the FixTrailingStopLevel parameter?
FixTrailingStopLevel specifies the number of points (pips) to adjust the stop-loss when a new rollback level is established, ensuring the stop-loss follows the price effectively to protect profits.
How does the EA handle breakeven levels?
Upon the first partial close, the EA sets the stop-loss to the breakeven point, ensuring that if the price reverses further, the position will close without a loss.
Can I test the EA using the Strategy Tester?
Yes, you can test the Exp – TralPartionClose EA using the built-in Strategy Tester in your trading platform to simulate its performance under various market conditions.
How does the EA monitor positions?
The EA continuously monitors all open positions, tracking price movements to identify when a rollback occurs and determining the appropriate actions for partial closures and trailing stops.
What is the difference between StartPointToTral and RollbackPoint?
StartPointToTral is the profit level at which the EA begins managing partial closes, while RollbackPoint defines the number of points the price must move against the trend to trigger a partial closure.
How does the EA determine when to close a part of the position?
The EA closes a portion of the position when the price retraces by the specified RollbackPoint from the fixed profit level, ensuring profits are secured incrementally.
What happens when the NumbersOfClose limit is reached?
Once the NumbersOfClose limit is reached, the EA stops performing partial closures, leaving the remaining position to continue towards the take-profit or until other exit conditions are met.
How does the EA fix profits on multiple rollbacks?
On each rollback, the EA closes a predefined percentage of the position, locking in profits multiple times and adjusting the next rollback level to ensure continuous profit protection.
Is it possible to adjust the StepPointToFixLevel?
Yes, you can customize the StepPointToFixLevel to define how much the rollback level increases after each partial closure, allowing you to tailor the EA’s behavior to your trading strategy.
What is the function of MovingInWLUSETRAL?
MovingInWLUSETRAL enables the EA to activate the breakeven function after the first partial close, ensuring that the stop-loss is moved to the opening price to eliminate potential losses.
How does the EA interact with the Exp – Averager assistant?
The EA can work alongside the Exp – Averager assistant, which averages the total take-profit for all positions, enhancing overall trade management and profit optimization.
What is the significance of magic numbers in the EA settings?
Magic numbers allow the EA to identify and manage specific orders, ensuring that it only controls trades it has opened and avoids interference with other strategies or manual trades.
How does the EA ensure stop-loss levels are correctly managed?
The EA dynamically adjusts the stop-loss to the breakeven point after the first partial close and modifies it further with each new rollback level, ensuring that losses are minimized and profits are protected.
Changelog about Partial Close and Trail
Reviews about Partial Close and Trail
Thanks for feedback!
Bi Zhou
⭐⭐⭐⭐⭐
this is very useful tool, I hope MT5 can use tooReply from ExpForex:
Thank You .coming soon
alexey34vlg
⭐⭐⭐⭐⭐
alexey34vlg 2023.08.11 12:52
отличный советник, под мои цели идеально мы можете сделать такой же советник для мт5 ? я бы купил
Ng Yu Keung
⭐⭐⭐⭐⭐
Ng Yu Keung
I used the tool on breakout EA, I would secure my profit and reduce the loss when price pullback after breakout.

ROBERT URBANSKI
⭐⭐⭐⭐⭐
ROBERT URBANSKI
Very helpful, it perfectly supports own strategies. With my system, drastically reduces DD. I looking for MT5 but I don't see. 🙁
rizennam
rizennam 2021.10.18 06:45
Ea closes all positions, not partially?2021.10.18 07:54Ea CLOSE partially. Perhaps you have a minimum lot? The minimum lot cannot be partially closed!
Ma Jophine Bautista
⭐⭐⭐⭐⭐
Ma Jophine Bautista
This really helps with not giving up too much of your profit when the price action is not going your way. I love how it only partially closes when things aren't going as planned. Other partial close EAs pare down positions at fixed levels automatically, and that causes you to lose out on opportunities for profit when there is a really strong move going on in your favor.
eriva
⭐⭐⭐⭐⭐
eriva
I use many products from Vladislav, the utilities are exceptional even if they require a bit of patience to find the right settings based on their use. Each reviewed utility is used in my real account. Vladislav is a kind and helpful person for any help required. Great Vladislav !!
Victor Epand
⭐⭐⭐⭐⭐
Victor Epand
This is a valuable and profitable utility for trailing partial take profits.
Comments about Partial Close and Trail
Do you have a question?
Extra
Navigation by tabs
Related Posts
EAPADPRO LIBRARY – Adding our panel to your EA
EAPADPRO LIBRARY – Enhancing Your Expert Advisor (EA) with Our Information Panel EAPADPRO LIBRARY offers a robust solution for traders looking…
Swing strategy (Pendulum). Automatic opening of 2 opposite pending orders,
The Pendulum or Swing strategy involves the sequential opening of pending orders with an increased lot size. The core principle…
SafetyLOCK PRO Protect your positions by locking using the opening
SAFETYLOCK: Secure Your Trades Against Sharp Market Reversals Trading on financial markets involves high risks, particularly during sharp market reversals. SAFETYLOCK…
Trade Report of TickSniper and the best advisors from Expforex
Description We have summed the summary and detailed trading results of our experts TickSniper, Good Santa, Tick Hamster, The X, on our real trading accounts. Trade…
The X – Universal Expert Advisor (EA) for Forex Using
Universal Expert Advisor (EA) for MetaTrader with Extensive Functionality The Expert Advisor The X is a versatile trading tool for MetaTrader,…
InfoPad, Online Information Panel for MetaTrader
InfoPad is a highly useful information panel designed to provide crucial information on the specific currency pair selected in the…
TickSniper Automatic Expert Advisor for Metatrader. Tick scalper
Exp-TickSniper is a fast tick scalper that automatically selects parameters for each currency pair separately. The EA has been developed based on…
Averager. Averaging trading positions. Opening deals against the trend and
Averaging positions. Opening of additional positions on the trend and against the trend with the function of the general trailing…
Close Minus by Plus, Closing unprofitable positions by searching and
Closing unprofitable positions by identifying and closing profitable ones. The Expert Advisor (EA) is designed to close unprofitable positions by identifying…
EAPadPRO – Information panel for our experts. Dashboard for Expert
Information panel for all our advisors and utilities for the MetaTrader terminal. Detailed instructions on the basics of managing and using…
Duplicator – Duplication of deals/positions on the MetaTrader terminals
The Exp-Duplicator is an automatic Expert Advisor designed to duplicate trades and positions a preset number of times on your…
Templates MQL Open Source. Template for Creating Expert Advisor
Brief Creating Expert Advisors (EAs) to test your strategy using any indicator can indeed be simplified using templates and open-source resources….
CLP CloseIfProfitorLoss with Trailing. Control of the total profit or
The Expert Advisor (EA) offers advanced features for managing and closing positions in MetaTrader, specifically upon reaching a predetermined level…
Tester Pad is a Forex trading simulator for strategy tester.
One-click trading on the Strategy Tester chart. The utility allows you to manually test your strategies in the strategy tester….
この記事は次の言語でもご覧いただけます: English Portuguese Español Deutsch Français Русский Українська Indonesian Italiano العربية Chinese 日本語 한국어 Türkçe ไทย Tiếng Việt













Leave a Reply