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

EA Validation Guard - Pre-Trade Request Checker - MetaTrader 5용 라이브러리

Luke John Smith
Luke John Smith
I’m a full-time MQL5 developer.
I build Expert Advisors, indicators, dashboards and trading tools for traders who want real automation — not theory.
I specialise in turning manual trading strategies into clean, stable and fully automated systems that can run reliably in real market conditions.
조회수:
39
게시됨:
업데이트됨:
\MQL5\Scripts\ \MQL5\Include\
README.txt (0.93 KB) 조회
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

EA Validation Guard is a reusable MQL5 include designed to perform pre-trade checks before an Expert Advisor sends an order to the broker.

Its purpose is to help developers detect common execution problems before calling OrderSend(), while providing a clear journal message explaining why a trade request was rejected.

The library does not contain any trading strategy and does not open trades automatically.

Main checks

  • Terminal trading permission.

  • Expert Advisor trading permission.

  • Account trading permission.

  • Symbol trading mode.

  • Trading session availability.

  • Minimum trade volume.

  • Maximum trade volume.

  • Volume step validation.

  • SYMBOL_VOLUME_LIMIT.

  • Entry price tick-size alignment.

  • Stop loss tick-size alignment.

  • Take profit tick-size alignment.

  • Broker minimum stop distance.

  • Margin requirement estimation.

  • Available free margin.

  • Broker OrderCheck validation.

  • Stop level and freeze level information in rejection diagnostics.





Basic usage

Include the library:

#include <MQLXpert_ValidationGuard.mqh>

Create your normal MqlTradeRequest and pass it to:

MQLXpertValidateTradeRequest()

If validation succeeds, the request can then be passed to OrderSend().

If validation fails, the function returns false and provides a readable reason explaining why the request was blocked.

Example

The included example script demonstrates how to construct a market trade request and pass it through the validation library.

For safety, the example performs validation only and intentionally does not send a live trade.

Purpose

This library is intended for Expert Advisor developers who want an additional pre-flight validation layer before sending trade requests.

It can be useful when developing EAs for different brokers, symbols and account types where margin requirements, volume limits, stop restrictions and trading permissions may vary.


Developed by MQLXpert

Code for Traders. By Traders.


Prop Firm Daily Profit Lock Prop Firm Daily Profit Lock

Daily Profit Lock is a free utility EA that protects a good trading day. Once today's profit hits your cap, it closes your trades, deletes pending orders and blocks new trades until the next day. You can set the cap as a fixed amount, a percent of balance, or a share of total profit, which suits prop-firm consistency rules. Dry run is on by default, so it only alerts until you're ready, and it never opens a trade itself.

One-Click Buy Sell Close Panel with Pip Stops One-Click Buy Sell Close Panel with Pip Stops

Chart panel Expert Advisor with BUY, SELL and CLOSE buttons. Market orders use a fixed lot with stop loss and take profit in pips, and the panel shows the floating profit of its trades.

Round Number Levels Round Number Levels

Auto-scaled round-number (psychological) levels with major, half and quarter lines, plus a panel showing the nearest levels and their distance in price, points and % of daily ATR.

Psychological Level Reaction Tracker Psychological Level Reaction Tracker

Free MQL5 indicator that plots 00, 25, 50 and 75 psychological price levels and tracks historical touches, rejections, breakouts and sweeps with dashboard statistics and alerts.