거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

Daily Loss and Profit Lock - MetaTrader 5용 expert

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
4.7 (44)
2017년부터 트레이더이자 MQL5 회원입니다.
9년 동안, 대부분 XAUUSD 차트 앞에서 보낸 뒤, 제가 실제 매매에서 쓰는 도구들을 공개하기로 했습니다. 팔기 위해 만든 것은 하나도 없습니다. 모두 제게 필요해서 만들었습니다. 더 명확한 차트 해석, 모든 거래를 위한 계획, 정직한 통계, 통제된 리스크, 그리고 휴대폰으로 오는 알림입니다.
조회수:
150
평가:
(1)
게시됨:
업데이트됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Funded accounts on Gold (XAUUSD) and forex are lost on one bad day more often than on a bad month. This utility EA watches the account equity every second, compares it with the equity at the start of the trading day and, when the day loss reaches your limit, 4 percent by default, it closes every position and deletes the pending orders.

After that the day stays locked. Any new position that appears, from you or from another EA, is closed right away until the next day start, 00:00 server time by default. You can also lock the day on a profit target, and set an overall loss from the starting balance that keeps the account locked until you remove the EA.

It never opens trades. A market close can fill worse than the limit on a fast move or a gap, so set it a little inside the real rule of your prop firm.

Daily Loss and Profit Lock closing the positions at the daily loss limit and locking the day on a XAUUSD M15 chart in MetaTrader 5

Settings

  • How the limits are measured: percent of the equity at the day start (default) or money in the account currency.
  • Daily loss limit: 4 by default, 0 turns it off. Daily profit target that also locks the day: off by default.
  • Overall loss from the starting balance (off by default) and the starting balance it uses (0 = balance when the EA is attached).
  • Positions the guard controls: every position on the account (default) or only one magic number.
  • Delete pending orders when a limit is hit and close any new position until the next day: both on.
  • Day start: 00:00 server time, HH:MM. Set it to the reset time of your prop firm.
  • Warning when 75 percent of the daily limit is used, once per day. 0 turns it off.
  • Slippage when closing, popup and push alerts, and the status text on the chart.

What it needs

Attach it to one chart, any symbol and any timeframe. It works on every symbol of the account, not only the chart symbol, and runs on a 1 second timer so it reacts even when the chart symbol is quiet. AutoTrading must be on so it can close positions. The day start equity is taken when the day begins or when you attach it, whichever comes later, so attach it before you start trading. If the terminal is closed, nothing is watched. Push notifications need your MetaQuotes ID in the terminal options.

Make it yours

Test it in the strategy tester next to your own EA on XAUUSD, EURUSD, GBPUSD, US30 or NAS100, with the money mode, to see where the lock would have stopped a bad day. XP_Guard holds every check, so a weekly limit, a maximum number of trades per day or a news pause go there. XP_CloseAll and XP_DeletePending are ready to copy into any EA that needs an emergency exit.

About this code

Open source. Use it as it is, adapt it, build your own version on top of it. Questions, suggestions and your own tests are welcome in the comments below.

Changelog

v1.0 (2026-11-20): initial release.

Premium Discount OTE Zones Premium Discount OTE Zones

Premium and discount zones for MT5 on Gold (XAUUSD), forex and indices: dealing range from confirmed swings, equilibrium 50 percent, 25 and 75 percent lines and the OTE band of the last leg. Open source code.

Opening Range Breakout EA Gold Opening Range Breakout EA Gold

Opening range breakout EA for MT5 on Gold (XAUUSD), forex and indices: trades the first candle that closes outside the opening range, stop at the range, target in multiples of the stop, lot by risk, end of day close. Open source code.

PDH PDL Sweep Levels PDH PDL Sweep Levels

Previous day high and low indicator for MT5 on Gold (XAUUSD), forex and indices: PDH, PDL, previous week high and low, day and week open, and an arrow when a closed candle sweeps a level and closes back inside. Open source code.

News Straddle EA Economic Calendar News Straddle EA Economic Calendar

News trading EA for Gold (XAUUSD) and forex: places a Buy Stop and a Sell Stop seconds before each release of the MT5 economic calendar, one cancels the other, stop loss, take profit and trailing in points. Open source code.