Loading…

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 · MT4 · v1.0 · Free

About Focus Timer Gating Panel

Focus Timer Gating Panel is a script for MetaTrader 4. It has 6 settings, such as Corner, X offset and Y offset. MQL source code included.

Files in the download: FocusTimerGatingPanel.ex4, FocusTimerGatingPanel.mq4, FocusTimerGatingPanel.txt.

Settings

SettingDefaultWhat it does
Corner0Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right
X offset12Panel offset from the chosen corner, X pixels
Y offset18Panel offset from the chosen corner, Y pixels
Focus seconds120Length of the mandatory cooling-off timer, in seconds
Armed window secs45Once armed, how many seconds the "unlocked" state lasts
Auto restarttrueAutomatically start a new timer once the armed window expires

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria