Maximum loss
The Maximum loss module prevents opening new orders once the loss within a period (for example a day) reaches a limit. The loss includes the profit or loss of the orders that are still open. Use it as a daily or weekly loss limit.
How it works
Section titled “How it works”- The module adds up the loss of the current period: closed orders plus the open orders.
- When it reaches Maximum loss, no new orders open for the rest of the period. Open orders keep running.
- When a new period starts, the count starts at 0 again and the EA can open orders again.
Settings
Section titled “Settings”- Name: optional, tells this module apart from others of the same kind. See Name.
- Maximum loss: the loss at which new orders are blocked.
- Unit: Pips, Money or Percentage of balance. See Unit.
- Per (timeframe): the period in which the loss adds up: Current timeframe (the chart’s), M1, M5, M15, M30, H1, H4, Daily, Weekly or Monthly. With Daily, all losses of the current day add up to your total loss.
How the timeframe window works
Section titled “How the timeframe window works”The window starts at the beginning of the selected period and resets when a new period begins:
- Daily resets at the start of each day (midnight, broker server time).
- Weekly resets at the start of each week.
- Monthly resets at the start of each month.
When the window resets, the loss is cleared and the EA can open new orders again, as long as your other strategy modules also allow it.
Example
Section titled “Example”Your Maximum loss is $16 per Daily. Your EA hits its second stop loss at 16:00, and the day’s total loss passes
$16. New orders are blocked for the rest of that day.
The block is not lifted 24 hours later (16:00 the next day), but at the reset of the day window at midnight
(00:00): the next day starts a fresh $0 count.
Afterthought from the team
Section titled “Afterthought from the team”We could have built a module that closes all orders when the maximum loss is reached, but we chose to only prevent opening new orders. An order should be allowed to run its normal course instead of being cut off prematurely. A maximum loss shouldn’t be an afterthought, but a well thought out part of your EA.
So if you want at most 5% of loss a day, make sure the maximum loss of this module plus the stop loss of your Stop loss module never pass 5%. With a stop loss of 1% of the balance, you would be wise to set this module to 3.5%.
Related
Section titled “Related”- Maximum profit: the same for a profit target
- Time gap after loss: a pause after a losing order
- Stop loss: limit the loss of each order
MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.