python-workspace

Python workspace for MQL5 integration. TRIGGERS - MetaTrader 5 Python, mt5 package, MQL5-Python setup.

29 stars

Best use case

python-workspace is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Python workspace for MQL5 integration. TRIGGERS - MetaTrader 5 Python, mt5 package, MQL5-Python setup.

Teams using python-workspace should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/python-workspace/SKILL.md --create-dirs "https://raw.githubusercontent.com/terrylica/cc-skills/main/plugins/mql5/skills/python-workspace/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/python-workspace/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How python-workspace Compares

Feature / Agentpython-workspaceStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Python workspace for MQL5 integration. TRIGGERS - MetaTrader 5 Python, mt5 package, MQL5-Python setup.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# MQL5-Python Translation Workspace Skill

Seamless MQL5 indicator translation to Python with autonomous validation and self-correction.

---

> **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.

## When to Use This Skill

Use this skill when the user wants to:

- Export market data or indicator values from MetaTrader 5
- Translate MQL5 indicators to Python implementations
- Validate Python indicator accuracy against MQL5 reference
- Understand MQL5-Python workflow capabilities and limitations
- Troubleshoot common translation issues

**Activation Phrases**: "MQL5", "MetaTrader", "indicator translation", "Python validation", "export data", "mql5-crossover workspace"

---

## Core Mission

**Main Theme**: Make MQL5-Python translation **as seamless as possible** through:

1. **Autonomous workflows** (headless export, CLI compilation, automated validation)
1. **Validation-driven iteration** (>=0.999 correlation gates all work)
1. **Self-correction** (documented failures prevent future mistakes)
1. **Clear boundaries** (what works vs what doesn't, with alternatives)

**Project Root**: `~/Library/Application Support/CrossOver/Bottles/MetaTrader 5/drive_c`

---

## Workspace Capabilities Matrix

### WHAT THIS WORKSPACE CAN DO

#### 1. Automated Headless Market Data Export (v3.0.0)

**Status**: PRODUCTION (0.999920 correlation validated)

**What It Does**:

- Fetches OHLCV data + built-in indicators (RSI, SMA) from any symbol/timeframe
- True headless via Wine Python + MetaTrader5 API
- No GUI initialization required (cold start supported)
- Execution time: 6-8 seconds for 5000 bars

**Command Example**:

```bash
CX_BOTTLE="MetaTrader 5" \
WINEPREFIX="$HOME/Library/Application Support/CrossOver/Bottles/MetaTrader 5" \
wine "C:\\Program Files\\Python312\\python.exe" \
  "C:\\users\\crossover\\export_aligned.py" \
  --symbol EURUSD --period M1 --bars 5000
```

**Use When**: User needs automated market data exports without GUI interaction

**Limitations**: Cannot access custom indicator buffers (API restriction)

**Reference**: `/docs/guides/WINE_PYTHON_EXECUTION.md`

---

## Reference Documentation

For detailed information, see:

- [Capabilities Detailed](./references/capabilities-detailed.md) - In-depth capability documentation
- [Complete Workflows](./references/workflows-complete.md) - End-to-end user workflows
- [Troubleshooting & Errors](./references/troubleshooting-errors.md) - Requirements, assumptions, error patterns
- [Validation Metrics](./references/validation-metrics.md) - Success metrics and version history

---

## Troubleshooting

| Issue                        | Cause                        | Solution                                             |
| ---------------------------- | ---------------------------- | ---------------------------------------------------- |
| Wine Python not found        | CrossOver/Wine not installed | Install CrossOver, verify bottle path                |
| MT5 API connection failed    | MetaTrader not running       | Launch MetaTrader 5 before running export            |
| Correlation below 0.999      | Indicator mismatch           | Verify warmup periods, check calculation alignment   |
| Custom indicator not working | API restriction              | Use CSV export from MT5, not Python API              |
| UnicodeDecodeError           | Windows path encoding        | Use raw strings for Windows paths in Wine            |
| Symbol not found             | Wrong symbol format          | Use exact MT5 symbol name (e.g., EURUSD not EUR/USD) |
| Timeout on export            | Too many bars requested      | Reduce bar count, default 5000 is safe               |
| Permission denied            | Wine prefix incorrect        | Set WINEPREFIX to correct CrossOver bottle path      |


## 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.

Related Skills

python-memory-safe-scripts

29
from terrylica/cc-skills

Memory-safe Python script patterns for long-running processes under systemd MemoryMax constraints. Covers allocator purge (mimalloc/glibc malloc_trim), HTTP response lifecycle, DataFrame cleanup, thread-local connection reuse, and periodic GC cadence. Battle-tested through 5 OOM optimization cycles on production GPU workstations. Use this skill proactively whenever writing or reviewing Python scripts that: run under systemd with MemoryMax, process data in loops (downloads, ETL, backfill), use ThreadPoolExecutor, or make repeated HTTP requests. Also use when diagnosing OOM kills, RSS creep, or fd exhaustion in Python services. TRIGGERS - memory optimization, OOM prevention, RSS reduction, malloc_trim, systemd MemoryMax, memory leak, allocator purge, memory-safe script, RSS creep, fd exhaustion, SIGKILL status 9, MemoryHigh, glibc arena, mimalloc purge, requests memory leak, ThreadPoolExecutor cleanup.

python-logging-best-practices

29
from terrylica/cc-skills

Python logging with loguru, structlog, and orjson. TRIGGERS - loguru, structlog, structured logging, JSONL logs, log rotation, secret redaction, OTel logging, lightweight logging, print logging, systemd logging.

mlflow-python

29
from terrylica/cc-skills

MLflow experiment tracking via Python API. TRIGGERS - MLflow metrics, log backtest, experiment tracking, search runs.

voice-quality-audition

29
from terrylica/cc-skills

Audition Kokoro TTS voices to compare quality and grade. TRIGGERS - audition voices, kokoro voices, voice comparison, tts voice, voice quality, compare voices.

settings-and-tuning

29
from terrylica/cc-skills

Configure TTS voices, speed, timeouts, queue depth, and bot settings. TRIGGERS - configure tts, change voice, tts speed, queue depth, tts timeout, bot config, tune settings, adjust parameters.

full-stack-bootstrap

29
from terrylica/cc-skills

One-time bootstrap for Kokoro TTS engine, Telegram bot, and BotFather setup. TRIGGERS - setup tts, install kokoro, botfather, bootstrap tts-tg-sync, configure telegram bot, full stack setup.

diagnostic-issue-resolver

29
from terrylica/cc-skills

Diagnose and resolve TTS and Telegram bot issues. TRIGGERS - tts not working, bot not responding, kokoro error, audio not playing, lock stuck, telegram bot troubleshoot, diagnose issue.

component-version-upgrade

29
from terrylica/cc-skills

Upgrade Kokoro model, bot dependencies, or TTS components. TRIGGERS - upgrade kokoro, update model, upgrade bot, update dependencies, version bump, component update.

clean-component-removal

29
from terrylica/cc-skills

Remove TTS and Telegram sync components cleanly. TRIGGERS - uninstall tts, remove telegram bot, uninstall kokoro, clean tts, teardown, component removal.

send-message

29
from terrylica/cc-skills

Use when user wants to send a text message on Telegram as their personal account via MTProto, text someone, or message a contact by username, phone, or chat ID.

send-media

29
from terrylica/cc-skills

Use when user wants to send or upload a file, photo, video, voice note, or document on Telegram via their personal account.

search-messages

29
from terrylica/cc-skills

Use when user wants to search for messages across all Telegram chats or within a specific chat, find old messages by text, or look up Telegram message history filtered by sender.