Source profileQuality 93/100

terrylica/cc-skills/plugins/mql5/skills/tick-collection-ops/SKILL.md

tick-collection-ops

Operate and troubleshoot the MT5 tick collection system. HOST MOVED 2026-08-07 - MT5 now runs on the FXView VPS (Windows scheduled tasks, C:\odb-tickrings), NOT bigblack/Linux-Wine/systemd. EA, ring format and gap-detection reasoning unchanged. Covers gap detection, restart recovery, daily ops.

Source repository stars
61
Declared platforms
0
Static risk flags
1
Last source update
2026-08-26
Source checked
2026-08-28

Decision brief

What it does: where it fits

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

Best for

  • Deploying or restarting tick collection on bigblack
  • Diagnosing tick gaps or missing data
  • Troubleshooting Wine or MT5 issues

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/terrylica/cc-skills --skill "plugins/mql5/skills/tick-collection-ops"
Safe inspection promptEditorial

Inspect the Agent Skill "tick-collection-ops" from https://github.com/terrylica/cc-skills/blob/05f53c5b24a445c1895e9b0590212e66cd70f39e/plugins/mql5/skills/tick-collection-ops/SKILL.md at commit 05f53c5b24a445c1895e9b0590212e66cd70f39e. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    When to Use This Skill

    Deploying or restarting tick collection on bigblack

    Deploying or restarting tick collection on bigblackDiagnosing tick gaps or missing dataTroubleshooting Wine or MT5 issues
  2. 02

    System Architecture

    TickCollector EA runs on MT5 via Wine on headless Linux (bigblack)

    TickCollector EA runs on MT5 via Wine on headless Linux (bigblack)EA captures every tick via OnTick() callback + OnTimer() fallback (1-second interval)Ticks buffered in EA, flushed to Rust DLL (tickwriter.dll) via C-ABI FFI
  3. 03

    Production Topology

    Review the “Production Topology” section in the pinned source before continuing.

    Review and apply the “Production Topology” source section.
  4. 04

    Systemd Service Chain

    All are user-level systemd units. MT5 depends on the display stack. The chain must start in order -- xvfb first, mt5 last.

    All are user-level systemd units. MT5 depends on the display stack. The chain must start in order -- xvfb first, mt5 last.
  5. 05

    Daily File Rotation

    New Parquet file created each trading day

    New Parquet file created each trading dayFilename pattern: {SYMBOL}{YYYYMMDD}.parquetEA detects day change and calls twclose (finalize current file) + twinit (open new file)

Permission review

Static risk signals and limitations

Reads files

low · line 89

The documentation asks the agent to read local files, directories, or repositories.

EA detects day change and calls `tw_close` (finalize current file) + `tw_init` (open new file)

Reads files

low · line 134

The documentation asks the agent to read local files, directories, or repositories.

**Wine cannot follow symlinks** for file access -- use physical file copies for EA and DLL deployment

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score93/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars61SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
terrylica/cc-skills
Skill path
plugins/mql5/skills/tick-collection-ops/SKILL.md
Commit
05f53c5b24a445c1895e9b0590212e66cd70f39e
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

MT5 Tick Collection Operations

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

⚠️ HOST SUPERSEDED — 2026-08-07

MetaTrader 5 no longer runs on bigblack. It runs exclusively on the FXView broker VPS (Tailscale host fxview-mt5, 100.126.202.32, Windows), on demo account 400364. The Mac-local Wine bench was deleted 2026-08-06; bigblack's Wine terminal + its xvfb/xfce/x11vnc desktop and fxview-sidecar are being decommissioned.

On the VPS the topology is Windows scheduled tasks, not Linux systemd:

Concernbigblack (retired)FXView VPS (current)
Terminalmt5.service under Wine, DISPLAY=:99terminal64.exe, native Windows, real session
Tick rings/dev/shm/tick_ring_<SYM>C:\odb-tickrings\tick_ring_<SYM>
Ring → busodb-tapegateway.exe → task OdbTickRingToNatsTapeGateway
Busnats-server.exe :4222 → task OdbTapeBusNatsJetStreamServer
Ordersorder-service :50060 → task ODB-MT5-OrderService
SymbolsEUR/GBP/XAU/XAGEUR/GBP/XAU only (silver excluded per directive 2026-05-26)
Service controlsystemctlGet-ScheduledTask / Start-ScheduledTask

Reach it with ssh fxview-mt5. PowerShell over SSH eats $_ under shell quoting — pass commands base64-encoded via powershell -NoProfile -EncodedCommand <base64-utf16le>.

Everything below still describes the Linux/Wine deployment. It is retained because the EA, the tick_writer.dll ring format and the gap-detection reasoning are unchanged and still authoritative — only the HOST and the service manager moved. Do not use it to stand up a new Linux MT5.

Canonical: opendeviationbar-patterns/docs/adr/2026-08-07-retire-bigblack-as-a-metatrader-host-…md and docs/decision-register-metatrader-hosting-and-market-data-source-provenance.md.

Operate, monitor, and troubleshoot the zero-gap tick collection system running on Linux via Wine.

When to Use This Skill

Use this skill when:

  • Deploying or restarting tick collection on bigblack
  • Diagnosing tick gaps or missing data
  • Troubleshooting Wine or MT5 issues
  • Understanding systemd service topology
  • Investigating crash recovery files
  • Checking tick collection health

System Architecture

TickCollector EA (MQL5)  -->  tick_writer.dll (Rust)  -->  Parquet files
     OnTick() callback         C-ABI FFI                   ZSTD compressed
     CopyTicksRange()          Buffered writes              One file per day
     Watermark dedup            Row group flush
  • TickCollector EA runs on MT5 via Wine on headless Linux (bigblack)
  • EA captures every tick via OnTick() callback + OnTimer() fallback (1-second interval)
  • Ticks buffered in EA, flushed to Rust DLL (tick_writer.dll) via C-ABI FFI
  • Rust DLL writes Parquet files with ZSTD level 3 compression
  • One EA instance per symbol per chart -- this is a CRITICAL constraint (single symbol per EA)

Production Topology

ResourcePath
Git repo~/eon/mql5/
Wine prefix~/.mt5/
MT5 install~/.mt5/drive_c/Program Files/MetaTrader 5/
EA source{repo}/mql5_ea/TickCollector.mq5
DLL (Windows){mt5}/MQL5/Libraries/tick_writer.dll
Tick data{mt5}/tick_data/ (symlinked to ODB cache)
Systemd unitssystemd user units: xvfb, xfce, x11vnc, mt5

Systemd Service Chain

xvfb (virtual framebuffer)
  --> xfce (desktop environment)
    --> x11vnc (VNC access)
      --> mt5 (MetaTrader 5 via Wine)

All are user-level systemd units. MT5 depends on the display stack. The chain must start in order -- xvfb first, mt5 last.

Daily File Rotation

  • New Parquet file created each trading day
  • Filename pattern: {SYMBOL}_{YYYYMMDD}.parquet
  • EA detects day change and calls tw_close (finalize current file) + tw_init (open new file)
  • Trading day runs Sunday open to Monday open (forex hours)

Crash Recovery

On EA restart:

  1. EA calls tw_get_last_time_msc to read resume watermark from the last Parquet file footer
  2. Watermark is the timestamp of the last tick written -- resume from there
  3. If an existing file is found for today, new file gets _1, _2 suffix (not overwrite)
  4. All recovery segments are valid, complete Parquet files with footers
  5. Resume watermark prevents duplicate ticks after restart
  6. Gap between shutdown and restart is backfilled via CopyTicksRange from the watermark

The Rust DLL renames corrupt/incomplete files to _partial suffix rather than attempting recovery.

Gap Detection

Use DuckDB to check for gaps between consecutive ticks:

WITH ticks AS (
    SELECT time_msc,
           lead(time_msc) OVER (ORDER BY time_msc) - time_msc AS gap_ms
    FROM read_parquet('{base_path}/FXVIEW_{SYMBOL}/{YYYY}/{SYMBOL}_{YYYYMMDD}.parquet')
)
SELECT time_msc, gap_ms,
       make_timestamp(time_msc * 1000) AS ts
FROM ticks
WHERE gap_ms > 60000  -- gaps > 1 minute
ORDER BY gap_ms DESC;

Interpreting results:

  • Weekend gaps are normal (Friday close to Sunday open)
  • Mid-session gaps indicate collection interruption
  • Gaps < 1 minute are normal during low-activity periods
  • Check systemd journal for correlating restart events

Wine Gotchas

These are CRITICAL anti-patterns -- violations cause silent crashes or data loss:

  • NEVER use %I64u or %I64d format specifiers in MQL5 -- crashes Wine silently. Use IntegerToString() instead.
  • Wine cannot follow symlinks for file access -- use physical file copies for EA and DLL deployment
  • Headless Linux requires Xvfb virtual framebuffer -- MT5 GUI needs a display even when no monitor is connected
  • compile.sh uses Wine CLI for compilation -- no MetaEditor GUI needed
  • MetaEditor returns exit code 1 even on success under Wine -- check compile log instead
  • Compile log is UTF-16LE -- use iconv -f UTF-16LE -t UTF-8 to read it
  • DISPLAY=:99 must be set (Xvfb virtual display number)

Deployment Pipeline

Use /mql5:mql5-ship slash command for full deployment:

  • --ea-only for EA source changes
  • --dll-only for Rust DLL changes
  • Full pipeline: commit -> push -> pull on bigblack -> compile -> validate

Detailed deployment steps (SSH commands, file copies, compilation) are in the headless-mt5-remote local skill. Not duplicated here to avoid drift.

Monitoring Commands

Check MT5 service status

systemctl --user status mt5

Check today's tick files

ls -la ~/.cache/opendeviationbar/ticks/FXVIEW_EURUSD/$(date +%Y)/

Count ticks in latest file

duckdb -c "SELECT count(*) FROM read_parquet('path/to/file.parquet')"

Check for recovery segments

ls ~/.cache/opendeviationbar/ticks/FXVIEW_EURUSD/$(date +%Y)/*_[0-9].parquet 2>/dev/null

View systemd service chain

systemctl --user list-units --type=service | grep -E "xvfb|xfce|x11vnc|mt5"

Check MT5 journal for errors

journalctl --user -u mt5 --since "1 hour ago" --no-pager

Scope Boundary

  • This skill: Operations, monitoring, troubleshooting
  • headless-mt5-remote local skill: Deployment steps (SSH, file copy, compilation)
  • fxview-parquet-consumer skill: Data consumption patterns (schema, DuckDB queries)

Troubleshooting

IssueCauseSolution
MT5 service won't startDisplay stack not runningStart xvfb first, then xfce, x11vnc, mt5
EA not collecting ticksSymbol not in Market WatchOpen chart for symbol in MT5, re-attach EA
Wine crash on PrintFormatUsing %I64u/%I64d specifiersReplace with IntegerToString()
DLL load failureMissing tick_writer.dllCopy DLL to MQL5/Libraries/ (physical copy)
Gaps in tick dataEA restart or network issueCheck journalctl, verify recovery segments exist
Recovery file _1_2Normal after restartAll segments are valid, union in DuckDB
Compile log unreadableUTF-16LE encodingUse iconv -f UTF-16LE -t UTF-8
Xvfb not runningService crashed or not enabledsystemctl --user start xvfb

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

Frequently asked questions

What to verify before installation and use

What does the tick-collection-ops source document cover?

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

How do I install tick-collection-ops?

The source record exposes this install command: npx skills add https://github.com/terrylica/cc-skills --skill "plugins/mql5/skills/tick-collection-ops". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged read-files in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing