Loading…

Daily Open Recross Study

Any strategy that treats the daily open as a pivot - fading back to it, or trading a break-and-hold above or below it - is implicitly betting on how often price actually recrosses that level during the day. This script measures that directly: for every qualifying day in the requested H1 history it tracks which side of the day's own open each hourly close sits on, counts every time that side flips, and records how many hours after the open the first flip happened, when there was one. The result is a distribution - how many days had zero, one, two, three or four-or-more recrosses - plus the average recrosses per day and the average time to the first recross among the days that had one. A symbol or timeframe where most days sit at zero or one recross behaves very differently, for a pivot-style strategy, from one where three or four is typical, and this script puts a number on which one a given history actually shows. The daily open used is the open of that day's first H1 bar, which is the same value as the D1 bar's own open whenever the two timeframes share a day boundary - the whole study runs off the H1 series alone, so there is no cross-timeframe alignment to get wrong. Notes and limitations - "Day" is a calendar day in server time, read from each bar's own iTime(); it is not adjusted for a broker's own session-rollover convention beyond that. - An exact touch of the open (close equals the open price precisely) is not counted as a recross on its own; the side only changes on a genuine cross to the other side. - Days with fewer than InpMinBarsPerDay bars (typically thin holiday sessions) are excluded from the sample and counted separately. - This is a historical base-rate study, not a live signal generator - it does not place, size or manage trades.

Script · MT4 · v1.0 · Free

About Daily Open Recross Study

Daily Open Recross Study is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Symbol, Max bars and Min bars per day. MQL source code included.

Files in the download: DailyOpenRecrossStudy.mq4, DailyOpenRecrossStudy.txt.

Settings

SettingDefaultWhat it does
SymbolSymbol to study, blank = this chart's symbol
Max bars6000Most recent H1 bars to include (bounds runtime on long history)
Min bars per day12Minimum H1 bars a day must have to be counted (excludes thin holiday sessions)

How to install

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

Download the PDF guide

Tags: Pivot Points · Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria