One bad hour can end a challenge account. A news spike hits two open trades together, equity dips under the daily floor for a few seconds, and the breach still counts after price recovers. A guard EA checks faster than anyone at a screen.
What a prop firm drawdown limit EA for UAE traders does
The guard trades no strategy of its own. It sits on a spare chart and steps in when equity nears a limit you set. Because it reads the whole account, trades from a trade copier or from another EA count as well. Some sellers call the same tool an equity protector EA.
Of the seven rules it follows, Gulf traders most often get the daily reset wrong.
The daily reset runs on your firm’s clock
Each daily loss limit resets at a time the firm picks, whatever your broker’s clock says.
A common pattern is midnight Central European time, with the new day measured from the balance at that moment. Other firms use 5 pm New York time, which is 1 am or 2 am in Dubai. The floor is often that balance minus 5% of the starting capital, though some one-step challenges allow only 3%. These figures vary, so check your programme’s rules page.
The UAE stays on UTC+4 all year and Saudi Arabia on UTC+3, with no daylight saving. Central Europe moves from UTC+1 to UTC+2 between late March and late October:
| A midnight reset in Central Europe | Dubai | Riyadh |
|---|---|---|
| European summer time (UTC+2) | 2 am | 1 am |
| European winter time (UTC+1) | 3 am | 2 am |
Why care? A UAE evening overlaps the New York session, so a trade opened after dinner may still run at the reset. If your firm measures from the balance, that floating loss is left out of the new day’s starting figure. A position down 3% at the reset then leaves about 2% of a 5% daily limit.
Handling the clock in code
The guard stores the reset in the firm’s zone and converts it to broker server time. It re-checks that offset after each daylight saving switch. MQL5’s TimeGMT() function helps, but it reads DST from the computer’s own clock. That means the clock on your VPS or home PC has to be right.
The day’s starting value is written to disk too. A reboot at 4 am then can’t hand you a fresh daily allowance.
Balance base or equity base
Some firms measure the day from the balance at the reset, while others take the higher of balance and equity. Use the same base as your firm, or the guard’s numbers will drift from its dashboard. Ask support in writing when the rules page is vague.
Static or trailing max drawdown
A static floor stays where it started for the whole challenge. Many two-step challenges work this way, often with a 10% maximum loss from the initial capital.
A trailing floor climbs behind you. On many one-step challenges it moves up at the end of each day from the highest earlier balance, and it never moves down. After a good week it sits much closer to your equity, so a normal pullback reaches it sooner than you expect. A few programmes recalculate the trail in real time, which is stricter still.
One input switches the EA between the two models. It also saves the peak to disk, and the trailing floor survives a restart.
Equity on every tick, plus a one-second timer
A guard that only looks at closed trades reacts after the damage. This one reads ACCOUNT_EQUITY through AccountInfoDouble() on every tick, one of the values on the MQL5 account properties page.
Ticks are not a clock, though. An EA gets new ticks only for its own chart’s symbol, which can sit still for seconds while other symbols move. So the EA also calls EventSetTimer(1) and runs the same check in OnTimer(). MQL5 allows one timer per program, and this job needs no more.
A safety buffer, lot caps and news pauses
Never set the guard at the firm’s exact figure. Spread and slippage keep working while the EA closes trades, and the last fill can land well past your trigger. If the firm allows 5%, act at 4%. A push alert at 3% gives you time to step in first.
Lot caps stop the fastest breaches. The guard can check each new trade against:
- a maximum lot size per trade
- total lots open across the account
- the number of open positions
- separate caps for fast movers such as gold
A trade that breaks a cap is closed and logged. Inside your own strategy EA, the guard can instead size each trade from the stop loss distance.
For time rules, it can pause trading around releases you pick from the economic calendar built into MT5. It can also flatten everything before the weekend if your firm asks. Minimum trading days are the firm’s rule, although the EA can still count them on its panel.
The hard stop, and what survives a restart
At the action level the order is fixed. First the EA closes every position. Next it deletes pending orders, and then it locks the account, so any new trade closes at once until the next reset.
People forget to test the lock. Kept only in memory, it disappears when the terminal restarts. The EA therefore writes it to a file or to terminal global variables, which MetaTrader deletes four weeks after their last access.
An optional extra stops at the challenge target. Once equity gets there, the EA closes everything and pauses, so a late trade can’t undo a finished phase.
Test the guard before you pay for a challenge
Start in the Strategy Tester. A test mode can open random trades against tiny limits, such as a 0.2% daily loss, so each rule fires within minutes. Check the level and the order of every action.
The tester has one blind spot. The MQL5 docs say TimeGMT() equals the simulated server time during testing, so your reset conversion never meets a real clock. For that, leave a demo account running across a real reset, ideally with a trade held past 2 am Dubai time.
Then restart the terminal halfway through a trading day. The daily count and any active lock should come back exactly as they were.
Have the guard built around your firm’s numbers
Check first that your firm allows EAs at all. Our post on prop firm EA rules lists what to ask. You can code the guard yourself from the docs above. We can also build a prop firm drawdown limit EA for UAE traders around your firm’s rules and reset.
See the prop firm risk manager for MT4/MT5 for features and delivery, or MT5 Expert Advisor development for a full strategy with the guard inside.
Signal followers can read how lot caps apply when you copy Telegram signals to MT5. You test a demo build before the final payment. Still, no software can promise a passed challenge, so check your firm’s terms and your local regulations too.
Sources
- Account properties in the MQL5 docs:
ACCOUNT_EQUITY - OnTick reference: NewTick events
- EventSetTimer reference: timer events
- TimeGMT reference: how GMT time follows the PC clock
- Terminal global variables: the four week storage rule
- Economic calendar functions: the built-in calendar
- EU summer time arrangements: March and October switch dates



