Mandatory Cooldown Panel
Revenge trading and over-trading both share a mechanism: a trade closes, the emotional response to it fires, and a new trade goes in within seconds while judgement is still compromised. A discipline rule written on a sticky note does nothing to stop that moment. This EA puts a large, impossible-to-miss panel on the chart that turns red the instant a trade opens and counts down the configured cooldown minutes before turning green again - and it backs the panel with real enforcement, not just a display. No program running in a terminal can reach into the click that sends a manual order and refuse it before the order exists - that is simply how MetaTrader 4 works, and nothing changes that. What this EA does instead is notice a new matching position the moment it appears and close it again, polling on a fast millisecond timer rather than waiting for the next price tick, so a trade opened during the cooldown survives only a few hundred milliseconds before it is closed and logged. Ignoring the panel costs a round-trip spread, not a real trade - close enough to instant that it removes the incentive to test it. The cooldown clock is keyed to whichever matching trade - open or already closed - has the most recent open time, so it resets on every new trade rather than only after a loss, which is the point: this is a pacing control for trading frequency in general, not a loss-streak circuit breaker like a dedicated cooldown-after-losses EA would be. Notes and limitations This EA cannot prevent an order from being sent, only close it again after it appears - a trade that opens and is manually closed by the trader within the poll interval could, in principle, escape notice. It also cannot see trading done from a different terminal or account. The cooldown timer is based on trade open time, not on when a trade closes, so several trades opened in quick succession before the first close does not reset the timer further out than the earliest of them. Treat it as a strong, mostly automatic pacing control, not an absolute guarantee.
Expert advisor · MT5 · v1.0 · Free
About Mandatory Cooldown Panel
Mandatory Cooldown Panel is an expert advisor (trading robot) for MetaTrader 5. It has 11 settings, such as Cooldown minutes, Magic filter and This symbol only. MQL source code included.
Files in the download: MandatoryCooldownPanel.ex5, MandatoryCooldownPanel.mq5, MandatoryCooldownPanel.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 |
|---|---|---|
| Cooldown minutes | 15 | Minutes required between trades before a new one is allowed to stand |
| Magic filter | -1 | Magic number watched and enforced, -1 = every magic number |
| This symbol only | false | Restrict watching and enforcement to this chart's symbol only |
| Dry run | false | true = alert only, never closes - use to observe before enforcing |
| Poll ms | 250 | Milliseconds between enforcement checks (timer driven, not tick driven) |
| Max retries | 5 | Attempts per close before giving up |
| Retry wait ms | 300 | Pause between attempts, milliseconds |
| Panel x | 20 | Panel X offset, pixels from the chart corner |
| Panel y | 20 | Panel Y offset, pixels from the chart corner |
| Locked color | clrFireBrick | Panel background while the cooldown is active |
| Ready color | clrDarkGreen | Panel background while ready to trade |
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: MT5 Expert Advisor · MQL5 Source Code