Loading…

Timeframe Consistency Checker

A chart's higher-timeframe candles are not measured independently by the terminal - they are supposed to be exactly what you would get by aggregating the underlying minute bars, but a gap in the M1 history, a late tick that arrived after the higher-timeframe bar had already closed, or a history file built at a different point in time can leave the native candle and its M1 reconstruction disagreeing. Nothing in the terminal checks this automatically; it usually only surfaces as an unexplained discrepancy between two tools reading the same symbol differently. This indicator attaches to any timeframe above M1 and, for each of the most recent InpBarsToCheck closed bars, finds the exact M1 bars that fall inside that bar's time window, aggregates their open (of the first M1 bar), high (the highest M1 high), low (the lowest M1 low) and close (of the last M1 bar), and compares all four figures against the chart's own native OHLC for that bar. A bar is only compared if its full M1 window is actually loaded and gap-free at the boundary - a partially-loaded window is skipped rather than reported as a false mismatch, because missing data and disagreeing data are two different problems and conflating them would train a trader to ignore real mismatches as "probably just missing history". Mismatches beyond InpToleranceInPoints are marked with a chart object on the native bar and plotted as a histogram of the worst single OHLC difference (in points) in the subwindow, so a trader can see at a glance whether a chart's history is trustworthy before building analysis on it. Notes and limitations - Requires the underlying M1 history to actually be loaded for the window being checked; a bar whose M1 window is not fully available is silently skipped rather than flagged, and will show as a gap in the histogram rather than as a mismatch. - Does nothing on an M1 chart itself - there is no finer series to reconstruct M1 from. - Only checks OHLC, not tick volume or spread; a difference confined to volume/spread reporting between the native bar and its M1 aggregation is not detected. - The check only re-scans the newest closed bar(s) after the first pass to avoid needless repeated work; a chart with a very large InpBarsToCheck attached fresh can take a moment to complete its first full pass.

Indicator · MT5 · v1.0 · Free

About Timeframe Consistency Checker

Timeframe Consistency Checker is an indicator for MetaTrader 5. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Bars to check, Tolerance in points and Alert on mismatch. MQL source code included.

Files in the download: TimeframeConsistencyChecker.ex5, TimeframeConsistencyChecker.mq5, TimeframeConsistencyChecker.txt.

Settings

SettingDefaultWhat it does
Bars to check100How many of the most recent closed native bars to check
Tolerance in points2.0A per-price diff at or below this many points is not flagged
Alert on mismatchtrueAlert once per newly-found mismatched bar
Draw markerstrueMark mismatched bars with a chart object on the main window

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Buy/Sell Arrows · Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria