• 概述
  • 评论 (9)
  • 评论 (36)
  • 新特性

CloseIfProfitorLoss with Trailing

Closing Positions in MetaTrader 4 using Total Profit/Loss, with Trailing Stop.

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)

Positions are closed by the value of deposit currency, points, % and drawdown.

The Expert Advisor 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 Expert Advisor for MetaTrader 5.

This panel is part of our "Trade in one click" system - VirtualTradePad

The detailed description and examples of use can be found in our blog

Parameters

  • MagiccOrder - closing by magic number: -1 - all orders;
  • MagikToClose - the magic number of the position to calculate and close
  • OpenHour - the EA operation time, Start hour
  • OpenMinute - the EA operation time, Start minute
  • CloseHour - the EA operation time, End hour
  • CloseMinute - the EA operation time, End minute
  • CLP_TralOptionsStep - profit trailing step
  • BalanceStart - balance based on which the percent will be calculated. 0 - the variable is filled at the start.
  • Orderdelete - delete pending orders when closing the position.
  • Use_Lots_in_CLP_Points - - 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.
  • AutoCorrect_LevelCLP - automatic checking of the values entered in the fields of the EA.
  • PROFITLOSS_EXTRASETS4 - block of alerts for profit and loss in the deposit currency.

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.
  • You can also configure trailing for the obtained profit. As soon as the profit reaches the specified value, the Expert Advisor saves the current profit level and starts trailing the profit.
  • 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.

Other features:

  • This panel can be used together with other panels of our collection.
  • The Close button shuts down the application.
  • The Show\Hide button minimizes and maximizes the pane on a chart.
  • The pane can be moved on the chart. To do it, click the upper part of the pane near the Close and Minimize buttons, and then move the pane to a desired position.

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, is 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.
Manea Marian
529
2017.02.24 14:53 
 

Work great

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

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

60012345
246
2017.01.12 08:45 
 

ОК

DAVID DE CABO
208
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
493
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
691
2016.06.29 06:05 
 

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

Victor Epand
705
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
32
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
131
2015.04.09 22:38 
 

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

版本 17.118 - 2017.01.24
Fixed operation with long tickets
版本 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.
版本 16.990 - 2016.12.13
Now commission and swap are included into profit calculation.
版本 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.
版本 15.935 - 2015.10.07
Updated profit visualization during trailing.
版本 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;
版本 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;
版本 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.