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

Live Test Bench: automated checks of an EA on a demo account - MetaTrader 5용 expert

Mohamed-amine Baddir
Mohamed-amine Baddir
MetaTrader 5용 Expert Advisor(EA)를 개발하고, 실제 거래에 사용하기 전에 충분히 테스트합니다.
제가 제공하는 작업:
고객의 전략, TradingView 스크립트 또는 문서화된 규칙을 깔끔한 MT5 Expert Advisor로 구현
기존 EA 수정 및 문제 해결: % 기준 리스크 포지션 사이징, 트레일링 스톱, 세션 및 시간 필터, 스프레드 필터, 멀티 심볼 포트폴리오, 드로다운 보호 기능
조회수:
165
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The Strategy Tester cannot check what happens on a live chart: a terminal restart, Expert Advisors that start before the account is connected, a second copy of the same EA on another chart, the account history on the server, or a click on a chart button. This bench checks these automatically on a demo account and writes a PASS/FAIL report.

Report of a real run: 26 checks passed in three phases

Files

  • LiveTestDriver.mq5: the test driver. It reads the phase (A, B or C) from MQL5\Files\LiveTestBench\phase.txt, runs the checks of that phase and closes the terminal with TerminalClose(). It refuses to run on anything but a demo account.
  • ExampleDailyLock.mq5: the example EA under test, a daily loss lock that keeps its state in global variables, allows one copy per account (GlobalVariableSetOnCondition) and has an Unlock button.
  • ExampleDailyLock_DemoTest.mq5: a demo-only build of the example. It defines DEMO_ONLY and includes the EA, so the source of the EA does not change.
  • run_live_test.ps1 (in the zip): a PowerShell launcher that writes a start-up configuration, starts the portable terminal for one phase and prints the report.

Phases

  • A: start, one copy per account, the lock, how fast a locked EA closes a new position. Ends by closing the terminal.
  • B: after the restart: the chart is restored from the profile, the saved state is identical, the lock is still enforced, the day-start balance is rebuilt from the history.
  • C: a person clicks Unlock on the chart. Chart objects ignore posted mouse messages, so this step needs a real click; the driver shows an instruction and waits up to 10 minutes.

The bench: driver, EA under test and launcher

How to use

  1. Copy terminal64.exe to a new folder, start it with the /portable key and log in to a demo account with the password saved.
  2. Put the three .mq5 files in MQL5\Experts\LiveTestBench of that terminal and compile them.
  3. Close the terminal, then run: .\run_live_test.ps1 -Terminal "D:\MT5_demo" -Phase A , then B, then C.

To test your own EA, add the demo-only check to its OnInit(), create a second file with #define DEMO_ONLY and #include, and change EA_NAME, EA_PATH, the inputs written by Attach() and the checks in the driver.

A real run on a demo account passed 26 checks in three phases (picture 1). Phase C found a real bug in the first version of the example: after Unlock the EA locked again within the same second, because the loss of the day was still above the limit.

AccountGuard - lock your EA to licensed accounts (single include) AccountGuard - lock your EA to licensed accounts (single include)

Single-header account lock for MT5 EAs: licensed account numbers, optional demo allowance, expiry date, tester bypass. Licence compiled in with #define. No DLL.

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.

TesterReport: read a saved Strategy Tester report into deals and trades TesterReport: read a saved Strategy Tester report into deals and trades

Reads a Strategy Tester report saved as HTML into its deals, closed trades, net profit and balance drawdowns, for comparing, combining or exporting backtests.

PortfolioWeights: risk parity, HRP, minimum variance and maximum diversification PortfolioWeights: risk parity, HRP, minimum variance and maximum diversification

Portfolio weights from the returns of symbols or Expert Advisors: inverse volatility, risk parity, hierarchical risk parity, minimum variance, maximum diversification, Ledoit-Wolf covariance.