Opening Range Level Drawer
An opening range strategy needs the range drawn correctly before anything else about it can be judged. This script marks the high and low of a chosen window, in GMT so it means the same thing on every broker's server clock, for as many recent days as you ask for, and extends each level forward so a breakout is easy to see forming. The window is read straight from the bars already loaded on the chart the script is run on, not from a separate minute-data fetch. That keeps it fast and dependency-free, but it also means the resolution of the range is whatever timeframe the chart is showing. A 30-minute opening range read off an H1 chart is really "the H1 bar nearest the open", not a genuine 30-minute high and low - put the script on M5 or lower when the window is narrow. Optional extension targets are projected above the high and below the low at chosen multiples of the range itself (1x and 1.618x by default), the same "measured move" logic many opening-range breakout traders already use by hand, drawn automatically for every day in the lookback instead of one at a time. Notes and limitations - Resolution matches the chart's own timeframe, not the window width - see the full description above. - A day with no bars inside the window (weekend, holiday, or a window older than the loaded history) is silently skipped and counted in the summary rather than drawn with a false zero range. - The broker-to-GMT offset is read once per run by comparing TimeGMT() with TimeCurrent(). It is a snapshot of the current clock difference, not tracked across the lookback, so a wall can drift by an hour around a daylight-saving change on either side. - This is a drawing aid only - it does not detect a breakout, generate a signal, or place any order.
Script · MT4 · v1.0 · Free
About Opening Range Level Drawer
Opening Range Level Drawer is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as Window start gmt, Window minutes and Days back. MQL source code included.
Files in the download: OpeningRangeLevelDrawer.ex4, OpeningRangeLevelDrawer.mq4, OpeningRangeLevelDrawer.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Window start gmt | 8 | Window open, GMT hour (0-23) - e.g. 8 for London |
| Window minutes | 30 | Width of the opening window, minutes |
| Days back | 10 | How many days back to mark |
| Extend hours | 6 | Hours the OR lines / targets are drawn forward |
| Show extensions | true | Draw breakout extension targets |
| Extension multiple1 | 1.0 | First extension, multiples of the OR range |
| Extension multiple2 | 1.618 | Second extension, multiples of the OR range |
| Show labels | true | Draw price labels on each line |
| High color | clrDodgerBlue | Opening range high colour |
| Low color | clrOrangeRed | Opening range low colour |
| Extension color | clrGoldenrod | Extension target colour |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Breakout · Trading Sessions · Alerts · MT4 Script · MQL4 Source Code