• Overview
  • Reviews (27)
  • Comments (367)
  • What's new

CloseIfProfitorLoss with Trailing

Closing positions in MetaTrader 4 upon reaching the total profit/loss with the profit trailing function.

  • You can enable the Virtual stops (Separate Order),
  • Calculating and closing for BUY and SELL positions separately (Separate BUY SELL),
  • Closing and calculating all symbols or the current symbol only (All Symbols),
  • Enable trailing for profit (Trailing Profit)
  • Close on total profit and loss on deposit currency, points, % of the balance.

The application is designed for use on any account together with any other EA or in combination with manual trading.

As soon as the total balance of trades on some pair or all pairs is greater than or equal to the value specified in the settings, all positions are closed and orders are deleted.

This version is not only capable of closing a position at the specified profit level, but can also trail profit for better results.

You can also try the Profit or Loss Pad for MetaTrader 5.

This pad EA is part of our "One Click Trading " - VirtualTradePad system. and contains only the CLP tab.

CloseIfProfitorLoss with Trailing - Full Description

PDF GUIDE

Usage

  1. Start the panel on your currency pair chart.
  2. On the panel select the option to close positions by all symbols or by the current symbol.
  3. To activate the options for selecting the close type, you need to specify a non-zero value for the corresponding parameters.
  4. Check the options you want to use for closing (Profit\Loss in pips\dollars\percent).
  5. Enable the Close if Profit or Loss button, it should become blue. It means that the Expert Advisor has started working.
  6. Once the profit or loss of your position crosses the set levels, the positions will be closed.
  7. The emergency button CLOSE ALL is intended for closing all positions instantly.

Management

  1. All Symbols - enables closing for all symbols.
  2. XXXXXX only - only closing on the current pair the EA is running on.
  3. Separate BuySell - enables separate closing for BUY and SELL positions.
  4. Separate Order - separate closing for each separate positions.
  5. Profit $ - enables\disables closing by a total profit in USD or deposit currency.
  6. Profit p - enables\disables closing by a total profit in pips.
  7. Profit % - enables\disables closing by a total profit in percent of current balance.
  8. Loss $ - enables\disables closing by a total loss in USD or deposit currency.
  9. Loss p - enables\disables closing by a total loss in pips.
  10. Loss % - enables\disables closing by a total loss in percent of current balance.
  11. Close if Profit or Loss ON / OFF - the function closing by a total profit or loss is enabled / disabled

Trailing Profit

Trailing based on configured parameters.

This function enables trailing for profit (floating profit) at closing.
In this case, the profit is not fixed but is closed with a trailing of the specified value. As soon as the profit reaches the specified value, the Expert Advisor saves the current profit level and starts trailing the profit.

Example:

  • 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. 
  • When the total profit falls below the last fixed level, TrailingProfit, the Expert Advisor will perform forced closing of all position.

You can also download my other products:
Description MetaTrader 4  MetaTrader 5
Copy of deals and positions between terminals  COPYLOT  MT4  COPYLOT MT5
Trading panel in 1 click from the chart and keyboard  VIRTUALTRADEPAD MT4 VIRTUALTRADEPAD MT5
Professional Automatic scalper, Smart Robot  TICKSNIPER MT4 TICKSNIPER MT5
Smart robot for beginners  GOOD SANTA MT4  GOOD SANTA MT5
Universal Expert Advisor on Custom Indicators  The xCUSTOMEA MT4 The xCUSTOMEA MT5
Universal Advisor on Standard Indicators  THE X MT4 THE X MT5
Averager, grid, additional opening of positions on Trend and against Trend  AVERAGER MT4 AVERAGER MT5
Automatic installation of SL/ TP/ TS  ASSISTANT MT4 ASSISTANT MT5
Simulator for strategy tester  TESTERPAD MT4 TESTERPAD MT5
Professional account report   EXTRAREPORTPAD MT4 EXTRAREPORTPAD MT5

All my programs on mql5.com from Expforex

Agnaldo Prata
229
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
22
Saitama 2020.03.24 08:25 
 

Very great EA and Vladislav is very helpful and responsive with prompt reply to my questions.

spetrosyan1979
304
spetrosyan1979 2020.02.25 20:35 
 

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

Maik Siebel
546
Maik Siebel 2019.08.28 07:32 
 

User didn't leave any comment to the rating

Phoutsamay Tonmany
194
Phoutsamay Tonmany 2019.08.10 09:10 
 

this is great product that help you to discipline your trading strategy. :)

empol
39
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.

wroger
1015
wroger 2019.07.02 14:18 
 

Very useful, works combined with other EAs, great work!!!

pllm2708
301
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
264
Mahen Weerakkody 2019.04.09 05:45 
 

Excellent utility

adam7samuel
143
adam7samuel 2018.11.07 18:57 
 

thank god to meet you !

jonachow
124
jonachow 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
2115
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.

Ravi Chandiran
119
Ravi Chandiran 2018.02.01 18:14   

Hi, I purchased for 1 year for $15. I am unable to install. Can anyone help?

RCN999

Tung Shan Hui
218
Tung Shan Hui 2017.12.24 16:22 
 

Great Job! It's useful.

60012345
648
60012345 2017.12.21 19:12 
 

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

To Pui Kuen
382
To Pui Kuen 2017.11.11 02:55 
 

This utilities is extremely useful. Great job for Author !

Aslan Khuzmiev
831
Aslan Khuzmiev 2017.10.18 16:25 
 

отличный продукт

ropeganika
67
ropeganika 2017.10.15 07:47 
 

The author is really helpful!

ericcheungtakyu
140
ericcheungtakyu 2017.10.08 06:15 
 

Great tools!

the author is very helpful

thanks

Manea Marian
977
Manea Marian 2017.02.24 14:53 
 

Work great

Валерий Булеев
578
Валерий Булеев 2017.02.06 10:51 
 

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

DAVID DE CABO
443
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
733
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
903
Ikechukwu Emmanuel Okaro 2016.06.29 06:05 
 

This is a very important tool in any serious trader's arsenal. 5 stars!

Victor Epand
725
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
22
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.

umtelo
665
umtelo 2015.04.09 22:38 
 

Спасибо. Хорошая программа для контроля просадки и общей прибыли

Version 20.423 2020.04.23
-В Уведомление CLP_Alert CLP_Push добавлено название валютной пары, с которой работает программа.
-В Уведомление CLP_Alert CLP_Push добавлено название валютной пары, тип позиции и лот закрытой позиции.
Version 20.207 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.125 2020.01.27
-- Forced writing global variables to disk.
-- Color of TrailingStop and CLP in the ON mode - is changed to green.
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.17
Исправление отображения будущей прибыли в процентах при использовании нескольких открытых позиций
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.
VTP CLP: Added a new parameter to the "CLP options" section:
Test Function
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.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.227 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.17
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 is enabled, the EA waits for all positions of this currency pair to be closed, and only after that the button can be closed!

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.503 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 16.995 2017.01.13
General changes and improvements:
-Depending on the account currency, added the corresponding icon.
-Improved the function for displaying the trade levels when hovering the panel.
(when hovering the panel, the trade levels of the terminal are disabled, so that the stop levels are not caught when pressing buttons).
-Fixed and improved the function for calculating commission and swap for INFO,CLP.

CLP tab:
-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.
Version 16.990 2016.12.13
Now commission and swap are included into profit calculation.
Version 16.128 2016.02.01
The Expert Advisor is completely replaced by the CLP control panel
The 'Close if Profit or Loss' operation algorithm is completely identical
Now you have the option to use the EA as a panel on the chart


VirtualTradePad "CLP style"
Main Features:

The panel can work only on its own symbol (Current Symbol) or consider the total profit or loss by all symbols (All symbols).
The panel can be used as a virtual Stop Loss or Take Profit. To do it, set the profit and loss size in pips (Profit p or Loss p), put checkmarks and select your symbol. The Expert Advisor will close positions for the selected symbol considering the number of pips obtained or lost.
You can choose the close type: by profit in dollars, in pips or in % of balance or by loss in dollars, in pips or in % of balance.
There is also the "CLOSE ALL" button that instantly closes the current symbol position or all positions (depending on your choice).
The current state of your account is displayed right on the panel in three different ways corresponding to the close types.
Usage:

Start the panel on your currency pair chart.
On the panel select the option to close positions by all symbols or by the current symbol.
To activate the options for selecting the close type, you need to specify a non-zero value for the corresponding parameters. Note that a positive value must be specified for the profit and a negative value must be specified for the loss, for example: -100.
Check the options you want to use for closing.
Enable the Close if Profit or Loss button, it should become blue. It means that the Expert Advisor has started working.
Once the profit or loss of your position crosses the set levels, the positions will be closed.
The emergency button CLOSE ALL is intended for closing all positions instantly.

SEPARATE Orders 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.

Separate BUYSELL, which allows to calculate a close positions by the net profit or loss separately for BUY and for SELL.
Revised the signal system for the Signals panel.
This tab shows the trend by the timeframe and indicator. Previously signal was shown at the time of its triggering. Now the current trend is shown.

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.935 2015.10.07
Updated profit visualization during trailing.
Version 15.932 2015.10.05
Improved visualization on the screen!


New block:
PROFITLOSS_EXTRASETS4 - alert of profit and loss in the deposit currency.
If you want to limit losses for the current custom magic, use this new block.
Example: you want the EA to send an email and show a pop-up alert when the total loss of open and closed deals within LimitFor falls below -$100.

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

When the magic's loss on history reaches -$100 per day, the EA will show a pop-up alert and send an email.
Attention: This block does not close deals! It only generates an alert!
For the next LimitFor this parameter is reset to 0.

You can set LimitFor= DAY;WEEK;MONTH;ALLTIME;
Version 15.901 2015.09.02
Updated algorithm of forced closure of positions and orders, if an order has been closed manually.

PROFITLOSS_EXTRASETS4 - a block for limiting profit and loss in the deposit currency.
If you want to limit losses with current settings, you can do it in the new block.
E.g.: You want to limit trade opening after the total loss for 1 day (week or month) equal to -100 USD
You will have the following parameters:
LimitFor=0;
LimitForLosses=-100;
LimitForProfits=0;

After the loss in history with the given settings reaches -100 dollars for one day, you will receive an alert prompting you either to change the parameters or delete the EA that opens trades.
The next day, this parameter is reset to 0.

You can choose LimitFor= DAY;WEEK;MONTH;ALLTIME;
Version 15.123 2015.01.23
Added options for closing the terminal after the closure of a series of trades
  CloseTerminalAfterClosePROF - disable the terminal after fixing profit.
  CloseTerminalAfterCloseLOSS - disable the terminal after fixing loss.

Improved profit trailing.
xtern double TralOptions=5;
extern double TralOptionsStep=2.