Weekly Open Drive System
The weekly open is a reference many discretionary traders watch, but most mechanical versions of the idea trade the first poke through it, which is noisy - a single bar crossing the level says very little. This system requires a genuine DRIVE instead: the last InpConfirmBars closed bars must all have closed beyond the weekly open by at least InpDriveAtrMultiple times ATR, on the same side, before an entry is considered at all. That sustained displacement is then cross-checked against a second, independent reference - today's midnight open (the current daily bar's open). The drive only trades if the midnight open sits on the same side of the weekly open as the drive itself, which filters out weeks where price wandered across the weekly open early on and the current day's own session is not actually continuing the same move. The midnight open earns a second job once in the trade: it is the failure cutoff. If price trades back through today's midnight open after entry, the position is closed immediately regardless of the stop or target - the confirming reference has been given back, and the premise for the trade no longer holds. Only one drive is taken per calendar week. Notes and limitations - One drive per calendar week, tracked from the weekly bar's own open time - a second qualifying drive later the same week is not taken even if the first one has already closed. - The failure cutoff closes on the midnight open of the CURRENT server day, which advances as the trade runs into later days if it is held that long; it is not fixed to the day the trade was opened. - The initial stop is set relative to the midnight open, not the entry price, so its distance from entry varies with how far the drive had already run before the confirmation bars completed. - Weekly and daily opens are read directly from PERIOD_W1/PERIOD_D1 history; on a symbol with very short history this can return zero until enough higher-timeframe bars exist, and the EA simply waits. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.
Expert advisor · MT5 · v1.0 · Free
About Weekly Open Drive System
Weekly Open Drive System is an expert advisor (trading robot) for MetaTrader 5 based on ATR. It can size trades from your balance and risk percent. It has 12 settings, such as Drive atr multiple, Confirm bars and Atr period. MQL source code included.
Files in the download: WeeklyOpenDriveSystem.ex5, WeeklyOpenDriveSystem.mq5, WeeklyOpenDriveSystem.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Drive atr multiple | 1.0 | Minimum distance beyond the weekly open, in ATR multiples, to count as a drive |
| Confirm bars | 3 | Consecutive closed bars required beyond that distance before entry |
| Atr period | 14 | ATR period used for the drive distance and the initial stop buffer |
| Stop atr multiple | 1.0 | Extra ATR buffer added beyond the midnight open for the initial stop |
| Target atr multiple | 4.0 | Take profit distance from entry, ATR multiples |
| Use risk sizing | false | Size by percent risk to the initial stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, used only when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Magic number | 20260365 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: ATR · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code