Panic Suite Panel
A panic button that fires on a single click is itself a hazard - the whole point of a panic suite is that a mis-click under stress must not become the accident. Every action on this panel is a two-step arm-then-confirm: the first click arms it and turns the button red with a "CONFIRM?" label for five seconds, and only a second click on the same button inside that window actually executes. Letting the window expire disarms automatically, so an accidental first click alone does nothing. FLATTEN closes every open position matching the magic filter. HEDGE opens one opposite-direction order per open symbol sized to that symbol's net exposure, neutralising direction without closing the original tickets - useful when you want to step away without locking in the result yet. HALVE closes fifty percent of every matching position, skipping a ticket whose remaining volume is already too small to halve at the broker's lot step. FREEZE is a toggle: the first confirm publishes a GlobalVariable ("PanicSuite_FreezeNewEntries") that other guard EAs can check before opening new positions, and cancels every own-magic pending order; confirming again lifts the flag. FREEZE cannot force a foreign EA to stop by itself - the reading EA has to check the flag. Every market action checks the live spread against InpMaxSpreadPips per symbol before sending, skipping (and reporting, not silently) any leg currently too wide to execute cleanly rather than firing into a bad price during exactly the kind of volatile moment this panel exists for. Notes and limitations - FREEZE only publishes a shared flag and clears this account's own pending orders; it has no power over any EA that does not itself check "PanicSuite_FreezeNewEntries" before opening a trade. - HEDGE opens new market orders to neutralise net exposure; it does not close anything, so both the original tickets and the new hedge tickets remain open and continue to affect margin. - A leg skipped for spread is not retried automatically; press the same confirmed action again once the spread normalises. - HALVE skips a ticket whose lot size cannot be split at the symbol's lot step without leaving a remainder below the minimum lot. - The five-second confirm window is fixed in this version, not an input, to keep the safety behaviour consistent across every installation of this panel.
Expert advisor · MT4 · v1.0 · Free
About Panic Suite Panel
Panic Suite Panel is an expert advisor (trading robot) for MetaTrader 4. It can hold buy and sell positions at the same time (hedging). It has 8 settings, such as Magic number, Max spread pips and Slippage pips. MQL source code included.
Files in the download: PanicSuitePanel.ex4, PanicSuitePanel.mq4, PanicSuitePanel.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 |
|---|---|---|
| Magic number | 0 | Magic filter for FLATTEN/HALVE/HEDGE (0 = act on every own-EA order type, any magic) |
| Max spread pips | 5.0 | Maximum acceptable spread, in pips, before a leg is skipped rather than sent |
| Slippage pips | 5 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per leg before giving up on it |
| Retry wait ms | 400 | Pause between attempts, milliseconds |
| Corner | 1 | Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right |
| X offset | 12 | Panel offset from the chosen corner, X pixels |
| Y offset | 18 | Panel offset from the chosen corner, Y pixels |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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: Hedging · Trading Sessions · MT4 Expert Advisor · MQL4 Source Code