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

TesterStats: Strategy Tester report statistics in MQL5 code - MetaTrader 5용 라이브러리

Mohamed-amine Baddir
Mohamed-amine Baddir
  • MT5 developer: gold and index EAs, testing tools 에  Independent MQL5 developer
  • 모로코
  • 2301
금과 주가지수용 MetaTrader 5 EA, 그리고 제가 직접 검증에 쓰는 테스트 도구를 개발하고 판매합니다.
EA
조회수:
552
평가:
(2)
게시됨:
\MQL5\Include\ \MQL5\Experts\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

TesterStats.mqh calculates the statistics of the Strategy Tester report from the deal history. It also gives the ones that TesterStatistics() does not return: Z-Score, AHPR, GHPR, LR Correlation and LR Standard Error. You can use them in a custom optimization criterion, or on a live account to get the same numbers as in a backtest report.

TesterStats in OnTester() and the tester report of the same test

#include <TesterStats.mqh>

CTesterStats stats;

void OnTick()
  {
   stats.TrackEquity();      // only needed for the equity drawdown and the recovery factor
   ...
  }

double OnTester()
  {
   stats.Calculate();        // or stats.Calculate(magic, symbol)
   Print(stats.Text());
   return(stats.ghpr);
  }

I checked it against the tester in 5 tests (EURUSD, USDJPY, XAUUSD, fixed lots and percent risk, with and without TesterWithdrawal) by comparing 44 values with TesterStatistics() and the HTML report. With "1 minute OHLC" and "Every tick" all 44 were the same. With "Every tick based on real ticks" the tester checks the equity less often, so the equity drawdown here was 0.05% to 0.26% deeper; the other values were the same.

Rules of the report that the code follows: a trade with a result of 0.00 counts as a profit trade; deposits and withdrawals after the start are kept out of the balance drawdown, and for the equity drawdown a withdrawal starts a new peak; AHPR and GHPR count a withdrawal as a loss; the Z-Score probability is taken from Z rounded to 2 digits. Sharpe Ratio is not included. Tested on accounts without commission.

TesterStatsExample.mq5 is a moving average cross whose optimization criterion is GHPR weighted by the LR Correlation.

ICT Kill Zones - Asian, London, New York in New York time, with summer time ICT Kill Zones - Asian, London, New York in New York time, with summer time

ICT kill zones (Asian, London, New York, London Close) at the right New York hours on any broker, with US and EU summer time. High / low boxes, levels until price takes them, midnight open. Alerts and buffers for EAs.

Order Blocks and Breaker Blocks (SMC) - no repaint, with mitigation and alerts Order Blocks and Breaker Blocks (SMC) - no repaint, with mitigation and alerts

Marks the order block behind each break of market structure (the last opposite candle before the move), tracks when it is used and turns failed blocks into breaker blocks. No repaint. Alerts and buffers for EAs.

Session Range Breakout: Asia, London and New York high/low levels Session Range Breakout: Asia, London and New York high/low levels

Session Range Breakout draws the high and low of up to three intraday sessions (Asia, London and New York by default) and extends each level to the right with optional H/L labels and a range rectangle. Session hours, names and colours are configurable in server time. Optional popup, sound and push alerts fire when a bar closes outside a session range. The levels are fixed once the session closes, so the drawing does not repaint. The indicator draws chart objects only and never opens trades.

Non-Repainting Fair Value Gap Detector Non-Repainting Fair Value Gap Detector

Non-repainting three-bar Fair Value Gap detector for MetaTrader 5. Closed-bar detection, the 50% Consequent Encroachment level, mitigation as an explicit state machine, incremental scanning, and a built-in self-audit that re-checks the stored gap levels against the closed-bar series on attach. Pure native MQL5, no DLLs, no external dependencies.