重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
log-reader by terrylica/cc-skills
npx skills add https://github.com/terrylica/cc-skills --skill log-reader直接读取 MetaTrader 5 日志文件,以访问来自指标、脚本和智能交易系统的 Print() 输出,无需手动检查“智能交易”面板。
实现“选项 3”双重日志记录模式:
Claude Code 可以在无需用户干预的情况下自主读取这两种输出。
在以下情况下使用此技能:
MT5 日志存储在:
$MQL5_ROOT/Program Files/MetaTrader 5/MQL5/Logs/YYYYMMDD.log
文件格式:
/usr/bin/env bash << 'SKILL_SCRIPT_EOF'
# 确定当前日期
TODAY=$(date +"%Y%m%d")
# 构建绝对路径
LOG_FILE="$MQL5_ROOT/Program Files/MetaTrader 5/MQL5/Logs/${TODAY}.log"
SKILL_SCRIPT_EOF
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用 Read 工具:
使用 Grep 过滤条目:
Pattern: indicator name, "error", "test.*passed", etc.
Path: Log file path from step 1
Output mode: "content" with -n (line numbers)
Context: -A 5 for 5 lines after matches
使用 Bash 的 tail 命令查看最新输出:
tail -n 50 "$LOG_FILE"
搜索测试通过/失败指示器:
Pattern: test.*passed|test.*failed|Tests Passed|Tests Failed|ALL TESTS PASSED
Output mode: content
Context: -B 2 -A 2
Pattern: error|ERROR|warning|WARNING|failed to create
Output mode: content
Context: -A 3
Pattern: CCI Rising Test|PatternDetector|ArrowManager
Output mode: content
Context: -A 2
Pattern: OnInit|initialization|Initialization complete|Phase \d+
Output mode: content
Input: User compiled Test_PatternDetector.mq5
Action:
1. Read today's log file
2. Grep for "Test.*PatternDetector|Tests Passed|Tests Failed"
3. Report results (e.g., "17 tests passed, 0 failed")
Output: Test status without user checking Experts pane
Input: User reports indicator not working
Action:
1. Read today's log file
2. Grep for "ERROR|error|failed" with -A 3 context
3. Analyze error messages
Output: Specific error details and line numbers
Input: User asks "did the test arrow get created?"
Action:
1. Read today's log file
2. Grep for "Phase 2|Test arrow created|Failed to create"
3. Check for success/failure messages
Output: Arrow creation status with timestamp
此技能实现了对双重日志记录模式其中一半的程序化访问:
两者都可在无需用户干预的情况下访问:
使用此技能时:
docs/guides/MT5_FILE_LOCATIONS.mddocs/plans/cci-rising-pattern-marker.yaml 阶段 3-4Program Files/MetaTrader 5/MQL5/Indicators/Custom/Development/CCINeutrality/lib/CSVLogger.mqh| 问题 | 原因 | 解决方案 |
|---|---|---|
| 日志文件未找到 | 日期或路径错误 | 验证 YYYYMMDD.log 格式和 MQL5_ROOT 环境变量 |
| 日志文件为空 | MT5 未运行或无输出 | 确保 MT5 正在运行且 Print() 被调用 |
| 编码错误 | 未处理 UTF-16LE | Read 工具自动处理编码 |
| 缺少测试结果 | 测试未执行 | 首先在 MT5 中编译并运行测试脚本 |
| Grep 未找到任何内容 | 模式错误 | 使用不区分大小写(-i)或更宽泛的模式 |
| 旧日志数据 | 日志轮换 | 每天创建新的 YYYYMMDD.log 文件 |
| 路径包含空格 | 路径变量未加引号 | 为路径加引号:"$LOG_FILE" |
| 敏感数据暴露 | 日志中包含交易信息 | 向用户报告时过滤敏感字段 |
每周安装数
62
代码仓库
GitHub 星标数
22
首次出现
2026年1月24日
安全审计
安装于
opencode59
gemini-cli58
codex57
claude-code56
cursor56
github-copilot56
Read MetaTrader 5 log files directly to access Print() output from indicators, scripts, and expert advisors without requiring manual Experts pane inspection.
Implement "Option 3" dual logging pattern:
Claude Code can autonomously read both outputs without user intervention.
Use this skill when:
MT5 logs are stored at:
$MQL5_ROOT/Program Files/MetaTrader 5/MQL5/Logs/YYYYMMDD.log
File Format :
/usr/bin/env bash << 'SKILL_SCRIPT_EOF'
# Determine current date
TODAY=$(date +"%Y%m%d")
# Build absolute path
LOG_FILE="$MQL5_ROOT/Program Files/MetaTrader 5/MQL5/Logs/${TODAY}.log"
SKILL_SCRIPT_EOF
Use Read tool:
Use Grep to filter entries:
Pattern: indicator name, "error", "test.*passed", etc.
Path: Log file path from step 1
Output mode: "content" with -n (line numbers)
Context: -A 5 for 5 lines after matches
Use Bash with tail for latest output:
tail -n 50 "$LOG_FILE"
Search for test pass/fail indicators:
Pattern: test.*passed|test.*failed|Tests Passed|Tests Failed|ALL TESTS PASSED
Output mode: content
Context: -B 2 -A 2
Pattern: error|ERROR|warning|WARNING|failed to create
Output mode: content
Context: -A 3
Pattern: CCI Rising Test|PatternDetector|ArrowManager
Output mode: content
Context: -A 2
Pattern: OnInit|initialization|Initialization complete|Phase \d+
Output mode: content
Input: User compiled Test_PatternDetector.mq5
Action:
1. Read today's log file
2. Grep for "Test.*PatternDetector|Tests Passed|Tests Failed"
3. Report results (e.g., "17 tests passed, 0 failed")
Output: Test status without user checking Experts pane
Input: User reports indicator not working
Action:
1. Read today's log file
2. Grep for "ERROR|error|failed" with -A 3 context
3. Analyze error messages
Output: Specific error details and line numbers
Input: User asks "did the test arrow get created?"
Action:
1. Read today's log file
2. Grep for "Phase 2|Test arrow created|Failed to create"
3. Check for success/failure messages
Output: Arrow creation status with timestamp
This skill enables programmatic access to one half of the dual logging pattern:
Both are accessible without user intervention:
When using this skill:
docs/guides/MT5_FILE_LOCATIONS.mddocs/plans/cci-rising-pattern-marker.yaml Phase 3-4Program Files/MetaTrader 5/MQL5/Indicators/Custom/Development/CCINeutrality/lib/CSVLogger.mqh| Issue | Cause | Solution |
|---|---|---|
| Log file not found | Wrong date or path | Verify YYYYMMDD.log format and MQL5_ROOT env var |
| Empty log file | MT5 not running or no output | Ensure MT5 is running and Print() is being called |
| Encoding errors | UTF-16LE not handled | Read tool handles encoding automatically |
| Missing test results | Test not executed | Compile and run test script in MT5 first |
| Grep finds nothing | Wrong pattern | Use case-insensitive (-i) or broader pattern |
| Old log data | Log rotation | Each day creates new YYYYMMDD.log file |
| Path contains spaces | Unquoted path variable | Quote paths: "$LOG_FILE" |
| Sensitive data exposed | Trading info in logs | Filter sensitive fields when reporting to user |
Weekly Installs
62
Repository
GitHub Stars
22
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode59
gemini-cli58
codex57
claude-code56
cursor56
github-copilot56
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
52,700 周安装