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

AccountGuard - lock your EA to licensed accounts (single include) - MetaTrader 5용 라이브러리

Manit Chin
Manit Chin
MQL5 Developer | Expert Advisors, Indicators, Backtesting
조회수:
50
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

AccountGuard is a small single-header account lock for MT5 Expert Advisors. Restrict your EA to specific account numbers, with an optional demo allowance, an expiry date and a Strategy Tester bypass so you can still backtest.

The licence is compiled into the .ex5 with #define lines, so the end user cannot unlock it from the Inputs tab.

AccountGuard chart comment examples

How to use

#define AG_ALLOWED_LOGINS "12345678, Broker-Real8:5012345678"
#define AG_ALLOW_DEMO     true                  // any demo account can try it
#define AG_EXPIRY         D'2026.12.31 23:59'   // 0 = never
#include "AccountGuard.mqh"

int  OnInit() { AG_Init(); ... }
void OnTick()
  {
   ManageOpenPositions();        // exits keep working
   if(!AG_Allowed()) return;     // no NEW trades when locked
   ...
  }

Settings (#define, before the #include)

  • AG_ALLOWED_LOGINS: licensed accounts. Each entry is a login (any server) or "server:login" (that server only). Commas, semicolons, spaces or new lines all work as separators.
  • AG_ALLOW_DEMO: true = any demo account may use the EA (for trials).
  • AG_EXPIRY: licence end date and time, or 0 = never. Example: a 30-day rental or a 7-day trial.
  • AG_ALLOW_TESTER: true (default) = always allowed in the Strategy Tester, so buyers can backtest.

Functions

  • AG_Init(): call once in OnInit.
  • AG_Allowed(): call before every NEW order. Returns false when locked. Exits and trailing stops placed before the gate keep working.
  • AG_Reason(): the reason text for your panel, e.g. "account 87654321 (Broker-Real2) is not licensed".

Inputs

  • InpAGMessage: text shown in the alert when the EA is locked.
  • InpAGSelfTest: run the built-in self-test (32 checks, including cases that must stay locked).

Safety

  • Safe by default: an empty list, a typo in the list, an expired licence, or account details that are not loaded yet (VPS start / reconnect) all mean LOCKED. It re-checks automatically.
  • Expiry uses the later of the server tick time and the trade-server time, so setting the PC clock back does not extend it.
  • The lock reason is printed once, not on every tick.
  • No DLL, no WebRequest, no files: works in the Strategy Tester and on any VPS.
  • The library never sends orders.

Example EA

AccountGuard_Demo.mq5 shows "AccountGuard: allowed" or "AccountGuard: LOCKED" with the reason on the chart. On a live or demo chart it never trades. In the Strategy Tester only (InpTesterDemo), it opens one minimum-lot example trade per day through the AG_Allowed() gate.

Honest limits

  • This raises the bar against casual copying of a compiled .ex5. It is not unbreakable DRM.
  • To change the licence (new account, new expiry) you recompile and send a new .ex5.
PropGuard Lite - daily and max loss guard for prop firm accounts PropGuard Lite - daily and max loss guard for prop firm accounts

Risk tool for prop firm accounts: closes all positions and blocks new trades when the daily loss or max loss limit is reached. Never opens trades on a live chart.

Line Master – Fast and Slow Trend Lines with Trend Change Signals Line Master – Fast and Slow Trend Lines with Trend Change Signals

Line Master is a trend-following indicator for MetaTrader 5 that displays fast and slow dynamic price lines to help traders identify market direction and potential trend changes. Blue represents a bullish trend, while red represents a bearish trend. Visual markers highlight changes in the indicator's trend state. The indicator includes adjustable Fast Length and Slow Length parameters, allowing traders to customize its sensitivity. It can be used on forex, gold (XAUUSD), indices, and other MT5-supported markets. For better results, combine its signals with price action, support and resistance levels, and proper risk management. Signals are not guaranteed and should be confirmed before entering a trade.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.