The Boomerang MT5 EA
- エキスパート
-
Lungile Mbanjwa
Hi, I’m Lungile Mbanjwa, a 27-year-old reliable and dedicated Expert Advisor (EA) developer.
I specialize in building smart, adaptive trading robots using Moving Average strategies — including SMA/EMA crossovers, trend detection, slope analysis, and dynamic filters.
My promise to you: - バージョン: 1.0
- アクティベーション: 10
The Boomerang EA, version 1.00
Author: Lungile Mbanjwa
Platform: MetaTrader 5 (MQL5) | Type: Expert Advisor, daily breakout with pending orders
Overview
The Boomerang EA trades a daily breakout of the previous period's high and low. Each trading day it places a Buy Stop at the previous High and a Sell Stop at the previous Low. When one order fills, the EA cancels the other and manages the trade. Its stop loss comes from the High or Low of the 00:00 candle on a timeframe you choose (H4 by default), or from a fixed point distance.
It is built to be restart-safe. It survives terminal restarts, re-attaches, parameter changes and PC reboots without losing track of its trades, and it won't interfere with other EAs on the same account.
How the strategy works
- Levels. At the start of each day the EA reads the High and Low of the previous candle on your chosen level timeframe (D1 by default) and draws them on the chart as lime and red lines.
- Order placement. During your trading window (02:00–09:00 by default, server time) it places a Buy Stop at the previous High and a Sell Stop at the previous Low. Both carry a take profit, and orders expire after a set number of hours.
- Entry. When one order triggers, the opposite pending order is deleted.
- Stop loss. After entry, the EA sets the stop loss in one of two ways:
- Timeframe mode (default): a Buy gets the 00:00 candle's High and a Sell gets its Low. The candle is read from the SL timeframe (H4 by default).
- Fixed mode: a set number of points from the entry price.
- Live 00:00 levels. While the 00:00 candle is still forming, the EA keeps updating its High and Low. Once the candle closes, the levels are frozen.
- Exit. Trades close at the stop loss, the take profit, the daily close time (20:00 by default) or the start of a new day, depending on your settings.
- Daily limit. By default only one trade is taken per day, and you can raise that.
Key features
Restart-safe state restoration
- The EA saves its daily state (trades taken, closed-for-the-day flag, current day) in terminal global variables.
- After a restart it restores that state and rebuilds today's trade count and profit from deal history.
- Existing positions and pending orders are adopted rather than deleted. A mid-day restart will not close live trades or place duplicate orders.
- It waits for the terminal connection and chart data to be ready before acting.
- Pending orders left over from a previous day are cleaned up automatically.
Safe alongside other EAs
- Every position, order and deal check filters by both magic number and symbol.
- Chart objects are named with the magic number and removed by prefix, so other EAs' objects are never touched.
- It checks the account type at startup and warns on netting accounts, where positions on the same symbol merge.
- Magic number 0, which is reserved for manual trades, is rejected.
Risk management
- Fixed lot or % risk: the lot can be sized from the stop-loss distance and a percentage of balance.
- Margin protection: the lot is automatically reduced to fit free margin, and the order is skipped if even the minimum lot doesn't fit.
- Max trades per day.
- Spread filter: orders aren't placed when the spread is too wide.
- Daily loss limit: when the day's loss reaches a set percentage of the day's starting balance, the EA closes positions, cancels orders and stops trading for the day.
- Weekday filter: each Monday–Friday can be switched on or off.
Trade management
- Break-even: after a set profit, the stop moves to entry plus a small offset.
- Trailing stop: starts after a set profit, trails at a set distance, and moves in minimum steps.
- The stop loss only ever moves in the protective direction. It will never be loosened by the EA.
- Stop and freeze levels are respected, so invalid modifications are not sent to the broker.
Reliability
- It selects a filling mode the symbol supports.
- If a broker rejects order expiration, it retries as good-till-cancelled.
- It checks connection and trading permissions before sending orders.
- After a failed order it waits 60 seconds before trying again, so the log isn't flooded with errors.
- It validates inputs at startup and tells you what is wrong.
Dashboard
A live panel on the chart shows:
- Status, such as active, waiting, trade open, closed for the day or limit hit.
- Previous High and Low, and the 00:00 High and Low.
- Trades taken today out of the maximum, today's profit or loss, and the current spread.
- Key settings, the open position with its profit and stop loss, and the version, magic number and restore status.
The panel updates on a timer, so it stays live even when ticks are slow. It is hidden automatically in non-visual backtests.
Notifications
Optional pop-up alerts and phone push notifications for restores, positions opening and closing, and the daily loss limit.
Main inputs
| Group | Settings |
|---|---|
| Dashboard | Show/hide, display name, X/Y position |
| Daily Lines | Show previous High/Low, line colors |
| 00:00 Lines | Show 00:00 High/Low, colors, live refresh until the candle closes |
| Timeframes | Level timeframe (D1), SL timeframe (H4) |
| Trading | Enable trading, lot, magic number, expiration hours, slippage, take profit, fixed SL points, placing hours, close time, close on new day, cancel pendings after session |
| Risk Management | % risk sizing, max trades per day, max spread, daily loss %, auto-reduce lot to margin |
| Trade Management | Break-even trigger and offset, trailing start, distance and step |
| Weekday Filter | Monday–Friday on/off |
| Notifications | Alerts, push |
Recommended setup
- Account: a hedging account is recommended, especially if you run other EAs on the same symbol.
- Magic number: give each chart or symbol its own.
- Time settings: placing hours and the close time use broker server time, so adjust them to your broker.
- Lot size: keep it small relative to your balance. On volatile symbols like gold, a full-day candle can make the stop loss very wide, so use the % risk option or a small lot.
- Testing: test on a demo account first, and restart the terminal mid-day to confirm the restored status in the dashboard footer.
Risk disclaimer
Trading leveraged products such as forex and gold carries a high risk of loss and is not suitable for everyone. Past or backtested results do not guarantee future performance. Test the EA thoroughly on a demo account, and only trade with money you can afford to lose.
