CloseIfProfitorLoss with Trailing
- Utilities
- Vladislav Andruschenko
- Version: 25.514
- Updated: 14 May 2025
- Activations: 10
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 in deposit currency, points, or % of the balance.
The application is designed for use on any account together with any other EA or in combination with manual trading.
MT5 version | Full Description +DEMO +PDF | How To Buy | How To Install | How to get Log Files | How To Test and Optimize | All products from Expforex |
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.
The main functions of our utility
Close by Total Profit for all symbols;
Close by Total Profit for separate deals (Virtual mode);
Close by Total Profit with Profit Trailing;
Close by Total Profit in points, percents, or currency;
Close by Total Loss for all deals or separate deals;
Close Charts and Terminal after closing deals, Risk Manager, Mail with information about closing, Push notification, and so on.
Links
- This pad EA is part of our "One Click Trading " - VirtualTradePad system. and contains only the CLP tab.
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.
- Check the options you want to use for closing (Profit\Loss in pips\dollars\percent).
- 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.
Management
- All Symbols - enables closing for all symbols.
- XXXXXX only - only closing on the current pair the EA is running on.
- Separate BuySell - enables separate closing for BUY and SELL positions.
- Separate Order - separate closing for each separate position.
- Profit $ - enables\disables closing by a total profit in USD or deposit currency.
- Profit p - enables\disables closing by a total profit in pips.
- Profit % - enables\disables closing by a total profit in percent of current balance.
- Loss $ - enables\disables closing by a total loss in USD or deposit currency.
- Loss p - enables\disables closing by a total loss in pips.
- Loss % - enables\disables closing by a total loss in percent of current balance.
- Close if Profit or Loss ON / OFF - the function for 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 starts moving following the profit.
- When the total profit falls below the last fixed level, TrailingProfit, the Expert Advisor will perform forced closing of all positions.
External Variables and Settings
Language: Select interface language (Spanish, Portuguese (Brazil), German, Chinese, Japanese). Defaults to terminal language.
MagicNumber (int): Assigns a unique magic number to identify positions/orders opened by this EA. 0 means no magic number.
UseAllMagicFromAllAccount (bool): true: Monitors all positions for the current symbol across the account. false: Only monitors positions with specified MagicNumber(s).
Show_Future_BE_TP_SL: Displays break-even, take profit, and stop loss levels on the current chart based on profit/loss settings. Only for the current symbol and when separate orders mode is off.
CLP_TralOptionsStep (double): Defines the step size for adjusting the trailing profit level (in points, currency, or percent).
Use_Commission_in_CLP (bool): Includes commission in profit/loss calculations when closing positions.
AutoCorrect_LevelCLP (bool): Automatically corrects profit/loss input values to ensure valid entries.
CLP_DeleteStopOrders (bool): Deletes pending orders when closing positions based on total profit or loss.
Use_Lots_in_CLP_Points (bool): Considers lot size when calculating profit/loss points, useful for hedge accounts with varying lot sizes.
CPL_CloseAllCharts_per_CloseAllDeals: Closes all charts with the EA before closing positions, saving chart templates (MT5 only).
CPL_CloseTerminalAfterClose (bool): Closes the terminal after all positions are closed.
ShowCloseAllButton (bool): Displays a "Close All" button on the panel to immediately close all transactions.
ClosingCurrentTicketOnly (bool): Closes only the current list of tickets, ignoring new positions opened by other EAs.
ClosebyFIFO (bool): Closes positions using FIFO (First In, First Out) order.
VPS_CLP_Activation (bool): Activates CLP settings for VPS, allowing external variable management.
VPS_CLP_Parameters: Various settings to manage profit, loss, and trailing options specifically for VPS environments.
LimitFor: Time frame for checking open/closed deals to limit profit/loss.
LimitForLosses & LimitForProfits: Sets loss and profit limits that trigger alerts.
LimitForLotsDeals & LimitForCountDeals: Limits on lot sizes and number of deals that trigger alerts.
Works as intended.