Loading…

Day Of Week EA

Day-of-week effects - a symbol tending to drift a certain way on, say, Mondays or Fridays - show up in plenty of published research, but the direction is genuinely symbol-, broker- and era-specific. There is no mechanical rule that reads the correct direction off the market itself; anyone trading this style found the bias by studying their own history first. This EA is a framework for acting on a bias you already found, not a signal generator that claims to know one - InpBuyDirection is set by you, from your own backtest, and the EA does exactly that and nothing more. Deduplication is by calendar date rather than a week number: since the configured weekday occurs at most once in any seven-day span, a plain "already traded this date" guard is exactly as correct as tracking ISO week numbers, without the extra date arithmetic that would require. An optional InpFlattenHour forces the position closed at a fixed hour later the same day, for traders who want the day-of-week trade contained to a single session rather than held further. Notes and limitations - Signals are evaluated once per closed bar, so the entry actually fires on the first bar whose open time is at or after InpEntryHour: InpEntryMinute. On an H1 chart that rounds InpEntryMinute down to the hour; run on M1 or M5 for an exact-minute entry. - At most one trade per week, and one position at a time, tracked by InpMagicNumber. - The EA takes InpBuyDirection on faith - it does not verify the bias is still present. Seasonality patterns drift and can disappear entirely; re-check the study periodically rather than assuming it holds forever. - Requires AutoTrading enabled and trading permitted at the terminal, account and Expert Advisor level; if trading is disabled the EA logs it and skips the entry, on both platforms.

Expert advisor · MT4 · v1.0 · Free

About Day Of Week EA

Day Of Week EA is an expert advisor (trading robot) for MetaTrader 4. It can size trades from your balance and risk percent. It has 14 settings, such as Trade day of week, Entry hour and Entry minute. MQL source code included.

Files in the download: DayOfWeekEa.ex4, DayOfWeekEa.mq4, DayOfWeekEa.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Trade day of week1Weekday to trade: 0=Sunday, 1=Monday ... 6=Saturday
Entry hour0Server hour for the entry check (0-23)
Entry minute0Server minute for the entry check (0-59)
Buy directiontruetrue = buy on the selected day, false = sell - set from your own study
Stop loss pips30Stop loss distance, in pips
Take profit pips60Take profit distance, in pips (0 = none)
Flatten hour-1Server hour to force-close any open position (-1 = never)
Use risk sizingfalseSize by percent risk instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260815Magic 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 4 open File → Open Data Folder, then go to MQL4 → Experts.
  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 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: Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria