無料でロボットをダウンロードする方法を見る
Telegram上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
スクリプトを気に入りましたか?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...

User guides are on my blog. For questions or bugs, write in the product's Comments tab or send me a message.
ビュー:
107
パブリッシュ済み:
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.

Three Colors Three Colors

Example: Moving Average indicator filling by different colors

MACD Sample MACD Sample

Classical MACD Sample.