Level Touch Logger
A level that gets touched and reacts away from it behaves very differently from one that gets touched and pushed straight through, and relying on memory to tell the two apart across dozens of levels and weeks of price action does not hold up. This EA watches a configured list of horizontal price levels and, the moment Bid comes within a tolerance band of one, logs the touch - the level, the exact touch price, and whether price approached from above or below. It then waits InpReactionSeconds and logs a second figure: price at that later moment, expressed both as a signed pip move from the touch price and as a plain UP/DOWN/FLAT direction, giving one combined row per touch with both halves of the story. A level only re-arms for a fresh touch once price has moved clear of the tolerance band and come back - without this, a slow drift straight through a level would log dozens of touches a second instead of the one meaningful approach. Pending reactions awaiting their measurement time are held in a capped queue; if the cap is reached the oldest unmeasured entry is dropped rather than growing without bound, which only matters on an unusually busy level list with a long InpReactionSeconds window. Notes and limitations - Levels are specific to one symbol's price units - the same InpLevels string is not meaningful across different symbols. - Touches are based on Bid only; a level that only Ask ever crosses will not register, and vice versa for a level defined against Ask-side logic. - A single row is only written once the reaction window has elapsed - a touch near the end of a session, or right before the EA is removed, may never get its reaction measured and logged. - The re-arm rule (must clear the tolerance band before a level can touch again) means genuinely fast repeated tests of the same level within the band are counted as one touch, not several. - This EA never places, modifies or closes any order.
Expert advisor · MT5 · v1.0 · Free
About Level Touch Logger
Level Touch Logger is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Levels, Touch tolerance pips and Reaction seconds. MQL source code included.
Files in the download: LevelTouchLogger.ex5, LevelTouchLogger.mq5, LevelTouchLogger.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Levels | 1.10000,1.09500,1.10500 | Comma-separated price levels to watch |
| Touch tolerance pips | 2.0 | How close price must come to a level to count as a touch |
| Reaction seconds | 300 | Seconds after a touch to measure the reaction |
| Log file name | LevelTouchLogger.csv | CSV log, in MQL5\Files\ |
| Max pending reactions | 200 | Cap on reactions awaiting measurement, oldest dropped beyond this |
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: Price Action · Alerts · MT5 Expert Advisor · MQL5 Source Code