Loading…

Focus Mode Overlay

A busy chart during live execution - trendlines from analysis, other indicators' labels, old markup - competes for attention with the two things that actually matter at the moment of pulling the trigger: price, and whatever plan or tool you are executing against. This overlay gives that a single hotkey. Rather than faking a "dim" effect (MQL4 objects have no opacity control, only an on/off visibility mask), Focus Mode hides distractions outright. The honesty is in the restore: before hiding anything, it reads each object's actual per-timeframe visibility mask (OBJPROP_TIMEFRAMES) and remembers it, so pressing the hotkey again restores the chart to precisely what it looked like before - including any objects that were already deliberately hidden on other timeframes before Focus Mode was ever turned on. A blanket "make everything visible again" would have quietly undone that. Objects whose name starts with a chosen prefix (your plan lines, your active drawing tool) are skipped entirely and stay visible and untouched throughout. Notes and limitations Up to 500 objects can be tracked per focus session (MAX_TRACKED); a chart with more non-kept objects than that will stop hiding once the cap is reached rather than silently overrunning a fixed array. 500 comfortably covers ordinary chart clutter. Objects created or deleted by other tools while Focus Mode is active are handled gracefully on restore (a since-deleted object is simply skipped), but any object CREATED while focused was never hidden in the first place and will already be visible - Focus Mode only affects what existed at the moment it was turned on. MQL4 has no per-window height control exposed to indicator code, so this tool only manages object visibility on the main chart window - it does not compress or hide indicator subwindows below the price chart. Toggling relies on the chart having keyboard focus (click the chart first); this is standard MetaTrader keyboard-event behaviour, not specific to this tool.

Indicator · MT5 · v1.0 · Free

About Focus Mode Overlay

Focus Mode Overlay is an indicator for MetaTrader 5. It has 3 settings, such as Keep prefix, Toggle key and Banner colour. MQL source code included.

Files in the download: FocusModeOverlay.ex5, FocusModeOverlay.mq5, FocusModeOverlay.txt.

Settings

SettingDefaultWhat it does
Keep prefixPLAN_Name prefix of objects to KEEP visible in focus mode (your plan/tool)
Toggle key'F'Key that toggles focus mode (uppercase letter or VK code)
Banner colourclrDarkOrangeColour of the "FOCUS MODE" banner text

How to install

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

Download the PDF guide

Tags: Trend · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria