Centaur Quant Architecture — Multi-Asset SMC Executor + SDP Telemetry Bridge (MQL5 + Python). OB/FVG scanner, anti-veto LLM scoring, file-based telemetry fallback.
  • MQL5 70.1%
  • Python 29.3%
  • Batchfile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-18 13:17:25 +07:00
00_CONCEPT EXP-REGIME-001: ratify source evaluation framework v1.0 2026-08-18 13:17:25 +07:00
Database feat: Initial release of Centaur Quant Architecture v2.0.0 2026-08-12 19:54:12 +07:00
MQL5 EXP-DSO-001: Phase 2 instrumentation implemented (diagnostic mode: observational fused score, fixed 0.25% risk, frozen weights, same-zone block, exp_dso_001 evidence incl. outcome states); production unchanged when disabled; syntax 0E/0W; no compile/EX5/tester (PROGRESS v2.27.0) 2026-08-16 21:27:41 +07:00
Python EXP-003A: forensic audit KONFIRMASI bug orientasi seri (ArraySetAsSeries) - pola ada (139 OB+FVG/6mgg exp1.2) tapi MQL5 baca 0 krn index 0 = tertua; fix scanner + evidence funnel 2026-08-13 11:51:22 +07:00
.gitignore refactor: LLM MCP-only (single source of truth) - hapus jalur langsung EA->OpenAI 2026-08-12 20:50:58 +07:00
LICENSE feat: Initial release of Centaur Quant Architecture v2.0.0 2026-08-12 19:54:12 +07:00
README.md feat: Initial release of Centaur Quant Architecture v2.0.0 2026-08-12 19:54:12 +07:00

Centaur Quant Architecture

Hybrid quantitative trading system for MetaTrader 5 — a deterministic Smart Money Concepts (SMC) executor paired with a probabilistic LLM analyst. The AI advises; it never vetoes execution.

Status: v2.0.0 — production-ready release · License: MIT · Docs: 00_CONCEPT/


1. Overview & Architecture (The Centaur)

A centaur is half deterministic, half probabilistic — exactly like this system.

Agent Layer Role
Executor (deterministic) MQL5/ Symbol normalization, strict OB+FVG scanning, anti-veto sizing, dynamic trade management, SDP telemetry
Router / Gateway Python/router/ Persistent TCP bridge: SDP framing, AI advisory dispatch, telemetry wiring
Probability Analyst (probabilistic) Python/models/ LLM evaluation of setups (OpenAI / Google GenAI; neutral fallback)
Data Harvest Core Python/database/ + Database/ Persists every score → execution → outcome for calibration

Closed feedback loop:

Setup_Detected ──► AI_Advisory (score 0-100) ──► Trade_Opened ──► dynamic management
        ▲                                                              │
        └────────────── Trade_Closed (net PnL, R-multiple) ◄────────────┘
                                        │
                                   TelemetryDB (SQLite/PostgreSQL)

2. Non-Negotiable Tenets

  1. Anti-Veto Principle — AI scores scale position risk only (≥70 full, 50–69 half, <50 quarter with a defined floor). They never block baseline algorithmic execution; on AI failure a neutral 40.0 keeps the pipeline trading at minimum risk.
  2. Standardized Data Protocol (SDP v1.0) — one ratified JSON envelope schema (sdp_version, timestamp, symbol, timeframe, action_type, algorithmic_confidence_score, payload). CSDPEncoder is the only permitted JSON serializer in the MQL5 codebase.
  3. Multi-Asset Dynamic Normalization — zero hardcoded per-symbol point buffers. All distances, SL/TP, lot sizes, and noise thresholds are resolved at runtime from SymbolInfo*() and ATR (CSymbolNormalizer).
  4. Non-Blocking TCP/IP Transport — every socket operation is bounded by explicit timeouts (connect 3 s, send 1 s, read ≤2 s); the MT5 event loop never hangs when the Python backend is offline.

3. Repository Layout

Centaur_Quant_Architecture/
├── 00_CONCEPT/                  # Charter, BOOTSTRAP (DRP), PROGRESS (telemetry log)
├── Database/schema.sql          # Production PostgreSQL DDL + v_feedback view
├── MQL5/
│   ├── Experts/CentaurQuant.mq5 # Composition root (all modules wired)
│   └── Include/
│       ├── Core/CSymbolNormalizer.mqh
│       ├── Network/CSDPEncoder.mqh, CSocketClient.mqh
│       ├── Data/DataHarvester.mqh, ContextPackager.mqh
│       └── Execution/COrderBlockScanner.mqh, COrderExecutor.mqh, CHistoryTracker.mqh
└── Python/
    ├── router/main.py           # Central gateway (TCP 127.0.0.1:5555)
    ├── models/analyzer.py       # MarketAnalyzer (LLM evaluation engine)
    ├── database/telemetry.py    # TelemetryDB (SQLite feedback loop)
    └── tests/test_sdp_schema.py # QA harness (3/3 green)

4. System Requirements & Setup

MetaTrader 5

  • Any recent build (sockets + CTrade required).
  • Copy the MQL5/ tree into your terminal's MQL5/ folder (or open the project folder in MetaEditor) and compile CentaurQuant.mq5 (0 errors / 0 warnings expected).

Python 3.9+

  • sqlite3, socket, threading, json — standard library.
  • Optional LLM SDKs (the router degrades to the neutral 40.0 fallback without them):
    pip install openai google-genai
    

TCP Port

  • Default bind: 127.0.0.1:5555 (router --host/--port overrides; EA inputs must match).

5. Quick Start Guide

  1. Start the gateway (from the Python/ folder):
    python router/main.py
    
    Optional env: PROVIDER=openai|google, OPENAI_API_KEY/GEMINI_API_KEY, MODEL, CENTAUR_DB_PATH (default centaur_telemetry.db).
  2. Attach the EA in MT5: CentaurQuant → inputs Host=127.0.0.1, Port=5555, Magic=<yours>, RiskPercent → enable AutoTrading.
  3. Monitor:
    • Router console: [Setup_Detected], [AI_Advisory], >>> [Trade_Opened/Closed].
    • Telemetry: sqlite3 centaur_telemetry.db "SELECT * FROM trades;".
    • Project state: 00_CONCEPT/PROGRESS.md.

QA

python -m unittest tests.test_sdp_schema   # 3/3 tests OK

6. Resynchronization Protocol (for AI-assisted maintenance)

See 00_CONCEPT/BOOTSTRAP.md — any future session can regain full context by running the Dynamic Resynchronization Protocol (scan → read → internalize → verify → acknowledge).


7. License

MIT — see LICENSE. Free to use, modify, and distribute; trading use is at your own risk.