Environment Fingerprint Writer
Half of every "my EA doesn't work" thread on a forum ends with someone asking which broker, which build, what leverage, what symbol digits and what account type the original poster is running - questions that take five separate lookups to answer and are usually never all supplied at once. This script answers all of them in one line. It reads the account company, server, login, account type (demo, contest or real), leverage, currency, stop-out level and mode, terminal build number and auto-trading permission, then the current symbol's digits, point size, spread, min/max/step lot sizes and stop/freeze levels, and assembles all of it into a single pipe-delimited line. That line is printed to the Experts log, shown in an Alert, and optionally appended to a running log file so fingerprints taken on different days can be compared side by side when chasing a "it worked yesterday" change on the broker's side. Appending rather than overwriting the log file is deliberate - a single snapshot answers "what is my setup right now", but a running log answers the more useful question of "what changed between the working day and the broken one". Notes and limitations Hedging/netting is not reported as a per-account choice because MQL4 accounts are always hedging by platform design - there is no MQL4 equivalent of MQL5's ACCOUNT_MARGIN_MODE to query, so the line always states "Hedging" for that field, which is a statement about the platform, not something read from the broker. Leverage, spread and stop-out figures reflect the live values at the moment the script runs; brokers can and do change these without notice (especially around news events or on lower-liquidity symbols), so a fingerprint taken during a spread widening is not representative of normal trading conditions. The log file is a plain flat file with no size cap - a script run daily for years will produce a log worth periodically archiving or clearing.
Script · MT4 · v1.0 · Free
About Environment Fingerprint Writer
Environment Fingerprint Writer is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Show alert, Append to log and Log file. MQL source code included.
Files in the download: EnvironmentFingerprint.mq4, EnvironmentFingerprint.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Show alert | true | Pop up an Alert() with the fingerprint |
| Append to log | true | Append the line to a running log file |
| Log file | EnvironmentFingerprint.log | Log file name (written to MQL4\Files) |
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 → Scripts.
- 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 script onto a chart to run it once.
Tags: Alerts · MT4 Script · MQL4 Source Code