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
| Setting | Default | What it does |
|---|---|---|
| Config file | SeasonalWindows.csv | File under MQL5\Files\ - see .txt for the exact format |
| Fast ma period | 10 | Fast MA period for the built-in trading logic |
| Slow ma period | 30 | Slow MA period for the built-in trading logic |
| Ma method | MODE_EMA | MA method used by both lines |
| Lots | 0.10 | Fixed lot size for the built-in trading logic |
| Magic number | 20274001 | Magic number identifying this scheduler's own position |
| Slippage pips | 5 | Slippage allowance, in pips |
| Check interval seconds | 300 | Seconds between window/config re-checks |
| Dry run | false | true = log intended actions only, never trades |
| Max retries | 5 | Attempts per order 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: Moving Average · MT5 Expert Advisor · MQL5 Source Code