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

Backtest Data Preflight: check broker bar history before a backtest - MetaTrader 4용 스크립트

George Ciprian Mandache
George Ciprian Mandache
Mostly writing code that does stuff...
아직 없거나, 있어도 누군가 다시 만들어야 할 만큼 형편없는 인프라를 오픈 소스로 만듭니다. Docker에서 HTTP로 MetaTrader 5를 다루는 mt5-httpapi와 Linux에서의 MQL 컴파일도 그중 하나입니다. 모두 GitHub에 있습니다: https://github.com/psyb0t
조회수:
229
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Backtest Data Preflight shows what bar history your MetaTrader 4 terminal can read for a symbol, timeframe and date range. Check the report before starting a backtest if you want to see whether the broker returned bars near the dates you asked for.

Run a check

  1. Compile the script in MetaEditor and drag it from Navigator onto a chart.
  2. Use the chart symbol and timeframe, or pick a timeframe and enter another symbol from Market Watch.
  3. Set From and To in broker server time. The check includes From and excludes To. Leave both at zero for the last 30 days.
  4. Read the report in the Experts tab.

Read the report

  • The bar count and first and last opens show what the terminal returned. The edge offsets show how far those opens are from the requested dates.
  • A gap is a pair of opens farther apart than the selected timeframe. Check the dates against normal trading hours. Weekends and holidays can produce gaps. Monthly bars show the observed dates without a gap count.
  • If the first bar is far after From, open the History Center (F2), download the history for the symbol and run the check again. Bars the terminal never received are not in the test either.

Try it on an hourly currency chart over a weekend. The report shows the interval between Friday's last open and the next one. Use the Strategy Tester's Report and Journal tabs to check what the test actually ran on.

Bar report from an MT4 terminal run

CustomStopOut: your own margin call and stop-out levels, worst order closed first CustomStopOut: your own margin call and stop-out levels, worst order closed first

A script that sets your own margin call and stop-out levels above the broker's. It alerts when the margin level falls below your margin call level and, below your stop-out level, closes open orders one at a time, the worst net result first, until the level is back up, the way a broker stop-out works.

StrictJson: RFC 8259 JSON parser and writer for MQL4 StrictJson: RFC 8259 JSON parser and writer for MQL4

One include file that reads and writes JSON in MQL4. It refuses broken JSON and tells you the line and column of the mistake, keeps numbers exact, reads and writes UTF-8 files, and saves your EA's settings to a file and loads them back.

Hotkeys: keyboard shortcuts for MQL4 experts and indicators, set in the inputs Hotkeys: keyboard shortcuts for MQL4 experts and indicators, set in the inputs

One include file that gives your EA or indicator keyboard shortcuts the user types into the inputs, such as Shift+B. Each press fires one action, Shift+B never fires on a plain B, and a shortcut that cannot work is refused at start with the reason.

TesterSafeLots - risk lot size that stays correct in the MT4 Strategy Tester TesterSafeLots - risk lot size that stays correct in the MT4 Strategy Tester

Risk-based lot size for MQL4 that does not depend on MODE_TICKVALUE in the Strategy Tester, so backtests of USDJPY, USDCHF or USDCAD on a USD account risk what the input says. Includes a test EA that measures the error.