CLP CloseIfProfitorLoss with Trailing. Control of the total profit or loss with profit trailing.

SafetyLOCK PRO Protect your positions by locking using the opening of opposite pending orders. Lock Hedge
EAPADPRO LIBRARY – Adding our panel to your EA
SafetyLOCK PRO Protect your positions by locking using the opening of opposite pending orders. Lock Hedge
EAPADPRO LIBRARY – Adding our panel to your EA

CLP CloseIfProfitorLoss with Trailing. Control of the total profit or loss with profit trailing. Profit or Loss Pad Video Thumbnail

  • Main
  • Documentation
  • Settings
  • FAQ
  • Changelog
  • Reviews
  • Comments
  • Extra

About CLP CloseIfProfitorLoss

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.

Main Features:

  • Close All Positions at Total Profit or Loss
    Automatically close all open positions when a specific level of total profit or loss is reached, protecting your capital and locking in results.
  • Trailing Profit
    Dynamically adjusts profit levels to secure growing profits as the market moves in your favor. The EA includes a trailing profit feature that automatically adjusts the Profit level as your total profit increases.
  • Closing Based on Deposit Currency
    Set the EA to close positions when a predefined level of profit or loss is achieved in the deposit currency, ensuring precise control.
  • Closing Based on Percentage of Balance
    Automatically close positions when a specific percentage of the account balance is reached, whether in profit or loss.
  • Closing Based on Pips
    Define criteria to close positions based on the number of pips gained or lost, allowing for tailored adjustments to your trading strategy.
  • Position Management Filters
    • All Symbols or Current Symbol: Manage all currency pairs or limit actions to the current symbol only.
    • Separate Management for BUY and SELL directions: Independently manage and close BUY and SELL positions, offering more control over trading directions.
    • Separate Order Virtual Stop-Loss and Take-Profit: Utilize virtual levels to conceal your strategy from the broker while enhancing trading precision. This helps to keep your strategy hidden from the broker.
  • Risk Manager and Equity Protector
    Integrated features to prevent excessive losses and protect your capital during volatile market conditions.
  • Flexible Settings and Customization
    Fully customizable parameters to match your unique trading strategies and preferences.

How does CLP CloseIfProfitorLoss work?

CLP CloseIfProfitorLoss overiview

CloseIfProfitorLoss Features and Controls

CloseIfProfitorLoss Main functions of CLP

CLP tab – Closing on total profit and loss with profit traling!!!

CLP GIF CloseIfProfitorLoss

CLP CloseIfProfitorLoss Closing by Total Profit

CloseIfProfitorLoss Closing by Total Loss

CloseIfProfitorLoss Closing with Profit Trailing

CloseIfProfitorLoss Closing All Symbols

CloseIfProfitorLoss Trailing Profit

Virtual Trade Pad VirtualTradePad

CLP

CloseIfProfitorLoss Virtual StopLoss

CloseIfProfitorLoss controls

What do people write about CLP CloseIfProfitorLoss ?

  • Atila R Akdeniz
    Excellent Tool, very useful to do operations on the termial. All of Vladislav's products are of excellent quality, and he provides very good support. With the current prices it's a good time to buy all his products.
    Atila R Akdeniz
    ⭐⭐⭐⭐⭐
  • Vadim V.
    Hi, I bought Profit or Loss Pad 1 month ago and run it on MT5 and it worked OK. I found the EA very helpful and bug fee in work that helps me to scalp not looking when I need to get out. EA that good tool. 5 stars to Vlad.
    Vadim V.
    ⭐⭐⭐⭐⭐
  • Agnaldo Prata
    Awsome tool, it makes risk management a lot easyer, thanks to the developer, good job.
    Agnaldo Prata
    ⭐⭐⭐⭐⭐
  • Terek
    купил сразу как нужен был equity trail, потому что все продукты от данного производителя высшего качества. будем посмотреть. функционал вроде не плохой. но сразу бросается в глаза притормаживающее отображение профита на панели, нельзя ли его ускорить как то? еще не нашел функцию отключения кнопки автоторговли после закрытия, но это не так важно. главное что бы equity trail работал.
    Terek
    ⭐⭐⭐⭐⭐
  • Gregory Knobloch
    Awesome Products from this vendor
    Gregory Knobloch
    ⭐⭐⭐⭐⭐
  • thrzk01
    It's excellent toll for multi entry trading management(brake even T/P with profit you want in Long/Short Separately).
    thrzk01
    ⭐⭐⭐⭐⭐
  • Max
    Amazing product, works very well and neat, what I was looking for and also have other his other products like full trade pad, good producer, many detailed functions buttons on chart and also in settings!
    Max
    ⭐⭐⭐⭐⭐
  • Stan Baftalovskiy
    Отличный продукт, мне понравился!
    Stan Baftalovskiy
    ⭐⭐⭐⭐⭐
  • emat
    Very good product.
    emat
    ⭐⭐⭐⭐⭐
  • rvstrade
    exactly what I needed. great tool. recommended. A+ product and seller.
    rvstrade
    ⭐⭐⭐⭐⭐

You can Download free CLP CloseIfProfitorLoss

Get started for FREE!

You can download and install our program for free!

And you can test it on your DEMO account without time limits!
And you can also test our program for free on a REAL account using the USDJPY symbol!

You can Buy full version of CLP CloseIfProfitorLoss

clp

MetaTrader

Time Use

Computers

Functions

Support

FULL MT4 version


For MetaTrader 4

40 $

MT 4

Lifetime

Unlimited

10

Full

24/7

FULL MT5 version


For MetaTrader 5

40 $

MT 5

Lifetime

Unlimited

10

Full

24/7

RENT for 3 months


For MetaTrader 4

30 $

MT 4

3 months

Unlimited

10

Full

24/7

RENT for 3 months


For MetaTrader 5

30 $

MT 5

3 months

Unlimited

10

Full

24/7


Before making a purchase, we highly recommend reviewing our instructions and FAQ section to ensure a smooth experience.

Useful links


Download MetaTrader

How to Buy How to Install Strategy Tester VPS MetaQuotes MT4 Log Files MT5 Log Files

Description

Closing of positions in MetaTrader 4/5 for total profit/loss with profit trailing.

Features and Controls of CLP CloseIfProfitorLoss
Features and Controls

Convenient Control Panel for Expert Advisor Management

This Expert Advisor (EA) comes with a highly convenient panel that simplifies the management of trades and positions. It offers several advanced features to ensure optimal control over your trading strategy.

Key Features:

In addition to closing positions at a set level of profit, the EA can implement a trailing function, which helps secure even more profit by adjusting stop-loss levels as the market continues to move in your favor.

Close All Positions at Total Profit or Loss
Automatically close all open positions when a specific level of total profit or loss is reached, protecting your capital and locking in results.

Separate Order Management:

You can enable the Separate Order feature to manage and close positions independently based on specific parameters, such as stop-loss and take-profit.

Separate Calculation for BUY and SELL Positions:

With the Separate BUY SELL option, the EA calculates and closes BUY and SELL positions separately, allowing for precise control over each side of the market.

All Symbols or Current Symbol:

You can choose to apply the EA’s calculations and closing functions to either all symbols in the terminal or restrict it to the current symbol only, providing flexibility across different trading pairs.

Trailing Profit:

The EA features a Trailing Profit function that adjusts the stop levels dynamically as profits increase, enabling you to lock in more gains from favorable market movements.

Closing Based on Various Criteria:

The EA can close positions based on different parameters:

  • Deposit Currency: Closes trades once a specific profit or loss in the account’s base currency is reached.
  • Points (Pips): Closes trades when a set number of points or pips is gained or lost.
  • Percentage: You can set the EA to close trades when a certain percentage of the account balance is achieved, either in profit or loss.

Drawdown: Automatically closes trades when the account experiences a specified drawdown level to manage risks.

Set Total Loss and Profit:

You can configure the EA to automatically close positions when the total loss or profit reaches a preset value:

Total Loss: The EA will close all positions when the combined loss exceeds a specified amount in dollars, points (pips), or as a percentage of the account balance.

Total Profit: The EA will also close positions when the combined profit reaches a set level, based on similar criteria (dollars, points, or percentages).

Universal Use:

This advisor can be used on any account and is compatible with any other advisor or manual trading. It works by monitoring the total balance of deals (positions) for a specific pair or across all pairs.

When the total balance reaches the value specified in the settings, the EA closes all deals (positions) and deletes any pending orders.

Profit Trailing for Greater Gains:

THIS EA is a tab from VIRTUALTRADEPAD

The control panel closes by the general profit or loss in dollars, pips, and % of the balance.

The panel can be used as a virtual stop loss or take profit.

There is also an emergency button – Close ALL (You can activate this button in the input settings).

Added the ability to profit trailing.

If you see a red indicator, then the function is turned off and does not work;

If you see a green indicator, then the function is turned on and working.

Profit Trailing Indicator

Control:

  1. All Symbols – Use closing on all symbols.
    • The utility will monitor and close all trading symbols (currency pairs) that are open in the terminal.
    • All Symbols Closing
  2. XXXXXX Only – Use closing only on the current currency pair on which the advisor is installed.
    • The utility will monitor and close only those positions that are open on the current currency pair. By the trading symbol on which our utility is installed.
    • Current Symbol Only Closing
  3. Separate BuySell – Use separate closing for all BUY and all SELL positions separately for each direction.
    • This means that our utility will monitor and close a series of BUY positions and a series of SELL positions.
    • Total profit/loss on all BUY positions and Total profit/loss on all SELL positions.
    • If you turn this feature off, our utility will monitor and close all BUY and SELL positions together only when the total profit or loss is reached.
    • Separate Buy and Sell Closing
  4. Separate DEALs – Use separate closing for each deal/position separately.
    • The utility will monitor and close each position separately.
    • Each position will be closed at the set profit or loss separately.
    • Each position is processed separately from each other.
    • Separate Deals Closing
  5. Profit $ – Turns on/off the closing on the total Profit in dollars or the deposit currency.
  6. Profit p – Turns on/off the closing of the total Profit in points.
  7. Profit % – Turns on/off the closing on the total Profit as a percentage of the current balance.
  8. Trail $ – Distance from Profit $, at which the trailing of Profit started.
  9. Trail p – Distance from Profit p, at which the trailing of Profit started.
  10. Trail % – Distance from Profit %, at which the trailing of Profit started.
  11. Loss $ – Turns on/off the closing for the total loss in dollars or the deposit currency.
  12. Loss p – Turns on/off the closing of the total loss in points.
  13. Loss % – Turns on/off the closing of the total loss as a percentage of the current balance.
  14. Close if Profit or Loss ON – The closing function for total Profit or loss is ON
    • Press the ON button to start the function.
  15. Close if Profit or Loss OFF – The closing function for total Profit or loss is OFF.

Main Characteristics

  1. The panel works on the symbol that is set (Current Symbol) or considers the total profit or loss for all symbols.
  2. The panel can be used as a virtual stop loss or take profit.
    • To do this, set profit and loss and tick off Separate Orders.
    • The EA will close positions separately from each other, according to the set profit and loss values in points, dollars, and percentages.
  3. In the panel, you can choose the type of closing: for profit in dollars, in pips, or % of balance, as well as for loss in dollars, in pips, or % of the balance.
  4. Also, there is a button called “CLOSE ALL“, which closes the position of the symbol or all positions (depending on the choice) instantly.
  5. Directly on the panel, it displays information about the current condition of your positions for the selected methods of closing.
  6. Profit can be set only above 0.
    • If you set 0 – the field will flash red.
    • This means that the set value has an error, and this field will not work with the Expert Advisor.
    • If you set a value with a minus, the EA will automatically move the field to a positive value (for example, -100 = 100).
  7. Loss can only be set below 0.
    • If you set 0, the field will flash red.
    • This means that the set value has an error, and this field will not work with the Expert Advisor.
    • If you set a value with a plus, the EA will automatically move the field to the minus value (for example, 100 = -100).

Terms of Use

  1. Place the panel on your currency pair.
  2. Depending on how you want to close positions (for all symbols or the current one), please select the corresponding option on the panel itself.
  3. For the checkbox to select the type of closure to be active, you need to enter parameter values other than 0, with a positive value for profit and a negative value for loss, for example, -100.
  4. Check the boxes of units you want to use when closing (Profit / Loss in points / dollars / percentages).
  5. Enable the Close if Profit or Loss button; it should turn blue (green).
    • This means that the EA is active.
  6. As soon as the profit or loss of your positions crosses the mark of the established levels, the deals will be closed.
  7. The emergency button CLOSE ALL is designed to close all positions instantly.

Close on Total Profit

Close on Total Profit Video Thumbnail

The Close All Positions at Total Profit feature is designed to automatically close trading positions once a specified profit level is reached, providing precise control over your trading outcomes.

This function supports multiple profit criteria, enabling traders to define thresholds in terms of currency value, points, or percentage of balance.

  • To set up the Close All Positions at Total Profit function, load the Expert Advisor onto your desired chart in MetaTrader and activate it.
  • Configure the key parameters: enable Profit $Profit p, or Profit %, and input your target values for closure based on total profit in dollars, points, or percentage of balance.
  • Toggle Close if Profit or Loss ON to activate the function
  • and choose whether it applies to All Symbols or only the current symbol ([XXXXXX] Only).
  • For more control, activate Separate BuySell to monitor and close BUY and SELL positions independently or Separate DEALs to process and close each individual position separately.
  • Once set, press the ON button to start monitoring, and the EA will automatically close positions upon reaching your predefined thresholds.

For example

Scenario: Close positions when the total profit reaches $50 across all symbols.

  • Enable Profit $ by checking the corresponding box.
  • Enter 50 in the Profit $ field.
  • Set All Symbols to monitor and close positions across all currency pairs.
  • Ensure Separate BuySell and Separate DEALs are OFF if you want combined monitoring for both BUY and SELL positions.
  • ON button
Close positions when the total profit reaches $50 across all symbols.

Scenario: Close positions on the current symbol when profit exceeds 10 pips.

  • Enable Profit p by checking the corresponding box.
  • Enter 10 in the Profit p field.
  • Set [XXXXXX] Only to restrict monitoring to the current symbol.
  • Activate Separate DEALs if you want each position closed individually.
  • ON button
Close positions on the current symbol when profit exceeds 10 pips.

Scenario: Close BUY and SELL positions independently when the profit for each reaches 5% of the balance.

  • Enable Profit % by checking the box.
  • Enter 5 in the Profit % field.
  • Activate Separate BuySell to monitor and close positions for BUY and SELL groups separately.
  • ON button
Close BUY and SELL positions independently when the profit for each reaches 5% of the balance

Close on Total Loss

Close on Total Loss Video Thumbnail

The Close on Total Loss feature is designed to automatically close trading positions once a specified loss level is reached, ensuring that your trading account is protected from excessive drawdowns.

This function supports multiple loss criteria, enabling traders to define thresholds in terms of currency value, points, or percentage of balance.

  • To set up the Close on Total Loss function, load the Expert Advisor onto your desired chart in MetaTrader and activate it.
  • Configure the key parameters: enable Loss $Loss p, or Loss %, and input your target values for closure based on total loss in dollars, points, or percentage of balance.
  • Toggle Close if Profit or Loss ON to activate the function.
  • Choose whether it applies to All Symbols or only the current symbol ([XXXXXX] Only).
  • For more control, activate Separate BuySell to monitor and close BUY and SELL positions independently or Separate DEALs to process and close each individual position separately.
  • Once set, press the ON button to start monitoring, and the EA will automatically close positions upon reaching your predefined loss thresholds.

For example:

Scenario: Close positions when the total loss reaches $100 across all symbols.

  • Enable Loss $ by checking the corresponding box.
  • Enter 100 in the Loss $ field.
  • Set All Symbols to monitor and close positions across all currency pairs.
  • Ensure Separate BuySell and Separate DEALs are OFF if you want combined monitoring for both BUY and SELL positions.
  • Once set, press the ON button to start monitoring, and the EA will automatically close positions upon reaching your predefined loss thresholds.
Close positions when the total loss reaches $100 across all symbols.

Scenario: Close positions on the current symbol when loss exceeds 300 pips.

  • Enable Loss p by checking the corresponding box.
  • Enter 300 in the Loss p field.
  • Set [XXXXXX] Only to restrict monitoring to the current symbol.
  • Activate Separate DEALs if you want each position closed individually.
  • Once set, press the ON button to start monitoring, and the EA will automatically close positions upon reaching your predefined loss thresholds.
Close positions on the current symbol when loss exceeds 300 pips.

Scenario: Close BUY and SELL positions independently when the loss for each reaches 1% of the balance.

  • Enable Loss % by checking the box.
  • Enter 1 in the Loss % field.
  • Activate Separate BuySell to monitor and close positions for BUY and SELL groups separately.
  • Once set, press the ON button to start monitoring, and the EA will automatically close positions upon reaching your predefined loss thresholds.
Close BUY and SELL positions independently when the loss for each reaches 1% of the balance.

Trailing Profit

Trailing Profit Video Thumbnail

The Trailing Profit feature allows your trading strategy to automatically adjust and secure profits as the market moves in your favor.

Instead of closing positions at a fixed profit level, this function enables a dynamic trailing mechanism that locks in profits by adjusting the closing threshold based on the specified trailing distance.

When the Trailing Profit function is enabled, the EA continuously monitors your total profit.

Once the profit reaches the predefined value, the EA activates the trailing mechanism, adjusting the profit threshold to trail behind the current profit by the specified distance.

This ensures that your profits are protected and maximized as the market evolves.

This feature is versatile and works seamlessly with all types of closing configurations, including All SymbolsCurrent Symbol, and Separate BuySell.

  • To set up the Trailing Profit function, load the Expert Advisor onto your desired chart in MetaTrader and activate it.
  • Enable the trailing feature by checking the corresponding box for Profit Trailing.
  • Enter your desired Profit $ value in the designated field to set the initial profit target.
  • Specify the Trail $ distance, which determines how far behind the current profit the trailing mechanism will follow.
  • Choose whether the trailing should apply to All Symbols, the Current Symbol Only, or use Separate BuySell for independent management of BUY and SELL positions.
  • Once configured, press the ON button to activate the trailing profit function.

The EA will now monitor and adjust the closing thresholds automatically based on your settings.

For example:

Scenario: Trailing Profit activates at $10 with a trail distance of $5.

  • Enable Profit Trailing by checking the corresponding box.
  • Enter 10 in the Profit $ field to set the initial profit target.
  • Set Trail $ to 5 to define the trailing distance.
  • Choose All Symbols to apply the trailing profit across all open currency pairs.
  • Press the ON button to start the trailing profit function.
    • Once the total profit reaches $10, the EA will activate trailing and adjust the profit threshold to trail $5 behind the current profit.
  • If the profit continues to increase, the trailing threshold moves accordingly. If the profit decreases and falls below the trailing distance, the EA will automatically close all positions.
Trailing Profit activates at $10 with a trail distance of $5.

Scenario: Trailing Profit activates at 50 pips with a trail distance of 20 pips.

  • Enable Profit p by checking the corresponding box.
  • Enter 50 in the Profit p field to set the initial profit target in pips.
  • Set Trail p to 20 to define the trailing distance in pips.
  • Choose All Symbols to apply the trailing profit across all open currency pairs.
  • Press the ON button to start the trailing profit function.
    • Once the total profit reaches 50 pips, the EA will activate trailing and adjust the profit threshold to trail 20 pips behind the current profit.
  • If the profit continues to increase, the trailing threshold moves accordingly. If the profit decreases and falls below the trailing distance, the EA will automatically close all positions.
Trailing Profit activates at 50 pips with a trail distance of 20 pips.

Scenario: Trailing Profit activates at 5% of the deposit with a trail distance of 2%.

  • Enable Profit % by checking the box.
  • Enter 5 in the Profit % field to set the initial profit target as a percentage of the current balance.
  • Set Trail % to 2 to define the trailing distance as a percentage of the current balance.
  • Choose All Symbols to apply the trailing profit across all open currency pairs.
  • Press the ON button to start the trailing profit function.
    • Once the total profit reaches 5% of the deposit, the EA will activate trailing and adjust the profit threshold to trail 2% behind the current profit.
  • If the profit continues to increase, the trailing threshold moves accordingly. If the profit decreases and falls below the trailing distance, the EA will automatically close all positions.
Trailing Profit activates at 5% of the deposit with a trail distance of 2%.

Scenario: Trailing Profit on the current symbol with separate DEALs.

  • Enable Profit Trailing by checking the corresponding box.
  • Enter your desired Profit $ value in the Profit $ field (e.g., 15).
  • Set Trail $ to 3 to define the trailing distance.
  • Select [XXXXXX] Only to restrict the trailing profit to the current currency pair.
  • Activate Separate DEALs to ensure each individual position is trailing and closed separately based on the defined profit and trailing distance.
  • Press the ON buttonn to initiate the trailing profit function. Each position on the current symbol will now trail its profit independently, closing only when the trailing distance condition is met.

If the profit continues to increase, the trailing threshold moves accordingly. If the profit decreases and falls below the trailing distance, the EA will automatically close all positions.

Trailing Profit on the current symbol with separate DEALs.

The option works for all types of closing: All symbols, Current symbol, Separate direction BUY, and SELL. Each order is separate.

The Difference Between TrailingStop Positions and Trailing Profit CLP:

Trailing Stop is a modification of the real stop-loss to a breakeven level and pulling up the stop loss into the profitable zone for each position.

This is a standard trailing stop for each position separately.

  1. The first step in the Trailing Stop operation is to set the stop loss to breakeven.
  2. The second step of the Trailing Stop operation is the modification of the stop loss to increase the fixed profit.

TrailingStop can only be set in points!

Trailing ProfitThis is a modification of the virtual stop loss level for positions (All or separately, depending on the choice) in the profitable zone.

Trailing Profit works on the CLP tab and allows you to close a series of positions based on the total profit, setting and fixing the minimum level of the total profit.

It makes it possible to increase the closing level for the total profit.

TrailingProfit can be set in points, deposit currency, and percentage of the current balance.

Profit or Loss Pad Screen

When the value is set to Profit = 10, and for Trailing Profit = 5, the profit trailing line is set at $5.

The advisor, when passing the $10 mark, will turn ON the profit trailing function and will trail the closing mark behind the profit.

In the log, records of the current Profit position will be displayed.

 10:20:20 Exp - CloseifProfitorLoss  EURUSD, H1: Trailing is ON tralprofit = 12.00000000
10:20:20 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 12.00000000
10:20:20 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 13.00000000
10:20:20 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 13.50000000
10:20:21 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 13.50000000
10:20:23 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 13.50000000
10:20:23 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 14.00000000
10:20:24 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 14.50000000
10:20:24 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 14.50000000
10:20:29 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 15.00000000
10:20:31 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 16.00000000
10:20:32 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 17.50000000
10:20:36 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 18.50000000
10:20:37 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 21.50000000
10:20:37 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 24.00000000
10:20:37 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 24.00000000
10:20:39 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 26.50000000
10:20:39 Exp - CloseifProfitorLoss  EURUSD, H1: Level Profit up tralprofit = 28.00000000 

After the total profit falls below the last fixed level – TrailingProfit, the advisor will forcibly close all transactions:

 10:20:42 Exp - CloseifProfitorLoss  EURUSD, H1: Close position _close = 23.00000000 tralprofit = 23.00000000
10:20:43 Exp - CloseifProfitorLoss  EURUSD, H1: close # 212724663 buy 0.10 EURUSD at 1.34049 at the price of 1.34095
10:20:44 Exp - CloseifProfitorLoss  EURUSD, H1: close # 212724661 buy 0.10 EURUSD at 1.34049 at the price of 1.34094
10:20:45 Exp - CloseifProfitorLoss  EURUSD, H1: close # 212724660 buy 0.10 EURUSD at 1.34049 at the price of 1.34095
10:20:45 Exp - CloseifProfitorLoss  EURUSD, H1: close # 212724658 buy 0.10 EURUSD at 1.34049 at the price of 1.34095
10:20:46 Exp - CloseifProfitorLoss  EURUSD, H1: close # 212724657 buy 0.10 EURUSD at 1.34049 at the price of 1.34094 

Examples of Use Presented in Pictures and Videos

Usage Examples of CLP CloseIfProfitorLoss

Example of Trailing Profit in a Percent:

CLP_TralOptionsStep is the step of changing the trailing. If you close in percentage, then this parameter is indicated in percent. For example, = 0.01, then 0.01%.
Profit% is the profit level at which a profit is closed or trailing. For example, 2%.
TrailingProfit is the distance from the profit to the fixing of the trailing. Indicated in the values in which you will close.

For example, in percent, = 1. This means that when the profit reaches 2%, the profit level will be fixed at the position of 1% (2 – 1 = 1).

If the profit is 2.01%, then the level of the trailing will be fixed at 1.01%, and so on.

If the profit falls below 1.01%, then all positions will close.

Trailing Profit in Percent

Example of Trailing the Total Profit in the Deposit Currency and Separately in the BUY/SELL Directions:

CLP_TralOptionsStep – a step change in trailing. If you close in dollars (or another currency), then this parameter is indicated in dollars (or another). For example, 1 then $1 (or another).
Profit $ is the profit level at which a profit is closed or trailing — for example, $5 (or another).
TrailingProfit is the distance from the profit to the fixing of the trailing. Indicated in the values in which you will close.

For example, in dollars (or another currency), = 1. This means that when the BUY or SELL profit is achieved at $5 (or another), the profit level will be fixed at the $4 (or another) position (5 – 1 = 4).

If the BUY profit is $6 (or another), then the level of the trailing will be fixed at $5 (or another), and so on. If the profit falls below $5 (or another), then all positions will close.

If SELL is at a loss, this will not affect the closing of BUY because we have included the option of separate monitoring of types (BUY and SELL).

Trailing Profit in Deposit Currency and Buy/Sell Directions

Virtual Stop Loss/Take Profit Mode on CLP (Separate DEALs)

Virtual Stop Loss/Take Profit Video Thumbnail

You can enable Virtual Stop Loss and Take Profit as well as Virtual Trailing Profit on the CLP tab.

In this case, all positions will be monitored and closed separately from each other!

You can move these levels only by changing the values on the CLP control panel!

You can set virtual stop loss/take profit in points, deposit currency, and percent!

The CLP tab is for closing based on the total Profit and loss.

Positions are closed after the set Profit (Virtual Take Profit) and after the loss (Virtual Stop Loss).

Why Virtual? Because the Real Stop Loss and Take Profit are set on the server at the price (Stop Loss and Take Profit).

Virtual Stop Loss and Take Profit involve setting virtual levels and storing all data in variables (objects, lines, etc.).

When setting Separate Deals, each separate deal/position has its own virtual closing level (Profit/Loss in deposit currency, pips, percent).

Each position is closed at its set profit or loss level, virtually. That is, without real stop-loss and take-profit set.

The order to close positions is created when these levels are activated (Price Crossover).

That is why this mode is called Virtual Stops!

To enable Virtual Take Profit/Stop Loss mode:

  1. Go to the CLP tab.
  2. Select the Separate Deals checkbox;
  3. Set the Virtual TakeProfit in fields: Profit $/Profit p/Profit %;
  4. Set the Virtual StopLoss in fields: Loss $/Loss p/Loss %;
  5. Set the Virtual Trailing Stop in fields: Trail $/Trail p/Trail %;
  6. Enable and activate CLP ON.
Virtual Stop Loss/Take Profit Mode

Showing Lines of the Future Closing of Positions

Additional:

Also, the Expert Advisor shows approximate closing price lines for total profit or loss.

Parameter Show_Future_BE_TP_SL – showing lines of the future closing of positions for total profit or loss.

Caution: Only works on the current symbol and when the Separate Orders mode is off.

Lines are shown separately for Buy and Sell positions or a common line.

If the line is not shown, then the positions form a lock, which cannot be closed by the total profit or loss.

Note: Line and price data may not be accurate on the floating spread.

Remember! SELL is closed by ASK, and BUY is closed by BID.

Future Closing Lines for Positions

Work Closing by Total Profit and Loss on VPS Server from MetaQuotes

CLP tab settings to the Trade Pad external parameters.
VPS_CLP_Activation=false; // VPS_CLP_Activation → CLP activation for VPS

Because MetaQuotes prohibits sending global variables to the VPS server from MQL (MetaQuotes Language), all buttons, checkboxes, edit fields, and controls on the Trade Pad panel no longer work on VPS from MQL (MetaQuotes).



You can customize the function of closing by total profit or loss from the external settings of the Utility:

Attention! If the VPS_CLP_Activation parameter is enabled (true), then all settings for this function will work from external variables!
Objects on the CLP tab will be inactive!

VPS CLP Activation Settings

Example of Consistent Work of the Advisor

Advisor Consistent Work Example 1
Advisor Consistent Work Example 2
Advisor Consistent Work Example 3
Advisor Consistent Work Example 4

External Variables and Settings CLP CloseIfProfitorLoss

NameDescription

Sounds
Enable/Disable sound alerts when opening, closing, or modifying positions and orders


You can turn notifications for opening, closing, or errors on your phone or enable sound notifications in the Notifications section.
You can also change the sound file name in WAV format without specifying a file extension (name only).
HintShow  Enable/Disable tooltips when hovering over buttons
Language Language SelectionSpanish, Portuguese (Brazil), German, Chinese, Japanese;


By default, the prompt language is automatically determined by your terminal’s language. 
You can also select your preferred language;


The translation was performed using Google Translator, MQL, and the Terminal site!


Some words have been trimmed to save space (the maximum line length for tooltips is 255 characters).
If you find a translation error, please write to us:  Contact Us
ButtonLanguageUse the ButtonLanguage parameter to select the language of the text on the buttons and the main language of the panel (information on the tabs).


Available languages: English, Português, Español, Deutsch, Français, Italiano, Turkish.


Note: This parameter affects only the text of buttons and tabs. 
The text of tooltips can be selected using the Language parameter!
int MagicNumber = 777 The magic number for positions and orders is set when opening.
Used to identify positions and orders for my EA or others.


– Without a magic number, 


MultiMagic:
The MagicNumber parameter has been updated: the first digit indicates the magic number for opening and modifying positions. 
You can also specify multiple magic numbers; 


e.g.:
MagicNumber = 777  UseAllMagicFromAllAccount = true
The Expert Advisor monitors all positions for the current symbol across the entire account;


MagicNumber = 777  UseAllMagicFromAllAccount = false
The Expert Advisor monitors positions with a magic number of 777 for the current symbol across the entire account;


MagicNumber = 777,888  UseAllMagicFromAllAccount = false
The Expert Advisor tracks positions with magic numbers 777 and 888 (opens positions with magic number 777) for the current symbol across the entire account;


MagicNumber = 777,888,999  UseAllMagicFromAllAccount = false
The Expert Advisor tracks positions with magic numbers 777, 888, and 999 (opens positions with magic number 777) for the current symbol across the entire account;
bool UseAllMagicFromAllAccount = true Allows consideration of all positions opened in the terminal for this currency pair.


Example:
UseAllMagicFromAllAccount = true
All positions with any magic number will be considered when opening, closing, modifying, or calculating information.


UseAllMagicFromAllAccount = false
The Expert Advisor considers only those deals that have the MagicNumber.
  
Show_Future_BE_TP_SLShow_Future_BE_TP_SL – Display break-even and profit/loss levels on the current chart.


The price levels of the lines are calculated based on the values entered in the Profit and Loss fields, measured in points, dollars, or percentages.
Note: Only works for the current symbol and when the Separate Orders mode is off.
The lines are displayed at the points where the “close on profit or loss” function is triggered.




Lines are shown separately for Buy and Sell positions or as an average line.
If the line is not shown, the positions are locked and cannot be closed based on total profit or loss.
Note: Line and price data may not be accurate on the floating spreadsheet.
Remember: SELL positions are closed by ASK prices, and BUY positions are closed by BID prices. 
It is important to note that the price of one point can change based on the quotations of other currency pairs.


For example: if the value of 1 point for the EURJPY currency pair and the deposit currency is the dollar, changes in the USDJPY rate affect it.
The cost of 1 point = 0.01 JPY. 
If your account is in dollars or rubles, the cost of the symbol is constantly changing.
This means that the future profit or loss line can fluctuate.
The exact closure level cannot be predicted. The level of future profit or loss can be influenced by commission and swaps.
Also, during closure.
double CLP_TralOptionsStep = 0 CLP_TralOptionsStep – The step for adjusting the profit level when trailing profits are measured in standard units (points, deposit currency, percentages).


When the Trailing Profit function is active, the Expert Advisor updates the profit level by each unit (points, dollars, percentages).


Example:
CLP_TralOptionsStep = 1
The profit level is adjusted every 1 unit (point, dollar, percentage).
CLP_TralOptionsStep = 15
The profit level is adjusted every 15 units (points, dollars, percentages).
bool CLP_DeleteStopOrders = false CLP_DeleteStopOrders – Delete pending orders when “closing on total profit or loss”.
bool Use_Lots_in_CLP_Points = false Use_Lots_in_CLP_Points – When calculating profit or loss points, the Expert Advisor also considers the lot (volume) of these positions. 
This option is useful when trading on a hedge account with different lot sizes.


Example:
Open 2 SELL positions for EURUSD:
SELL 0.01 with a profit of 20 points and $0.2
SELL 0.02 with a loss of -12 points and -$0.24.


When Use_Lots_in_CLP_Points = false, the Expert Advisor calculates “clean” points.
In this case, the profit will be -$0.04 or 8 points.
As we can see, the position (Deal) gained profit in points but resulted in a loss in dollars.


When Use_Lots_in_CLP_Points = true, the Expert Advisor calculates points by considering the lots.
In this case, the profit will be -$0.04 or -4 points.




When calculating profit in points and enabling the “Include lots in the calculation of profits” option,
the EA identifies the minimum lot from the presented positions and calculates points based on this lot.
e.g.:
Minimum position 0.01, 1 “clean” point = 1 point,
If a position with lot 0.02 is opened, then 1 net point = 2 points, including the lot.
If a position with lot 0.05 is opened, then 1 net point = 5 points, including the lot.
Use_Commission_in_CLPUse_Commission_in_CLP – Enable commission calculation when closing positions.


True – Commission is included in the calculations.
False – Commission is not included in the calculations.


Note: Commission is calculated based on an open deal and then multiplied by 2 (a commission is also charged when closing a deal).
This is the standard method of calculating commission!
In MetaTrader 5, it is impossible to retrieve the commission calculation type from an EA (Expert Advisor)!
If you do not want the EA to calculate commission automatically, you can disable this feature!


Note: This function only affects calculations on the CLP tab. 
All other tabs operate in standard mode, taking commissions into account.
bool AutoCorrect_LevelCLP = true AutoCorrect_LevelCLP – Automatically corrects the input values for CLP levels.
In the loss field, you can only enter negative values;
if a user enters +10, the system will automatically set it to -10.
In the profit field, you can only enter positive values;
if a user enters -10, the system will automatically set it to +10.
In CLP_TralOptions, only positive values can be entered.
Otherwise, the Expert Advisor will return an error.

if AutoCorrect_LevelCLP = false
you can set trailing profit to be triggered from the negative zone
https://expforex.com/closeifprofitorloss/#faq
bool CPL_Alert = false Send a message about profit/loss on the terminal chart.
bool CPL_Mail = false Send a message about profit/loss via Email
How to set up the terminal to send emails
bool CPL_Push = false Send a message about profit/loss via Push Notifications
How to set up the terminal to send push notifications
CPL_CloseAllCharts_per_CloseAllDealsCPL_CloseAllCharts_per_CloseAllDeals – Closes charts/other charts before closing positions.


— This parameter helps resolve the issue where our panel starts closing positions upon reaching total profit or loss while other Expert Advisors simultaneously begin to open new positions. 


— The CPL_CloseAllCharts_per_CloseAllDeals parameter closes only those charts where other Expert Advisors are installed (excluding VirtualTradePad) only for MT5.


— The CPL_CloseAllCharts_per_CloseAllDeals parameter closes all charts (when All Symbols are enabled) or only those charts with a symbol matching the VirtualTradePad symbol.


— The CPL_CloseAllCharts_per_CloseAllDeals parameter saves chart templates before closing them! 
The templates can be downloaded later. Template name format: VTP_Symbol_Period_ExpertName (only for MT5).


Important:
— In MT5: Only the charts where the Expert Advisor is installed are closed.
— In MT4: There is no way to identify the name of the Expert Advisor, so all charts are closed.

When this function is enabled (CPL_CloseAllCharts_per_CloseAllDeals = true), VirtualTradePad will first save the templates of all charts, close all charts, and then close all positions before doing so.

https://www.youtube.com/embed/AVSjDDitclE
bool CPL_CloseTerminalAfterClose = false CPL_CloseTerminalAfterClose – The terminal will close after all positions have been closed.
CPL_AUTOOFF_AfterClose CPL_AUTOOFF_AfterClose – Automatically turn off the “Close on Total Profit or Loss” button after all positions are closed.
The automatic turn-off occurs only when ALL positions are closed.
The magic number specified in the Expert Advisor and the symbol for closing are taken into account.
If you choose to close only one currency, then when the parameter CPL_AUTOOFF_AfterClose is enabled, the EA waits until all positions for that currency are closed before turning off the button.
ClosingCurrentTicketOnly ClosingCurrentTicketOnly – Close only the current list of tickets.


This option helps avoid issues where the program starts closing positions based on total profit while another Expert Advisor is simultaneously opening new positions.
ClosingCurrentTicketOnly = true. Then, if the total profit conditions are met, the VirtualTradePad program will close only the current list of positions. 


If new tickets are added to the list of positions, the VirtualTradePad program will ignore them.
ClosingCurrentTicketOnly = false. Then, if the total profit conditions are met, the VirtualTradePad program will close all positions, even if another Expert Advisor opens new positions.
ClosebyFIFOClosebyFIFO – Close positions according to FIFO (First In, First Out) rules;
When closing positions, the FIFO rule is applied (first opened, first closed).
Positions are closed in the order they were opened.
Note: This rule should only be used when working with all symbols and closing all positions at once.
Note: This mode prohibits the use of functions such as Separate Deals.
ShowCloseAllButtonShowCloseAllButton – Display the “Close All” button on the panel.
The button allows you to close all transactions immediately.
After pressing the button, all positions and orders will be closed.
Note: The behavior depends on the All Symbols or Current Symbol Only parameter.
Close All Button on Forex Trading Panel
  


e05vps=”================= VPS MQL5 CLP options
VPS_CLP_Activation=false;//VPS_CLP_Activation → CLP activation for VPS
VPS_CLP_AllSymbols=false;
VPS_CLP_CurrentSymbol=false;
VPS_CLP_SeparateBUYSELL=false;
VPS_CLP_SeparateDEALS=false;
e060=”===================================”;
VPS_CLP_Profit_Currency=false;
VPS_CLP_Profit_Currency_amount=0;
VPS_CLP_Profit_Pips=false;
VPS_CLP_Profit_Pips_amount=0;
VPS_CLP_Profit_Percent=false;
VPS_CLP_Profit_Percent_amount=0;
e061=”===================================”;
VPS_CLP_Trailing_Profit_Currency=false;
VPS_CLP_Trailing_Profit_Currency_amount=0;
VPS_CLP_Trailing_Profit_Pips=false;
VPS_CLP_Trailing_Profit_Pips_amount=0;
VPS_CLP_Trailing_Profit_Percent=false;
VPS_CLP_Trailing_Profit_Percent_amount=0;
e062=”===================================”;
VPS_CLP_Loss_Currency=false;
VPS_CLP_Loss_Currency_amount=0;
VPS_CLP_Loss_Pips=false;
VPS_CLP_Loss_Pips_amount=0;
VPS_CLP_Loss_Percent=false;
VPS_CLP_Loss_Percent_amount=0;
CLP Tab Settings for Trade Pad External Parameters.

Because MetaQuotes prohibits sending global variables to the VPS server from MQL (MetaQuotes), all buttons, checkboxes, edit fields, and controls on the Trade Pad panel no longer function on VPS via MQL.

You can customize the “Close on Total Profit or Loss” function through the external settings of the Utility:

Note: If the VPS_CLP_Activation parameter is enabled (true), all settings for this function will be managed through external variables!
Objects on the CLP tab will be inactive!
int MAGIC_FONTSIZE = 12 The text size on the chart when using MagicTarget, as well as Show_Future_BE_TP_SL and Show_Future_Line.
color MAGIC_ORDER = clrYellow The color of the center line, the opening price of the position, and the order on the chart.
color MAGIC_STOPLOSS = clrRed The color of Stop Loss lines on the chart.
color MAGIC_TAKEPROFIT = clrGreen The color of Take Profit lines on the chart.
color NULLColor1 = clrGray The color used for informational text in the panel.
color PLUS_Color = clrLime The color representing positive values in the panel information.
color MINUS_Color = clrOrangeRed The color representing negative values in the panel information.
color TEXTColor4 = clrAqua The text color used in the panel information.
  
Limiting LimitFor = 3 Added Risk Manager: Limits for losses/profits, lots, and number of positions


If you decide to limit losses based on the current magic number, you can configure this in a new block.


Note: This block does not close the deal! It only triggers an alert!
After the next LimitFor, this parameter is reset to 0.


You can also enable sending messages via email and phone when reaching the limits through NotificationMailSend.


Note: This block only prevents the opening of positions from our VirtualTradePad panel and cannot influence or block other Expert Advisors!


Block Limiting has been updated and enhanced!
This settings block allows users to limit profit/loss, lots, number of deals/positions for a specified time period.
A risk manager monitors your trading and notifies you when time limits are exceeded based on current positions/today/week/month/all time.
It is possible to disable the operation of the BUY / SELL / LOCK / REVERSE / BUY STOP / BUYLIMIT / SELL STOP / SELLLIMIT buttons if the limit is exceeded.


Disables the ability to open deals/positions on the current currency pair if the current value exceeds your limit.
Settings::
CurrentOpenDeals – Consider current open deals/positions;
ClosedDeals – Consider closed deals/positions over time:
LimitFor – The time period during which closed deals/positions in the history are checked;
LimitForLosses – The loss limit at which the EA will send a message (must be specified as a negative value);
LimitForProfits – The profit limit at which the EA will send a message;
LimitForLotsDeals – The lot limit for deals/positions at which the EA will send a message;
LimitForCountDeals – The number of deals/positions at which the EA will send a message;
NotificationMailSend – Send a message via phone (PUSH) and email if the limit is exceeded;
ProhibitOpeningNewDealsOrders  – Disables the operation of the BUY / SELL / LOCK / REVERSE / BUYSTOP / BUYLIMIT / SELLSTOP / SELLLIMIT buttons if the limit is exceeded.


Options::
DAY – consider profit and loss for the current day;
WEEK – consider profit and loss for the current week;
MONTH – consider profit and loss for the current month;
ALLTIME – consider profit and loss for all time.




Example::
You need an Expert Advisor to send you an email and display an alert on the screen when the total loss for open and closed deals within LimitFor exceeds -$100:
Your settings would be as follows: LimitFor = 0; LimitForLosses = -100; LimitForProfits = 0;
After reaching a loss of -$100 in the day’s history, the EA will display an alert on the screen and send an email.
LimitForLosses The loss value.
LimitForProfits The profit value.
NotificationMailSend You can also enable sending messages via email and phone when reaching the limits through NotificationMailSend.
How to set up the terminal to send emails
filling TypeFilling = Auto TypeFilling – The type of fill for positions and orders. 
Used for the MT5 terminal. 
In AUTO mode, the Expert Advisor automatically determines the fill type. 
However, in some situations, you may need to set the fill type manually. 


If you encounter an error when opening a position, such as 10030 TRADE_RETCODE_INVALID_FILL, Unsupported execution type, it indicates that the remaining order has an unsupported fill type. 
Set the fill type as per your broker’s rules.


Example: 
FillOrKill
This execution policy means that the order can only be executed in the specified amount. If the market currently does not have sufficient quantity of the financial instrument, the order will not be executed. The required volume can consist of several offers available in the market at that moment. 




ImmediateOrCancel
This means agreeing to execute the order at the maximum available volume in the market within the specified limits. If full execution is not possible, the order will be executed for the accessible volume, and the unexecuted order volume will be canceled. 




Return
This mode is used for market, limit, and stop-limit orders and only in the modes “Market Execution” and “Stock Execution”. In case of partial execution, a market or limit order with the residual volume is not canceled but continues to operate. 
For stop-limit orders, a corresponding limit order with the execution type Return will be created upon activation.

FAQ Question answer about CloseIfProfitorLoss

Our General FAQ

FAQ Answers to the most popular questions

What are the values ​​in the fields for editing in Points or pips?


In points()! The item is taken from the value of the Point () variable of the MQL language.

  1. If you have a 5 \ 3 digit broker, then 1 point = 0.00001 \ 0.001
  2. If you have a 4 \ 2 digit broker, then 1 point = 0.0001 \ 0.01

On the chart there are 2 open positions with lots of 0.1 and 0.2. I see that from the current price to the break-even 50 points, that is, loss is 50 points, and you show -150 points, why?

The calculation in points is correct from our side.

 Therefore, even if you have 2 positions with different lots, the sum of the points of loss will be higher than the distance from the current price and then the break-even points.

The adviser takes into account the calculation of the spread, swap, and commission. Therefore, all calculations and indicators of our adviser take into account many factors.

Let’s take an example:

if 1 order is minus –10 points, then it is –10 points ;

if 2 orders are minus –10 points, then it is already –20 points ;

and if there are 2 orders with different lots, then lot 0.1 gives -10 points, and lot 0.2 gives -20 points and in total – 30 points 

because if you put a close at –50 points, you will have 1 order –50 points, then it will close with a loss of –50 dollars 

but if by your calculation there will be 100 orders there, but the distance is –50 points, then when closing, it will be already –5000 dollars 

It seems to be worth –50 points, and upon closing, the amount can jump from $ 50 loss to $ 5000 and so on

Is it possible to set the trailingprofit to start from the minus zone?


Yes, you can set trailing profit to be triggered from the minus zone

Please set AutoCorrect_LevelCLP  = false in the EA settings

Example:

Loss = -100 USD
Profit = 10 USD
Trailing Profit = 100 USD
Price moves in my direction = +10 USD
New Loss = -90 USD
If the price moves against me, I will have lost 90 USD instead of the initial 100 USD.

                             
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Trailingprofit is ON profitpipstralprofit= 1.999999999998181
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 16.000000000030923
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 17.000000000007276
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 18.000000000029104
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 19.000000000005457
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 22.000000000025466
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 32.00000000001637
Exp - VirtualTradePad EXTRA (XAUUSD,H1) SEPARATE ORDERS 150167924499 Level of Profit is rise profitpipstralprofit= 55.00000000001819
Exp - VirtualTradePad EXTRA (XAUUSD,H1) CLP SEPARATE ORDERS 150167924499 CloseifProfitorLoss Close by profitpipstralprofit = -48.00000000000182 XAUUSD+ All Symbol
Exp - VirtualTradePad EXTRA (XAUUSD,H1) CLP SEPARATE ORDERS 150167924499 CloseifProfitorLoss Close by profitpipstralprofit = -48.00000000000182 XAUUSD+ All Symbol XAUUSD SELL 0.01
Exp - VirtualTradePad EXTRA (XAUUSD,H1) CPBS SYMBOL_FILLING_MODE=3 SYMBOL_TRADE_EXEMODE=1 SYMBOL_EXPIRATION_MODE=15 SYMBOL_TRADE_MODE=4 SYMBOL_TRADE_STOPS_LEVEL=0 SYMBOL_TRADE_FREEZE_LEVEL=0 SYMBOL_ORDER_MODE=127 SYMBOL_START_TIME=0 SYMBOL_EXPIRATION_TIME=0 SYMBOL_SPREAD=19 SYMBOL_SESSION_DEALS=0
Exp - VirtualTradePad EXTRA (XAUUSD,H1) ClosePosition 150167924499 Result = 10009 symbol XAUUSD volume 0.01 action 1 tp 0.0 sl 0.0 type 0 price 2345.55 TRADE_RETCODE_DONE

What is the primary function of the CLP CloseIfProfitorLoss EA?

CLP CloseIfProfitorLoss EA manages the total profit or loss by automatically closing positions and implementing a trailing profit feature to maximize gains.

How does the Trailing Profit function work?

Trailing Profit adjusts stop-loss levels dynamically as profits increase, allowing you to lock in more gains as the market moves in your favor.

What is the Separate Order feature?

Separate Order allows you to manage and close BUY and SELL positions independently based on specific parameters like stop-loss and take-profit.

Can the EA handle multiple symbols?

Yes. You can configure the EA to apply its functions to all symbols in the terminal or restrict it to the current symbol, providing flexibility across different trading pairs.

What is the emergency “Close ALL” button?

The “Close ALL” button allows you to instantly close all open positions, providing a quick exit option in case of unexpected market movements.

How do I activate the CLP CloseIfProfitorLoss function?

Activate the function by pressing the ON button on the control panel. Ensure all required parameters are set correctly for the EA to start managing your trades.

What criteria can be used to close positions?

Positions can be closed based on deposit currency, points (pips), percentage of the account balance, or drawdown levels, allowing versatile risk management.

What is the difference between Trailing Stop and Trailing Profit?

Trailing Stop adjusts the stop-loss for each position individually, while Trailing Profit modifies the virtual stop loss for total profits, allowing overall profit management.

How do I set the Total Loss and Total Profit levels?

Configure the EA to close positions automatically when the total loss or total profit reaches a preset value in dollars, points, or percentages of your account balance.

What is Virtual Stop Loss/Take Profit mode?

Virtual Stop Loss/Take Profit sets virtual levels for closing positions without using real stop-loss orders, allowing the EA to manage closures based on defined criteria.

How do I enable Separate BuySell mode?

Enable the Separate BuySell option to calculate and close BUY and SELL positions independently, offering precise control over each market direction.

Can the EA be used on any trading account?

Yes. The EA is universally compatible with any trading account and can work alongside other advisors or manual trading strategies.

How does the EA handle drawdown?

The EA can automatically close positions when the account experiences a specified drawdown level, effectively managing and mitigating potential losses.

What are the key features of the Control Panel?

The Control Panel offers a user-friendly interface for managing trades, setting profit/loss levels, enabling features like Separate Orders, and monitoring the status of the EA.

How do I configure Trailing Profit in percentages?

Set the Profit% level and the TrailingProfit distance in percentages. For example, set Profit% to 2% and TrailingProfit to 1%, so trailing activates once profit exceeds 2% and adjusts as profit increases.

What happens when Trailing Profit is activated?

When Trailing Profit activates, the EA sets a new closing level based on the trailing distance. If profit drops below this level, all positions are forcibly closed to secure gains.

How does the EA display the status of Trailing Profit?

Indicators on the control panel show green when Trailing Profit is active and red when it is turned off, providing a quick visual status of the function.

Can I customize the EA settings externally?

Yes. By enabling VPS_CLP_Activation, you can manage closing functions through external variables, allowing customization without using the internal control panel.

What should I do if the profit field flashes red?

If the profit field flashes red, it indicates an error with the set value. Ensure that profit values are set above 0 and correct any negative inputs as the EA requires positive values for profits.

How are virtual stop lines displayed?

Virtual stop lines for future position closures are shown on the chart when Show_Future_BE_TP_SL is enabled, providing visual cues for potential closing points.

Is there a difference in handling BUY and SELL positions?

Yes. With the Separate BuySell feature, the EA monitors and closes BUY and SELL positions independently, ensuring precise management for each direction.

How does the EA manage positions on a VPS server?

When VPS_CLP_Activation is enabled, the EA manages closing functions via external settings, as MetaQuotes restricts sending global variables to the VPS server from MQL.

What should I do if positions form a lock and lines are not shown?

If lines are not shown, it may indicate that positions are forming a lock and cannot be closed by the total profit or loss. Ensure that Separate Orders mode is configured correctly.

Can the EA work alongside other Expert Advisors?

Yes. The EA is designed for universal use and is compatible with other advisors or manual trading strategies, allowing seamless integration into your trading setup.

How does the EA handle errors in profit and loss settings?

The EA automatically corrects errors by converting negative profit values to positive and vice versa for loss values. If values are set to 0, the fields will flash red, indicating an error.

What information is displayed on the control panel?

The control panel displays the current condition of your positions, including profit/loss levels in dollars, pips, and percentages, as well as the status of active functions like Trailing Profit.

How do I set virtual take profit and stop loss?

Enable Virtual Stop Loss/Take Profit by selecting Separate Deals, setting the desired Profit and Loss values in dollars, pips, or percentages, and activating the CLP ON option on the control panel.

Are there video tutorials available for using the EA?

Yes. The article includes examples of use presented in pictures and videos, demonstrating how to configure and operate the EA effectively.

Changelog CLP CloseIfProfitorLoss

Version 24.426 2024.04.26

– CLP tab: with AutoCorrect_LevelCLP = false, you can work with negative trailing profit!
You can set trailing profit to be triggered from the minus zone.

Please set AutoCorrect_LevelCLP = false in the EA settings.

Example:
Loss = -100 USD
Profit = 10 USD
Trailing Profit = 100 USD
Price moves in my direction = +10 USD
New Loss = -90 USD
If the price moves against me, I will have lost 90 USD instead of the initial 100 USD.

Version 24.419 2024.04.20

– Optimization of the “Show Profit on History” function
– Added CLP tab settings to the Trade Pad external parameters.
Because MetaQuotes prohibits sending global variables to the VPS server from MQL (MetaQuotes), all buttons, checkboxes, edit fields, and controls on the Trade Pad panel no longer work on VPS from MQL (MetaQuotes).
You can customize the function of closing by total profit or loss from the external settings of the Utility:
Attention! If the VPS_CLP_Activation parameter is enabled (true), then All settings for this function will work from external variables!
Objects on the CLP tab – will be inactive!

e05vps=”================= VPS MQL5 CLP options ==================”;//———————————————————————————————————
VPS_CLP_Activation=false;//VPS_CLP_Activation –> CLP activation for VPS
VPS_CLP_AllSymbols=false;
VPS_CLP_CurrentSymbol=false;
VPS_CLP_SeparateBUYSELL=false;
VPS_CLP_SeparateDEALS=false;
e060=”===================================”;//———————————————————————————————————
VPS_CLP_Profit_Currency=false;
VPS_CLP_Profit_Currency_amount=0;
VPS_CLP_Profit_Pips=false;
VPS_CLP_Profit_Pips_amount=0;
VPS_CLP_Profit_Percent=false;
VPS_CLP_Profit_Percent_amount=0;
e061=”===================================”;//———————————————————————————————————
VPS_CLP_Trailing_Profit_Currency=false;
VPS_CLP_Trailing_Profit_Currency_amount=0;
VPS_CLP_Trailing_Profit_Pips=false;
VPS_CLP_Trailing_Profit_Pips_amount=0;
VPS_CLP_Trailing_Profit_Percent=false;
VPS_CLP_Trailing_Profit_Percent_amount=0;
e062=”===================================”;//———————————————————————————————————
VPS_CLP_Loss_Currency=false;
VPS_CLP_Loss_Currency_amount=0;
VPS_CLP_Loss_Pips=false;
VPS_CLP_Loss_Pips_amount=0;
VPS_CLP_Loss_Percent=false;
VPS_CLP_Loss_Percent_amount=0;

Version 24.124 2024.01.24

Compilation in the latest terminal build.
Long Ticket Number: Fixed CLP Trail Profit error when working with brokers with long ticket numbers.

Version 23.913 2023.09.18

——————————
-Last Build Compilation
-EAPADPRO v44

Version 22.111 2022.01.12

Update repeat

Version 22.110 2022.01.12

Исправлекна ошибка рисования объектов для новых версий терминала MT5

Version 21.956 2021.11.14

Code optimization and General improvements and bug fixes as reported by users.

Version 20.952 2020.10.22

– Added parameter to CLP (Closing on total profit and loss) settings:
— CPL_CloseAllCharts_per_CloseAllDeals = close charts / other charts before closing positions.
— This parameter allows us to solve the problem when our panel begins to close positions upon reaching the total profit or loss, and in the meantime, other experts simultaneously begin to open new positions.
— The CPL_CloseAllCharts_per_CloseAllDeals parameter closes only those charts on which other Expert Advisors are installed (except for VirtualTradePad) only for MT5.
— The CPL_CloseAllCharts_per_CloseAllDeals parameter closes All charts (When All Symbols is enabled) or only those with a chart symbol = VirtualTradePad symbol.
— The CPL_CloseAllCharts_per_CloseAllDeals parameter saves chart templates before closing them! The template can be downloaded later. Template name: VTP_Symbol_Period_Name of the expert (only for MT5).
Important:
— In MT5: Only those charts on which the Expert Advisor is installed are closed in MT5

Version 20.608 2020.06.08

Перекомпиляция 2485

Version 20.423 2020.04.23

-In the CLP_Alert CLP_Push Notification, the name of the currency pair with which the program works has been added.
-In the CLP_Alert CLP_Push Notification, the name of the currency pair, position type and lot of the closed position are added.

Version 20.206 2020.02.09

=================================================== =====================================
— Added opportunity to use Expert Adviser on Forex VPS for MetaTrader 4/5 from MetaQuotes
It works on any chart. Supports multiple chart at once!
Tabs work: CLP, TrailinStop, Signals!
Before changing the variables on your computer:
1. Enable AutoTrading to make the Expert Advisor active.
2. change the parameters,
3. After that, start the Migration!
=================================================== =====================================
– Added Risk Manager: Risk Manager Limiting losses / profits / Lots / Numbers
Block Limiting updated and supplemented!
This settings block allows users to limit Profit / loss / lots / number of deals/positions for a specified time.
A risk manager who monitors your trading and notifies you that the time limit has been exceeded with Current positions / today / week / month / all the time.

Settings:
CurrentOpenDeals – Take into account current open deals/positions;
ClosedDeals – Take into account closed deals / positions over time:
LimitFor – The time during which closed deals / positions in the history will be checked;
LimitForLosses – Loss limit at which the EA will sent a message, must be specified with -;
LimitForProfits – Profit limit at which the EA will sent a message;
LimitForLotsDeals – Limit of Lots of deals / positions, at which the adviser will sent a message;
LimitForCountDeals – Limit of the number of deals / positions at which the EA will sent a message;
NotificationMailSend – Send a message to the phone (PUSH) and mail if the limit is exceeded;

Version 20.129 2020.01.29

Исправлено завсиание при сворачивании

Version 20.127 2020.01.27

TesterHideIndicators

Version 20.125 2020.01.27

— Forced writing global variables to disk.
— Color of TrailingStop and CLP in the ON mode – is changed to green.
– The version for the MetaTrader 5 terminal now can use scrolling (on the mouse):
If you hover over the field for editing the parameter (lot, stop loss, take profit, distance, CLP), then when scrolling with scrolling, you can increase or decrease the value in this field!
Note: Only for MetaTrader 5!
Note: Scrolling of the chart is disabled if the cursor is on the area of our VIRTUALTRADEPAD panel and is enabled if the cursor is outside the VIRTUALTRADEPAD area.

Version 20.110 2020.01.10

Added CLP: New parameter Use_Commission_in_CLP – Use calculation of commission when closing positions.
true – take into account the commission in the calculations.
false – do not take into account the commission in the calculations.
Attention: The commission is calculated from an open deal and multiplied by 2 (When closing a deal a commission is also charged)
This is the standard way to calculate commission!
In MetaTrader 5, it is impossible to get the type of commission calculation from an adviser!
If you do not want the adviser to automatically calculate the commission, you can turn off this feature!
Attention! This function only affects the calculations on the CLP tab, all other tabs work in standard mode, taking into account commissions.

Version 19.992 2019.12.15

CLP – Обновлен расчет прибыли для CFD, Index

Version 19.991 2019.12.02

CLP: Fixed display of future levels (Show_Future_BE_TP_SL) for BUY positions.
CLP: The Show_Future_BE_TP_SL function has been added to show future profit / loss lines when closing is selected as a percentage of the current balance.
CLP: Added a new parameter to the “CLP options” section:
ClosebyFIFO = Closing positions according to FIFO rules;
When closing positions, the FIFO rule will be used (First opened, First closed).
The position will be closed in the order of their opening!
Attention: This rule is intended to be used only when working with all symbols and closing all positions at once.
Attention: This mode prohibits the use of functions: Separate Deals

Version 19.830 2019.08.31

Update for Separate Order

Version 19.824 2019.08.26

Fixed Virtual CLP error when the list of orders was not updated.

Version 19.701 2019.07.06

– A new parameter has been added to the function “Closing by total profit or loss”:
ClosingCurrentTicketOnly – Close only the current list of tickets.
This option will help to avoid problems when my program starts to close positions on the basis of total profit, and the user’s adviser starts to open new positions.
ClosingCurrentTicketOnly = true, Then the VirtualTradePad program, if the total profit conditions are met, will close the current list of positions. If new tickets are added to the list of positions, the VirtualTradePad program will ignore them.
ClosingCurrentTicketOnly = false, Then the VirtualTradePad program, if the total profit conditions are met, will close all positions, even if another adviser opens new positions.

Version 19.228 2019.02.26

Fixed a percentage value profit on the CLP tab when the user did not press Enter to save parameters.

Version 19.226 2019.02.26

Общие улучшения

Version 19.211 2019.02.11

Fixed the error of moving the graph when the panel is minimized!

Version 19.206 2019.02.06

– In the CLP block, when closing positions by profit in points, the profit in the deposit currency will be additionally checked.
Actual when closing positions with different volume of lots.
If the adviser can close positions by profit in points, but the profit in the deposit currency is less than 0, then the adviser will not close the position, but will wait for the positions to gain profit in the deposit currency> 0.
– Text labels with information about open positions are reduced, to save space.
– Cosmetic enhancements.

Version 19.201 2019.01.30

Global Update 2019
– Improved graphics part of the panel. Re-design of individual elements;
– Added the ability to resize the panel: GeneralSize!
– GeneralSize default = 12, Increasing the size of the panel.
– Last panel size with GeneralSize = 10!
– Text labels of open positions optimized. Fixed error when text labels were drawn on top of the VirtualTradePad panel;

Version 19.121 2019.01.21

Some graphical changes.

Version 19.114 2019.01.17

Global Update 2019:
– When using CLP_DeleteStopOrders = true and the CloseALL buttons, the choice of characters to close is taken into account (All symbols, only the current one);
– Added hints to external variables when setting up the program;
– Added language selection tips Language: Spanish, Portuguese (Brazil), German, Chinese, Japanese;
By default, the language of prompts will be determined automatically by the language of your terminal. You can also choose your language;
The translation was made using the GOOGLE Translator + MQL + Terminal site!
If you find an error in your language, please report it in messages. Thank!
– Parameter and function Sounds replaced by a more advanced function from our EAPADPRO
Added new parameters:
Notice_Open_Push = false;
Notice_Open_Sound = true;
Notice_Close_Push = false;
Notice_Close_Sound = true;
Notice_Modify_Push = false;
Notice_Modify_Sound = true;
Notice_Error_Push = false;
Notice_Error_Sound = true;
Notice_Open_NameSoundFromEa = “ok”;
Notice_Close_NameSoundFromEa = “alert2”;
Notice_Modify_NameSoundFromEa = “stops”;
Notice_Error_NameSoundFromEa = “timeout”;
You can enable / disable sound when opening, closing, modifying, error, as well as specify the name of the sound file (without .wav)
You can also enable notification to the phone (PUSH messages) when opening, closing, modifying, an error.
Additional information is displayed in the log.
– The ShowInfoPosition function has been updated; now the position information on the chart will not overlap our panel. Dynamic change of coordinates of information data on a chart.
– Font name changed to Roboto

Version 18.945 2018.10.18

The parameters of the number of attempts to close and open positions using one-click trading are added in external variables:
NumberTryClose – The number of attempts to close a position.
When receiving an error from the server, the adviser tries to open / close.
Required with frequent requotes.

CLP Activation (Close if Profit or Loss Activation) Changed!
ON OFF buttons are added to the panel for more understandable action!

Version 18.932 2018.10.01

– Added support for the work of the Expert Advisor and the CLP tab (Closing on Total Profit or Loss) on VPS hosting from MetaQuotes.

Version 18.515 2018.05.23

– Fixed the error with profit trailing and closure at a loss, which occurred when using the closing on all symbols.

– Added a variable for specifying the currency pair for the panel to work with: SymbolToTradeCustom
This allows working on offline charts (Tick charts, Renko charts, etc.).
Attention: Be careful when writing the name. The name should exactly match the name in the Market Watch!
EurUSD – incorrect!
EURUSD – correct!
If this parameter is not set, the EA works on the currency pair it is attached to.

– Added the ability for Magic Target to work on an offline (Tick, Renko…) chart.

– Added the indication of the feature operation to the CLP tab.
If the indication is red, the feature is disabled and does not work;
If the indication is green, the feature is enabled and working.

Version 18.309 2018.03.14

Fixed an error in the Close ALL button.

Version 18.227 2018.03.06

– Added support for font scaling in Windows (font size settings are not available);

– Added support for multiple magic numbers. Updated the MagicNumber parameter: the first number denotes the magic number for opening positions and management. It is also possible to set multiple magic numbers to be managed;
For example:
— MagicNumber=777 UseAllMagicFromAllAccount=true: the EA monitors all positions on the current symbol and on the entire account;
— MagicNumber=777 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic number 777 on the current symbol and on the entire account;
— MagicNumber=777,888 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic numbers 777 and 888 (opens positions with the magic number 777) on the current symbol and on the entire account;
— MagicNumber=777,888,999 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic numbers 777, 888 and 999(opens positions with the magic number 777) on the current symbol and on the entire account;

– When a new object appears on the chart, the panel is refreshed to avoid overlapping of objects on the panel;

Version 17.979 2017.12.12

Cosmetic changes.

A new parameter has been added: CPL_AUTOOFF_AfterClose allows disabling the “Close if profit or loss” button after closing all positions.
The button is only disabled when ALL! positions are closed.
It takes into account the magic number specified in the EA, as well as the symbol for closing.
If closing only 1 currency is selected and the CPL_AUTOOFF_AfterClose parameter is enabled, the EA waits for all positions on the given currency pair to be closed, and can disable the button only after that!

BugFix: Fixed dragging of trade levels (Stop Loss, Take Profit) when hovering over the panel and back.

Version 17.970 2017.11.13

In the EA settings, changed the option for closing the terminal after all trades are closed.
Parameter CPL_CloseTerminalAfterClose – enable closing the terminal.
CPL_CloseTerminalAfterClose = true.
Terminal is closed only when ALL! positions are closed.
It takes into account the magic number specified in the EA, as well as the symbol for closing.
If closing only 1 currency is selected. If the CPL_CloseTerminalAfterClose parameter is enabled, the EA waits for all positions on the given currency pair to be closed, and cab close the terminal only after that!

Added the Show_Future_BE_TP_SL parameter to CLP – show the lines of the future position closure by total profit or loss.
Attention: it works only on the current symbol and with the ‘SEPARATE Orders’ mode disabled.
The lines are displayed separately for Buy and Sell positions, or by a common line.
If a line is not shown, then the positions form a lock that cannot be closed by the total profit or loss.
Note: line and price data may be inaccurate for floating spread.
Remember! SELL is closed by ASK, while BUY is closed by BID

Profit trailing can now be enabled only after setting the parameters for closing by profit.

Added the profit trailing values on the CLP panel near the input box for the distance of Trailing Profit. The value appears when the trailing level is fixed by the EA and shows the fixed level for closure.

Added block of alerts for profit and loss in the deposit currency.
If you want to limit the losses on the current client magic number, you can do that in the new block.
For example: you need the EA to send you emails and display on-screen alerts when the total loss of open and closed trades within LimitFor becomes less than -100 USD:

Set the parameters to the following:
LimitFor=0;
LimitForLosses=-100;
LimitForProfits=0;

After receiving the daily loss of -100 USD in history for the given magic number, the EA displays an on-screen alert and sends an email.
Attention: this block does not close trades! It simply displays alerts!
At the next LimitFor, this parameter is reset to 0.

You can select LimitFor= DAY;WEEK;MONTH;ALLTIME;
You can also enable sending email and push notifications when reaching the limits of NotificationMailSend

To the CLP panel for closing by profit or loss, added a block of notifications when closing positions by profit or loss. 3 notification methods are available:
CPL_AlerT – alert message
CPL_Mail – email message
CPL_Push – push notification
How to set up mobile device or email to messages from the Expert Advisor:
https://www.metatrader4.com/en/trading-platform/help/setup/settings_notifications
https://www.metatrader4.com/en/trading-platform/help/setup/setup_email

the MagicOrderToClose parameter has been replaced by 2 parameters:
MagicNumber – unique magic number of positions to close.
UseAllMagicFromAllAccount:
true = apply the function of closing by total profit or loss to all magic numbers.
false = set the unique magic number for closing positions in the MagicNumber parameter.

Version 17.504 2017.05.11

– Fixed the error with the display of fractional numbers on the CLP panel: when entering fractional numbers in the fields Dollars, Percents and Profit trailing

Version 17.118 2017.01.24

Fixed operation with long tickets

Version 17.105 2017.01.13

-Added parameter Use_Lots_in_CLP_Points for working with the CLP tab – true – the EA will also consider the lot of those positions during calculation of profit points. This option can be useful in trading on a hedging account with different lots.

For example:
opened 2 SELL positions on EURUSD
SELL 0.01 with profit of 20 and 0.2 USD
SELL 0.02 with loss of -12 points -0.24 USD

-If Use_Lots_in_CLP_Points = false the EA will calculate the “net” points.
In this case, the Profit will be: -0.04 USD or 8 points.
As we can see, the position gained profit in points, but it is a loss in USD.

-If Use_Lots_in_CLP_Points = true the EA will calculate points with consideration of lots.
In this case, the profit will be: -0.04 USD or -4 points.
If calculation of profit is in points and the “Include lots in profit calculation” is enabled,
the EA will find the minimum lot of the provided positions and calculate the Points on that basis.
For example:
Minimum position 0.01, 1 “net” point = 1 point,
If a position is opened with a lot of 0.02, then 1 net point = 2 points with consideration of the lot.
If a position is opened with a lot of 0.05, then 1 net point = 5 points with consideration of the lot.

-Added checking of the input values for closing profit or loss:
If the specified profit is lower than the current – system generates a warning and disabled the closure mode.
If the specified loss is greater than the current – system generates a warning and disabled the closure mode.
If set to 0 and user attempts to enable closure – system generates an error.
-Added the AutoCorrect_LevelCLP parameter:
Only negative values can now be entered to the loss field. If user enters +10, the system automatically converts it to -10.
Only positive values can now be entered to the profit field. If user enters -10, the system automatically converts it to +10.

Only a positive value can be entered in the CLP_TralOptions, otherwise the EA generates an error.

-Added the SEPARATE Orders option to the CLP panel for separate calculation and deletion of each position.
“Virtual Stop Loss and Take Profit” mode.
For example, if you set closure by loss to $ -5 and closure by profit to 100 points, each trade will be closed separately by a loss of $ -5 or by profit of 100 points.

-Added the Separate BUYSELL option to the CLP panel, which allows to calculate a close positions by the net profit or loss separately for BUY and for SELL.

Version 16.930 2016.10.03

Updated the algorithm for working on hedging accounts
Fixed the error in the TrailingProfit edit box

Version 16.128 2016.02.01

Added the function to save the settings during the terminal reboot, the change in settings inside the panel, when closing the panel on the chart and attaching the panel to the chart.
All variables and data changes made in the panel are now saved when the terminal is restarted.
If you turn off the terminal and turn it on again – all the parameters will be re-loaded from the global variables.

Added the TrailingProfit function to the CLP tab:
Trailing Stop at Closing.
A new function for trailing profits has been implemented on user demand. In this case, the profit is fixed with some correction. As soon as the profit reaches the specified value, the Expert Advisor saves the current profit level and starts trailing the profit.

For example:
If you made settings for closing at the profit of 10 dollars:
Profit $ – positive closing.
Profit $ – value of positive closing.
TrailingProfit- distance from Profit $, which, when reached, triggers trailing of profit.
If Profit $ is set to 10 and TrailingProfit is set to 5 the Trailing Stop will be set at 5 dollars. The Trailing Stop will come into play when the Expert Advisor passes the 10 dollar line and start moving following the profit. The Journal will show entries about the current profit status.
When the total profit falls below the last fixed level, TrailingProfit, the Expert Advisor will perform forced closing of all position.

The function works for all closure types: Every symbol, Current symbol, Separate BUY and SELL direction, Each order separately.

Version 15.923 2015.09.24

Fill policy parameter has been added to the external parameters:
TypeFilling=FillOrKill

FillOrKill
This fill policy means that an order can be executed only with the specified volume. If the required volume for a given financial instrument is currently unavailable in the market, the order will not be executed. The required volume can be filled using several offers currently available in the market.

ImmediateOrCancel
This means that a trade will be executed with the maximum volume available in the market within the value indicated in the order. In case entire order volume is not available in the market at the moment, a partial fulfillment is possible, but any portion that cannot be filled immediately is canceled.

Return
This fill policy is used for market, Limit and Stop Limit orders and only in the Market Execution and Exchange Execution modes. In case of partial filling a market or Limit order with remaining volume is not canceled but processed further.
When a Stop Limit order triggers, a relevant Limit order will be placed with the Return fill policy.

Version 15.116 2015.01.16

In case of incorrect settings, the Close button will be disabled and an error will be returned to the user.

Version 15.112 2015.01.13

Added check of input data before the start of algorithm operation. Protection against incorrect settings.
For example, if you specify the loss of more than the current one – the system will not allow you to perform the algorithm. Since the positions must be closed immediately.
For example: You have indicated close loss at 2 dollars. Currently loss is -3 dollar. This means that you obviously specified closing level below the current one. And the system will immediately close the position.
In this version, the system returns an error and asks you to enter another value.

If your сurrent loss is -5 dollars, you can set the loss value only -5.1 or below.

If you have a current profit of $10 and you want to set it to $5 – the system will return an error. You can set the value for locking the profit only above the current profit. For example, $11.

Reviews about CLP CloseIfProfitorLoss

Brandon Thames

⭐⭐⭐⭐⭐


Works as intended.

rafaelmercadop

⭐⭐⭐⭐⭐


I can't thank Vladislav enough for their tool and their patience in upgrading it to meet my needs. They were incredibly helpful and professional throughout the process. Thank you so much for your assistance!
Vladislav Expforex
Reply from ExpForex:
Thank you 😊

Max

⭐⭐⭐⭐⭐


Max
Amazing product, works very well and neat, what I was looking for and also have other his other products like full trade pad, good producer, many detailed functions buttons on chart and also in settings!

Atila R Akdeniz

⭐⭐⭐⭐⭐


Atila R Akdeniz
Excellent Tool, very useful to do operations on the termial. All of Vladislav's products are of excellent quality, and he provides very good support. With the current prices it's a good time to buy all his products.

wingliu27

⭐⭐


wingliu27 2023.11.24 00:07
I have install ea, but why my ea didn’t have close all button ? Please help .Thanks
Vladislav Andruschenko
Reply from developer Vladislav 2023.12.13 10:23 
You can enable this button in the EA settings
 

lorrenzs

⭐⭐⭐⭐


lorrenzs 2023.05.29 03:06 # RU Thanks for your response. Once again this ea is the best ea ever made in my opinion but one critical feature is missing, let me explain. I make a series of trades or just one trade, I hit a profit of $100 for example, now I want to place my trailing profit between 15% to 20% of my profit (not my balance and not my equity, just my profit alone). Now I set my trailing profit at 17.5% of my profit, meaning the profit will trail by $17.5 but as i keep getting more profit the value of the 17.5% keeps changing. For example if profit still rises from $100 to $150 my new trailing profit value would be $26.25. Immediately the trade begins to move in the loss direction it activates the most recent stop loss value and closes the trade if it falls to that value but throughout the trade 17.5% of my total profit was used in trailing my total profit. It has been rigorously proven that a trailing profit of 15% to 20% of the total profit itself is the most profitable take-profit strategy, taken from a sample of 50 years of trading pool, the article supporting this findings can be found online, that is why I am using 17.5% as my trailing profit exit strategy in the example. Also you asked if I am requesting for a new feature, the answer is yes, please make this new feature available, I am pleading. Feature: TRAILING PROFIT IN PERCENTAGE OF TOTAL PROFIT. Thanks for your kind understanding . I gave it 4 stars for now, 5th star after update, thanks in advance.

Vadim V.

⭐⭐⭐⭐⭐


Vadim V.
Hi, I bought Profit or Loss Pad 1 month ago and run it on MT5 and it worked OK. I found the EA very helpful and bug fee in work that helps me to scalp not looking when I need to get out. EA that good tool. 5 stars to Vlad.

Terek

⭐⭐⭐⭐⭐


Terek
купил сразу как нужен был equity trail, потому что все продукты от данного производителя высшего качества. будем посмотреть. функционал вроде не плохой. но сразу бросается в глаза притормаживающее отображение профита на панели, нельзя ли его ускорить как то? еще не нашел функцию отключения кнопки автоторговли после закрытия, но это не так важно. главное что бы equity trail работал.

Stan Baftalovskiy

⭐⭐⭐⭐⭐


Stan Baftalovskiy
Отличный продукт, мне понравился!

Gregory Knobloch

⭐⭐⭐⭐⭐


Gregory Knobloch
Awesome Products from this vendor

Agnaldo Prata

⭐⭐⭐⭐⭐


Agnaldo Prata
Awsome tool, it makes risk management a lot easyer, thanks to the developer, good job.

thrzk01

⭐⭐⭐⭐⭐


thrzk01
It's excellent toll for multi entry trading management(brake even T/P with profit you want in Long/Short Separately).

emat

⭐⭐⭐⭐⭐


emat
Very good product.

rvstrade

⭐⭐⭐⭐⭐


rvstrade
exactly what I needed. great tool. recommended. A+ product and seller.

Agnaldo Prata

⭐⭐⭐⭐⭐


Agnaldo Prata 2020.05.11 14:56
Excellent toll, I have been looking for a good trade manager EA for long time and now I found it, I have been testing it on my live account and it works like a charm.Thanks for the developer, great job done!

Saitama

⭐⭐⭐⭐⭐


Saitama 2020.03.24 08:25
Very great EA and Vladislav is very helpful and responsive with prompt reply to my questions.

spetrosyan1979

⭐⭐⭐⭐⭐


spetrosyan1979 2020.02.25 20:35
Полезный помощник. Не стал мелочиться, купил сразу. Окупился при первом же запуске )) Спасибо.

Konstantin Zharitov

⭐⭐⭐⭐⭐


Konstantin Zharitov 2020.01.15 10:01
Best 30 bucks investment on the market! Thanks for the great product!

Vasil lupanov

⭐⭐⭐⭐⭐


Vasil lupanov
For the good expert 5 gold stars !!! For the designer and the man who created it, 10 gold stars. Thank you my friend !!!

Maik Siebel

⭐⭐⭐⭐⭐


Maik Siebel 2019.08.28 07:32
User didn't leave any comment to the rating

Phoutsamay Tonmany

⭐⭐⭐⭐⭐


Phoutsamay Tonmany 2019.08.10 09:10
this is great product that help you to discipline your trading strategy. 🙂

Wolfgang Rockert

⭐⭐⭐⭐⭐


Wolfgang Rockert 2019.07.02 14:18
Very useful, works combined with other EAs, great work!!!

empol


empol 2019.08.02 12:41
It doesn't work for me, I don't see all the buttons, I can't open the store from the app.

pllm2708

⭐⭐⭐⭐⭐


pllm2708 2019.04.25 10:01
Dear Vladislav, Just purchased this EA a few hours ago and I am already thoroughly enjoying all the rich features. It is really value for money for only $30.00. It is almost everything that I have been looking for EXCEPT the fact that the EA does NOT delete any of the pending orders after the pre-set profit level has been reached. As my EAs trade in a cycle and needs to restart a fresh cycle after the closing of the on-going cycle and the fact that my EAs will only restart a fresh cycle upon all the pending orders being deleted - as a result, all the pending orders which were not deleted are being triggered now and my EAs would just continue to trade the just closed cycle as if nothing had happened. This obviously defeats the whole strategy employed by my EAs. So Vladislav, can we have an urgent update of the EA to include the deletion of ALL the pending orders of the same symbol when the pre-set TP or SL is reached??? The EA would be perfect if you could do that. Also, it would also be an excellent idea if the EA can somehow instruct all the EAs under its management to restart afresh every time when the pre-set TP or SL is hit/reached. If the above two suggestions could be implemented, the EA would really be PERFECT! So, for now, 4 stars only. sincerely, Philip Lee Update I wrote the above review less than 1 hour ago and Mr Vladislav PM me immediately to point out to me that there is already an option in the settings to choose whether or not to delete all pending orders - and I have just tried it and can confirm that there is an option to delete all pending orders. this is BRILLIANT, I really think this EA is all that one could ever ask for in as far as this kind of utility EA is concerned - it has everything and it works beautifully. I highly recommend this EA - this is a real no brainer - for only $30 - go ahead and buy it immediately, no need to think twice. Updated my rating to full 5 stars. Simply BRILLIANT!

Mahen Weerakkody

⭐⭐⭐⭐⭐


Mahen Weerakkody 2019.04.09 05:45
Excellent utility

adam7samuel

⭐⭐⭐⭐⭐


adam7samuel 2018.11.07 18:57
thank god to meet you !

Kin Hung Chow

⭐⭐⭐⭐⭐


Kin Hung Chow 2018.08.22 03:50
Very good Utilities. But I have a problem that MT4 doesnt close after stop out even I set the close terminal to "true". Any ideas for reason?

Staffan Ofwerman

⭐⭐⭐⭐⭐


Staffan Ofwerman 2018.04.26 09:59
This is just what I've been looking for. A great tool and it works fine. I had some trouble with understanding some of the settings, but finally I got it right. And the seller is really, really helpful. Impressive.

Tung Shan Hui

⭐⭐⭐⭐⭐


Tung Shan Hui 2017.12.24 16:22
Great Job! It's useful.

60012345

⭐⭐⭐⭐⭐


60012345 2017.12.21 19:12
Работает и помогает. Нужный инструмент в арсенале трейдера.

To Pui Kuen

⭐⭐⭐⭐⭐


To Pui Kuen 2017.11.11 02:55
This utilities is extremely useful. Great job for Author !

Aslan Khuzmiev

⭐⭐⭐⭐⭐


Aslan Khuzmiev 2017.10.18 16:25
отличный продукт

ropeganika

⭐⭐⭐⭐⭐


ropeganika 2017.10.15 07:47
The author is really helpful!

ericcheungtakyu

⭐⭐⭐⭐⭐


ericcheungtakyu 2017.10.08 06:15
Great tools! the author is very helpful thanks

Manea Marian

⭐⭐⭐⭐⭐


Manea Marian 2017.02.24 14:53
Work great

Валерий Булеев

⭐⭐⭐⭐⭐


Валерий Булеев 2017.02.06 10:51
Еще один отличный продукт от этого программиста! Спасибо! Необходимый инструмент для контроля прибыльности и убыточности сделок, использую как дополнение к своему советнику. Очень хорошо работает поддержка, приятно работать с такими людьми, еще раз спасибо!

DAVID DE CABO


DAVID DE CABO 2016.12.22 03:22
EA's do not stop when operations are closed. I am very upset because this robot does not work as described

Bambang Arief

⭐⭐⭐⭐⭐


Bambang Arief 2016.12.14 14:12
This tool is very important and useful, like Master that teach how to become a discipline trader. >>Version 16.990 - 2016.12.13>> works for ECN account and count swap fee (if any)

Ikechukwu Emmanuel Okaro

⭐⭐⭐⭐⭐


Ikechukwu Emmanuel Okaro 2016.06.29 06:05
This is a very important tool in any serious trader's arsenal. 5 stars!

Victor Epand

⭐⭐⭐⭐⭐


Victor Epand 2016.02.28 20:41
This EA can be very useful when combined with other EAs to set the desired minimum drawdown in % of balance at which time all positions will be closed.

Mark Huggett

⭐⭐⭐⭐⭐


Mark Huggett 2016.02.20 01:25
Thank you, Vladislav. You have done a very nice job developing this application. It closed a position perfectly yesterday at my intended profit.

bsandaruwan

⭐⭐⭐⭐⭐


bsandaruwan 2016.01.17 15:16
Before talk about the EA I like to talk about Author He is the best Author I saw in Mql5 His service 5star for me. Very kind and honest person Always response with very patient & professional way with his Knowledge. Profit or Loss Ea very useful for me. Its work very well with all currency pairs. Extremely happy with Ea Thx Lot Vladislav for your nice EA’s and 5 star Service.

Frederic Fachard

⭐⭐⭐⭐⭐


Frederic Fachard 2015.05.26 18:37 # RU I bought this product in january 2015. I'm happy with it 🙂 It really makes what he is supposed to ! It can close order(s) for a specified symbol OR ALL orders Setting of the targets (win and/or loss) are easy to setup (in account currency and/or points and/or % of balance) Hint : About setting the targets in "loss", don't forget to ADD THE MINUS SIGN BEFORE THE VALUES 😉 For example, if you enter positive value (without the minus sign) on "Loss $" field, the order may be immediately closed ! In loss section, you have to enter "-5.00" if you want the order to close when your loss reached USD 5.00 ... Things that could be enhanced : - When market is fast moving, the EA have some difficulty to follow... (the target may be reached for a flash moment and sometimes the EA miss it...) - Maybe an alert by email and/or push when the EA closes some order with details about what have been done. All in all, thank you for this nice product 🙂

Alexey Lushnikov

⭐⭐⭐⭐⭐


Alexey Lushnikov 2015.04.09 22:38
Спасибо. Хорошая программа для контроля просадки и общей прибыли

Giovanni Pascoli

⭐⭐⭐⭐⭐


Giovanni Pascoli 2014.04.24 19:01
Very good expert. Thank you.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

5 responses to “CLP CloseIfProfitorLoss with Trailing. Control of the total profit or loss with profit trailing.”

  1. Fredrick Kenyon Avatar
    Fredrick Kenyon

    Thanks for the utility, I really like it

  2. Expforex Vladislav Avatar

    Français : CLP : Fermeture sur profit ou perte + Fonction de Trailing Profit
    https://www.youtube.com/watch?v=J1feTxvPUuk

    Guide complet : https://www.expforex.com/?p=78
    💎 CloseIfProfitorLoss MT4 : https://www.mql5.com/fr/market/product/2945
    💎 CloseIfProfitorLoss MT5 : https://www.mql5.com/fr/market/product/872

    Marques de temps :
    00:00 Aperçu
    01:53 Installation
    02:44 Fermeture sur profit total
    03:18 Fermeture sur perte totale
    03:50 Fermeture avec Trailing Profit
    04:45 Fermeture de tous les symboles avec Trailing Profit
    05:41 Fermeture des positions séparées avec Trailing Profit
    06:42 Exemple de VirtualTradePad

    L’EA permet de fermer les positions dans MetaTrader lorsqu’un profit ou une perte totale est atteint, en utilisant la fonction de Trailing Profit.

    Principales caractéristiques :

    Vous pouvez activer les arrêts virtuels (Ordre séparé).
    Calculer et fermer les positions d’achat et de vente séparément (Achats et Ventes séparés).
    Fermer et calculer pour tous les symboles ou uniquement le symbole actuel (Tous les symboles).
    Activer le Trailing Profit (Profit suiveur).
    Fermer à l’atteinte d’un profit ou d’une perte totale dans la devise du dépôt, en points (Pips) ou en pourcentage du solde.

    Mots-clés : Vladon, Expforex, CLP, CloseIfProfitOrLoss, Fermeture sur profit, Profit total, Fermeture sur profit ou perte, Trailing Profit, Stop suiveur intelligent, MetaTrader, MT4, MT5, Trading automatisé, Expert Advisor, Stops virtuels, Gestion des risques, Protection des profits, Stratégie Stop-Loss, Trading Forex, Fonction de Trailing, Signaux de trading, Outils de trading, Plateforme de trading.

  3. Expforex Vladislav Avatar

    Deutsch: CLP: Schließen bei Gewinn oder Verlust + Trailing-Gewinnfunktion
    https://www.youtube.com/watch?v=YD6UFvGS82M

    Vollständige Anleitung: https://www.expforex.com/?p=78
    💎 CloseIfProfitorLoss MT4: https://www.mql5.com/de/market/product/2945
    💎 CloseIfProfitorLoss MT5: https://www.mql5.com/de/market/product/872

    Zeitmarken: 00:00 Übersicht
    01:53 Installation
    02:44 Schließen bei Gesamtgewinn
    03:18 Schließen bei Gesamtsverlust
    03:50 Schließen mit Trailing-Gewinn
    04:45 Schließen aller Symbole mit Trailing-Gewinn
    05:41 Schließen separater Positionen mit Trailing-Gewinn
    06:42 Beispiel des VirtualTradePad

    Der EA ermöglicht es, Positionen im MetaTrader zu schließen, wenn ein Gesamtgewinn oder -verlust erreicht wird, unter Verwendung der Trailing-Gewinnfunktion.

    Hauptfunktionen:

    Sie können virtuelle Stopps aktivieren (Separate Order).
    Kauf- und Verkaufspositionen separat berechnen und schließen (Separate Käufe und Verkäufe).
    Schließen und Berechnen für alle Symbole oder nur für das aktuelle Symbol (Alle Symbole).
    Aktivierung des Trailing-Gewinns (Trailing Profit).
    Schließen bei Erreichen eines Gesamtgewinns oder -verlusts in der Einzahlungswährung, in Punkten (Pips) oder in Prozent des Kontostands.

    Schlüsselwörter: Vladon, Expforex, CLP, CloseIfProfitOrLoss, Schließen bei Gewinn, Gesamtgewinn, Schließen bei Gewinn oder Verlust, Trailing-Gewinn, Intelligenter Trailing-Stop, MetaTrader, MT4, MT5, Automatisiertes Trading, Expert Advisor, Virtuelle Stopps, Risikomanagement, Gewinnabsicherung, Stop-Loss-Strategie, Forex-Handel, Trailing-Funktion, Handelssignale, Trading-Tools, Handelsplattform.

  4. Expforex Vladislav Avatar

    Português. CLP: Fechamento de Lucro ou Perda + função de trailing de lucros
    https://www.youtube.com/watch?v=yI4txQfDCEU

    Guia completa: https://www.expforex.com/?p=78
    💎 CloseIfProfitorLoss MT4: https://www.mql5.com/pt/market/product/2945
    💎 CloseIfProfitorLoss MT5: https://www.mql5.com/pt/market/product/872

    Marcos de tempo:
    00:00 Visão geral
    01:53 Como instalar
    02:44 Fechamento por lucro total
    03:18 Fechamento por perda total
    03:50 Fechamento com trailing de lucros
    04:45 Fechamento de todos os símbolos com trailing de lucros
    05:41 Fechamento de operações separadas com trailing de lucros
    06:42 Exemplo do VirtualTradePad

    O EA permite fechar posições no MetaTrader ao alcançar um lucro ou perda total usando a função de trailing de lucros.

    Principais características:

    Você pode ativar os stops virtuais (Ordem Separada).
    Calcular e fechar posições de compra e venda separadamente (Compras e Vendas Separadas).
    Fechar e calcular para todos os símbolos ou apenas o símbolo atual (Todos os Símbolos).
    Habilitar o trailing de lucros (Trailing Profit).
    Fechar ao atingir um lucro ou perda total na moeda do depósito, pontos (Pips) ou percentual do saldo.

    Palavras-chave:
    Vladon, Expforex, CLP, CloseIfProfitOrLoss, Fechamento com Lucro, Lucro Total, Fechamento por Lucro ou Perda, Trailing de Lucros, Stop de Trailing Inteligente.

  5. Expforex Vladislav Avatar

    Español. CLP: Cierre de Ganancia o Pérdida + Seguimiento de Ganancia
    https://www.youtube.com/watch?v=FltYlihxC-Q

    Guía completa: https://www.expforex.com/?p=78
    💎 CloseIfProfitorLoss MT4: https://www.mql5.com/es/market/product/2945
    💎 CloseIfProfitorLoss MT5: https://www.mql5.com/es/market/product/872

    Tiempos clave:
    00:00 Visión general
    01:53 Cómo instalar
    02:44 Cierre por beneficio total
    03:18 Cierre por pérdida total
    03:50 Cierre con trailing de beneficios
    04:45 Cierre de todos los símbolos con trailing de beneficios
    05:41 Cierre de operaciones separadas con trailing de beneficios
    06:42 Ejemplo de VirtualTradePad

    El EA permite cerrar posiciones en MetaTrader al alcanzar un beneficio o pérdida total utilizando la función de trailing de beneficios.

    Características clave:

    Puedes activar los stops virtuales (Orden Separada).
    Calcular y cerrar posiciones de compra y venta por separado (Compra y Venta Separadas).
    Cerrar y calcular para todos los símbolos o solo el símbolo actual (Todos los Símbolos).
    Habilitar el trailing de beneficios (Trailing Profit).
    Cerrar al alcanzar un beneficio o pérdida total en la moneda del depósito, puntos (Pips) o porcentaje del saldo.

    Palabras clave:
    Vladon, Expforex, CLP, CloseIfProfitOrLoss, Cierre con Beneficio, Beneficio Total, Cierre por Beneficio o Pérdida, Trailing de Beneficios, Stop de Trailing Inteligente.

Extra

Navigation by tabs

This post is also available in: English Українська Portuguese Español Deutsch Chinese Русский Français Italiano Türkçe 日本語 한국어

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


     

    Risk Warning:


    Past trading performance does not guarantee future results.

    Trading foreign exchange on margin carries a high degree of risk and may not be suitable for all investors.

    Be aware that using trading robots involves substantial risk, and you could lose more than your initial investment.

    Please proceed with caution, assess your financial situation carefully, and consider seeking advice from a qualified professional.

    Disclaimer

    This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy and Disclaimer.
    Read More