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

History Gaps: find missing bars before you backtest - MetaTrader 5용 지표

Bayram Erhan Partal
Bayram Erhan Partal
  • MQL5 / MQL4 Developer 에  MQL5 Freelance
  • 터키
  • 511
MQL5 / MQL4 developer: Expert Advisors, indicators, scripts and utilities
for MetaTrader 5 and MetaTrader 4.
I deliver code that matches your specification, and I show the proof.
With every job you get
- Source code (.mq5/.mq4) and the compiled file, inputs named as in your spec
조회수:
169
평가:
(1)
게시됨:
HistoryGaps.mq5 (12.69 KB) 조회
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

A backtest is only as good as the bars under it. MetaTrader 5 does not warn you when the history has holes: the chart simply draws the next bar, and an Expert Advisor tested over the gap never sees the move that happened inside it. The usual check, counting bars or looking for time jumps, flags every weekend and every daily break, so the real holes are lost in the noise.

This indicator reads the symbol's trading sessions from the symbol specification and expects a bar only when the market was open. Every missing bar is then sorted into one of three kinds, so you can tell a data problem from a holiday.


XAUUSD M15 since November 2023: one real hole of 2 bars, 42 short sessions around holidays, 4 days without bars

The three kinds

  • Hole: bars are missing while the session was open on both sides. This is the one that can change a backtest. Marked with a red line.
  • Short session: the market opened late or closed early, as on Thanksgiving, Christmas Eve or US bank holidays. On such a day, thin-trading gaps count here too. Usually not a data problem.
  • Day with no bars: a trading day by the session table, but not a single bar (Good Friday, 25 December, 1 January on many feeds).

What the panel shows

  • The first date checked. If it is later than you asked for, the terminal holds fewer bars: raise "Max bars in chart" in the terminal settings.
  • Coverage: the share of session bars present, with short sessions and empty days left out
  • Number of holes, bars missing in them, and the largest one with its time
  • Number of short sessions and of days with no bars
  • Whether the history reaches the current server time, or how many bars it stops short

Hover a line on the chart to see the kind, the start and end time, and the number of bars.

Input parameters

  • Days to check: counted back from the last bar.
  • Mark gaps on the chart: draw a vertical line after each hole.
  • Also mark short sessions and empty days: dotted grey lines for those as well.
  • Write a CSV report: every gap with kind, start, end and bars, saved to MQL5\Files\HistoryGaps_<symbol>_<timeframe>.csv.
  • Colours, font size: for dark and light charts.

Notes

It checks the timeframe of the chart it is on, from M1 to D1. Each new day it checks again. The session table is the broker's: if it lists hours the market never trades, those show up as holes, which is worth knowing too. A short session is a guess from where the gap sits; the CSV lets you check any of them. The indicator draws objects only and has no buffers.

Prop Firm Equity Guard daily loss and max drawdown protector Prop Firm Equity Guard daily loss and max drawdown protector

Prop Firm Equity Guard protects prop-firm challenges and funded accounts. It monitors live equity against your daily loss and max drawdown limits, then closes all positions, deletes pending orders and locks trading before the firm's limit is hit. A safety buffer makes it act early, and anything opened while locked is closed instantly. It supports static and trailing drawdown, an optional profit target lock and alerts, saves its state through restarts, and shows an on-chart dashboard with room left and a reset countdown. It works alongside manual trading and other EAs.

Trade History in R Trade History in R

Shows the closed trades of the account in R (net profit divided by the money at risk at entry): expectancy, win rate, drawdown in R, losing streak, per-symbol summary and CSV export.

AesHmac: AES-256 encryption with tamper check and password keys for MQL5 AesHmac: AES-256 encryption with tamper check and password keys for MQL5

One include file that encrypts texts and bytes so only a program with the same key can read them. A wrong key or a changed message is refused instead of read as garbage, keys can come from a password, and the code is checked against the official NIST and RFC test vectors.

Structural Swing Migration BUY Structural Swing Migration BUY

Structural Swing Migration BUY is an educational Expert Advisor for MetaTrader 5 that opens BUY positions when confirmed swing highs and swing lows move upward together. It evaluates closed M15 candles and combines structural confirmation with a volatility threshold and a bullish candle filter.