Loading…

Turn Of Month System

The turn-of-month effect - a persistent positive-drift edge across the last few trading days of a month through the first few of the next - is well documented in equity indices, generally attributed to institutional rebalancing and payroll-driven inflows around calendar month boundaries. This EA trades that window mechanically on a single forex symbol: it opens a position (long by default) when the current day falls within InpDaysBeforeMonthEnd days of month-end or within InpDaysAfterMonthStart days of the new month, and closes it the day the window ends. The honest caveat, stated here because it belongs in the description and not just buried in the notes: the equity-index evidence rests on many decades of monthly samples across a market with a genuine common flow (index fund rebalancing). A single forex pair over any realistically backtestable history offers far fewer independent monthly observations, and no single institutional flow drives it the way index rebalancing drives equities. Treat this as a mechanical implementation of a documented calendar pattern worth testing on your own data, not as a proven forex edge. Notes and limitations - Forex sample size is thin: even ten years of history is only around 120 monthly windows for one symbol - not enough to draw strong statistical conclusions, only enough to see whether the pattern shows up at all on the instrument you care about. - Only one position at a time; the EA does not pyramid across the window. - The window is evaluated in calendar days, not trading days - a month-end that falls on a weekend still counts by calendar date, and the actual entry happens on the next available Daily bar. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.

Expert advisor · MT5 · v1.0 · Free

About Turn Of Month System

Turn Of Month System is an expert advisor (trading robot) for MetaTrader 5. It can size trades from your balance and risk percent. It has 12 settings, such as Days before month end, Days after month start and Direction. MQL source code included.

Files in the download: TurnOfMonthSystem.ex5, TurnOfMonthSystem.mq5, TurnOfMonthSystem.txt.

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

Settings

SettingDefaultWhat it does
Days before month end1Calendar days before month-end that the window opens (day > daysInMonth - N)
Days after month start3Calendar days into the new month the window stays open (day <= N)
DirectionTOM_LONGTrade direction for the whole window
Require daily charttrueRefuse to trade unless attached to a Daily (D1) chart
Safety stop pips100Catastrophic stop, in pips (protects the window trade against a bad month)
Use risk sizingtrueSize by percent risk to the stop 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 sizing fallback
Magic number35601Magic 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: Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria