Focus Timer Gating Panel
Most discipline problems are not a lack of a plan - they are clicking too fast after a loss or a missed move. This panel adds friction on purpose. It runs a countdown timer (default two minutes) that must reach zero before the "Arm Entry" button does anything at all. Once armed, a short window opens (default 45 seconds) during which the trader is free to place an order manually through the terminal as normal; the panel never sends, modifies, or closes an order itself. When the armed window expires the timer restarts automatically, so the discipline gate re-applies to the next decision rather than staying unlocked forever after the first successful click. The state machine is three states - waiting, ready, armed - driven off TimeCurrent() on a one-second EventSetTimer, not off ticks, so the countdown keeps moving even on a quiet symbol between ticks. Notes and limitations This tool never places, modifies, or closes an order - it is a pure timing gate, not a trading system. It has no memory of past sessions: removing and reattaching the EA, or restarting the terminal, resets the timer to the cooling-off state, which is the intended behaviour for a discipline tool rather than a bug. The armed window does not prevent trading through other charts or other EAs; it only governs whether the trader feels "cleared" to act on this particular chart.
Expert advisor · MT5 · v1.0 · Free
About Focus Timer Gating Panel
Focus Timer Gating Panel is a script for MetaTrader 5. It has 6 settings, such as Corner, X offset and Y offset. MQL source code included.
Files in the download: FocusTimerGatingPanel.ex5, FocusTimerGatingPanel.mq5, FocusTimerGatingPanel.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Corner | 0 | 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 |
| Focus seconds | 120 | Length of the mandatory cooling-off timer, in seconds |
| Armed window secs | 45 | Once armed, how many seconds the "unlocked" state lasts |
| Auto restart | true | Automatically start a new timer once the armed window expires |
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 → Scripts.
- 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 script onto a chart to run it once.
Tags: MT5 Expert Advisor · MQL5 Source Code