Loading…

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

SettingDefaultWhat it does
Drive atr multiple1.0Minimum distance beyond the weekly open, in ATR multiples, to count as a drive
Confirm bars3Consecutive closed bars required beyond that distance before entry
Atr period14ATR period used for the drive distance and the initial stop buffer
Stop atr multiple1.0Extra ATR buffer added beyond the midnight open for the initial stop
Target atr multiple4.0Take profit distance from entry, ATR multiples
Use risk sizingfalseSize by percent risk to the initial stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, used only when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260365Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

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 → Experts.
  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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: ATR · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria