Daily Integrity Sealer
Read the honesty note first: MQL4 ships no cryptographic hash function, and this catalogue's rules forbid importing a DLL to add one. What this EA produces is FNV-1a, a fast non-cryptographic checksum. A seal proves a file was not altered or truncated after sealing. It proves nothing about who produced the file, and is trivial to forge deliberately by anyone with a text editor who edits both the file and the manifest to match. That makes it tamper-EVIDENCE, not a digital signature - useful as a basic "has anything under this day's manifest changed since sealing" check, never something to present to a compliance reviewer as cryptographic proof. This EA is meant to run alongside the recorder-style tools elsewhere in this catalogue (drawing-activity logs, telemetry beacons, trade journals) that already stamp their filenames with the day they were written. It does not write those files itself - once a day, at a configurable local hour, it scans the sandbox for files matching a wildcard pattern, computes an FNV-1a-32 checksum of each file's raw bytes, and writes one manifest CSV listing every sealed filename, its size and its checksum. The manifest's own body is then sealed too, with a MANIFEST_SELF_SEAL line, so tampering with the manifest after the fact is itself detectable rather than being the one unprotected file in the chain. Files are hashed in binary mode, not read as text, so the checksum covers the exact bytes on disk regardless of line-ending convention or encoding. Notes and limitations Not a cryptographic signature - see the honesty note above. A manifest is only written once per day per this EA instance; if a manifest for that date already exists (from an earlier run or a restart), sealing is skipped rather than overwritten, so delete the old manifest by hand to force a reseal. Only files present in the sandbox at the sealing moment are covered - a file written after the seal hour that day is picked up the following day's run, not retroactively added to an already-written manifest. Sealing reads whole files into memory to hash them; extremely large files sealed this way would be slow, though the CSV/text logs this is designed around are not expected to reach that size in normal use.
Expert advisor · MT5 · v1.0 · Free
About Daily Integrity Sealer
Daily Integrity Sealer is a script for MetaTrader 5. It has 4 settings, such as File pattern, Seal hour local and Check minutes. MQL source code included.
Files in the download: DailyIntegritySealer.ex5, DailyIntegritySealer.mq5, DailyIntegritySealer.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| File pattern | *.csv | Wildcard filter for files to seal (FileFindFirst syntax, one pattern) |
| Seal hour local | 23 | Local hour of day to run the daily seal (0-23) |
| Check minutes | 5 | How often to check whether it is time to seal, minutes |
| Seal on start | false | Also seal today's files immediately on attach (useful for testing) |
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: Bitcoin & Crypto · MT5 Expert Advisor · MQL5 Source Code