This little EA is designed to protect your account from unexpected drawdowns and/or lock in profits.
Note:
- It does NOT place orders.
- It does NOT amend existing orders.
- It can be used alongside any other EA or manual strategy that you care to use.
Features
- Monitors EQUITY, not simply floating profit/loss.
- Can monitor all trades, trades submitted by any EA or trades submitted by a specific EA.
- Closes all monitored trades if equity falls below a specified loss limit (expressed in either an amount or a percentage of the opening balance)
- Closes all monitored trades if equity reaches a specified profit target.
- Can disable auto trading when close is triggered.
Example Information Panel
Parameters
The parameters should be self-explanatory, but for clarification:
Currency pairs
- All pairs
- Current pair only
Magic Number to Monitor for
- 0 = None : The EA will monitor ALL trades regardless of their magic number.
- -1 = All EA trades : The EA will monitor and control only trades submitted by an EA, i.e. trades opened manually will not be affected or included in the profit/loss calculations.
- >0 = Only trades for the requested magic number will be monitored.
Date of opening balance
The date and time that EA is to calculate the initial balance from.
Refresh interval
How often the EA checks the equity (in seconds).
Close values
- Percentage of balance - the profit and loss figures are a percentage of the initial balance.
- Amount of money - the profit and loss figures are a specific amount (in the account currency).
Profit target
The profit point at which the EA will be triggered (e.g. 10% profit or $100 profit, depending on the Close Basis).
If set to zero, the EA will not check for a profit amount, and will never close while the account is in profit.
Loss limit
The loss point at which the EA will be triggered (e.g. 5% loss or $100 loss, depending on the Close Basis).
If set to zero, the EA will not check for a loss amount, and will never close while the account is in loss. THIS IS NOT RECOMMENDED!
Include commission?
Whether or not to include commission ans swap fees when calculating the current profit amount.
Close based on date/time?
Whether or not to close all trades (regardless of profit or loss) at a specific date and time.
Date and time to close
Self-explanatory.
Close pending orders?
Whether or not to close pending orders when the close is triggered.
Disable AutoTrading?
When set to true, the EA will disable AutoTrading when triggered.
Enable trailing profit?
Whether or not to enable the trailing profit feature.
Trailing profit trigger level
The point (in either percentage of opening balance or a specific amount - see Close values parameter) at which the trailing profit is triggered.
Trail profit by
The distance behind the current profit the trailing profit should be kept at.
Trailing profit step
The amount by which the trailing profit is to be moved each time.
Version 1.142:
- Expiry date extended to end December 2022.
Version 1.141:
- Expiry date extended to end June 2021.
Version 1.14:
- Tidy up processing around profit target being hit.
- Don't check if profit target has been reached is set to zero.
- Don't check if max loss reached if zero.
Version 1.13:
- Bug fix: stop current trailing profit resetting itself.
- Bug fix: when resetting by turining on AutoTrading, use today's date for calculation of opening balance.
Version 1.12:
- Bug fix: corrected trailing profit function (properly this time!).
- Corrected calculation of opening balance for new accounts.
- Corrected the trigger for scheduled close.
- Added details to notifications.
Version 1.11:
- Bug fix: stop crash on new accounts.
- Bug fix: corrected trailing profit function.
Version 1.10:
- Added option to monitor just the current symbol.
- Added option to close pending orders.
- Added option to trail profit.
- Added option to send notifications.
- Added option to include commission and swaps in profit calculation.
- Added option to trigger close on specific date and time.
- Various changes to the information panel.
- Corrected the calculation for the opening balance.
Version 1.00:
Version 1.141:
- Expiry date extended to end June 2021.