Loading…

Seasonal Strategy Scheduler

A seasonal trader who has identified specific calendar windows worth trading (a month-end effect, a pre-holiday drift, a historically directional week) still has to remember to switch the strategy on and off by hand, and a hand toggle is exactly the kind of thing that gets forgotten on a Friday. This EA separates "when am I allowed to trade" from "what do I trade" completely. The trading logic is a plain fast/slow moving-average cross on the chart's own symbol and period - deliberately simple, since the point of this EA is the scheduling layer around it, not a novel signal. On every check interval it reloads InpConfigFile, a list of MM.DD-MM.DD date windows, and checks whether today's date falls inside any of them. Outside every window the position is forced flat and the trading signal is not even evaluated; inside a window, the signal runs normally, opening, holding or flipping a single ticket under this EA's own magic number. The window comparison correctly handles a range that wraps the year boundary (e.g. "12.20-01.10" for a year-end effect) - a plain "today >= start && today <= end" check silently fails the moment a window crosses from December into January, since the numeric day-of-year comparison inverts across that boundary. This EA detects a wrapped window (start code greater than end code) and switches to an OR comparison for those rows instead. Notes and limitations - Windows are matched on calendar month and day only, not year - a window applies every year the EA runs, which is the intended seasonal behaviour, not a bug. - The config file is reloaded from disk every check interval; a change only takes effect from the next check onward, not immediately. - A malformed window line is skipped and logged rather than aborting the whole file. - Overlapping windows are supported (today only needs to match one of them) but are not merged or deduplicated - listing the same window twice has no extra effect. - The built-in trading logic is intentionally simple (one fast/slow MA cross); swapping in a different underlying strategy means editing the TradingSignal() function directly. - No stop-loss or take-profit is placed by this EA.

Expert advisor · MT5 · v1.0 · Free

About Seasonal Strategy Scheduler

Seasonal Strategy Scheduler is an expert advisor (trading robot) for MetaTrader 5 based on Moving Average. It has 11 settings, such as Config file, Fast ma period and Slow ma period. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Config fileSeasonalWindows.csvFile under MQL5\Files\ - see .txt for the exact format
Fast ma period10Fast MA period for the built-in trading logic
Slow ma period30Slow MA period for the built-in trading logic
Ma methodMODE_EMAMA method used by both lines
Lots0.10Fixed lot size for the built-in trading logic
Magic number20274001Magic number identifying this scheduler's own position
Slippage pips5Slippage allowance, in pips
Check interval seconds300Seconds between window/config re-checks
Dry runfalsetrue = log intended actions only, never trades
Max retries5Attempts per order 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: Moving Average · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria