Nhật Bảnxxvw/ICT_Library_MQ5
ICT Concept OSS Library for MQ5/MT5
SMC/ICT Library for MetaTrader 5
English · 日本語 · 简体中文 · Español
An MIT-licensed MQL5 library for detecting and retrieving Smart Money Concepts (SMC) and Inner Circle Trader (ICT) patterns in MT5. Use typed snapshots inside an EA or read the same results as JSON from Python, TypeScript, C#, Go, Java, or Rust.
Detection uses closed candles and broker time. Numerical rules are explicit, configurable project definitions; see detection rules.
What is included
| Area | Capabilities |
|---|---|
| Structure and zones | Confirmed swings, BOS, CHoCH, order blocks, FVG, breaker blocks, liquidity, premium/discount, OTE, and sessions |
| Additional ICT patterns | Displacement, MSS, IFVG, BPR, previous-day/week and completed-session highs/lows, broker daily/weekly opening gaps, SMT divergence, and Power of Three |
| Data access | SmcConfig, SmcSnapshot, per-concept readiness, stable record IDs, lifecycle states, UTF-8 JSON, and existing CSV export |
| Examples | A snapshot-export EA that places no orders; six external-language JSON readers; existing visualizer and sample trading EA |
| Optional analysis | Currency strength, historical-volatility analysis, Python training scripts, and ONNX utilities |
Start in MT5
- In MT5, choose File → Open Data Folder.
- Copy
Include/SMC/intoMQL5/Include/SMC/andExperts/SMC_Snapshot_Export.mq5intoMQL5/Experts/. - Compile the export EA in MetaEditor, attach it to a chart, and inspect its Experts log. It exports a new snapshot when a candle closes without placing trades.
- Read the JSON file in MT5's shared
Terminal/Common/Files/directory with one of the examples below.
For MQL5 integration, initialize a configuration and check both update success and snapshot status:
#include <SMC/SmcManager.mqh>
CSmcManager smc;
int OnInit()
{
SmcConfig config;
config.SetDefaults();
return smc.Init(_Symbol, _Period, config) ? INIT_SUCCEEDED : INIT_FAILED;
}
void OnTick()
{
if(!smc.Update())
return; // Read GetStatus()/GetSnapshot() for unavailable-module details.
SmcSnapshot snapshot;
if(!smc.GetSnapshot(snapshot) || snapshot.status != SMC_STATUS_READY)
return;
for(int i = 0; i < ArraySize(snapshot.records); i++)
if(snapshot.records[i].concept == ICT_IFVG)
Print(snapshot.records[i].id, " ", snapshot.records[i].state);
}
void OnDeinit(const int reason) { smc.Clean(); }
The existing Init(), Update(), Clean(), and getter interfaces remain available. See the quick start, snapshot API, and compatibility notes.
Read results in another language
Each example accepts a snapshot path and optional --concept IFVG --direction bearish filters. The readers share a fixture and expected output; detection stays in MQL5.
| Language | Setup and run instructions |
|---|---|
| Python | examples/python |
| TypeScript | examples/typescript |
| C# | examples/csharp |
| Go | examples/go |
| Java | examples/java |
| Rust | examples/rust |
The data contract and JSON Schema define versioning, timestamps, statuses, and record fields. Broker timestamps have no UTC suffix. Missing history is reported separately from a successful evaluation with no matches.
Documentation and development
- Documentation index, including retained Japanese reference guides.
- MQL5 core architecture.
- Detection rules and defaults.
- Local validation and development.
- Contributing, code of conduct, security reporting, and changes.
All changes go through small PRs to main, with local validation before squash merge. Commit one completed unit, validate it, and push it before starting another. CI runs locally; GitHub hosted and self-hosted runners are not required.
python -m pip install -r requirements-dev.txt
python tools/setup_hooks.py
python tools/check_all.py
Full validation also requires MetaEditor/MT5 and the sample-language toolchains; follow the development guide. Missing tools and interrupted checks fail validation.
Python CSV processing, terminal connectivity, and ML training have separate dependency sets. See quick start: Python.
License
MIT. The library and examples support research and software development. Pattern detections are data, and do not establish profitability. The existing SMC_Sample_EA.mq5 can place orders; use SMC_Snapshot_Export.mq5 for data-only integration.
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Run MT5 as Stealth Windows Service for Automated Trading, 2026
This repository is about some of my various MT4/MT5 EA you everyone can use for free. I implemented various strategies and scripts you can customize for your projects.
MT5 gold (XAUUSD) M1 scalper EAs: Z-score mean reversion plus trend breakout, with dynamic equity risk tiers, session window, spread filter and cost-aware broker-side take-profit.
AutoTrade Forex Signals: Telegram to MT5 EA 2026 Strategy
Best MT4 MT5 Close All Orders Script 2026 Automated Position Management
WIP — XAUUSD (Gold) automated-trading research, in the open. MQL5 (public) + Python/NautilusTrader (private). Studied thousands of bots first. No signals, no profit claims — just the engineering.