14 KiB
LAPORAN PROYEK — CENTAUR QUANT ARCHITECTURE
Periode: Inception (CENTAUR_CHARTER.md) → v2.8.0 (Multi-Agent Fuzzy Fusion Engine) Tanggal laporan: 2026-08-13 · Kode sesi: CHIRON Status saat laporan: 17/17 workstream · build 0E/0W · rilis PUBLISHED di Algo Forge · LLM Gemini LIVE
1. RINGKASAN EKSEKUTIF
Centaur Quant Architecture adalah sistem trading kuantitatif hybrid tiga-agen: Executor (MQL5/SMC) + Probability Analyst (LLM) + Data Harvest Core (Python+DB). Dari charter yang diratifikasi hingga v2.8.0, proyek berkembang dari fondasi 8 modul MQL5 menjadi sistem lengkap: transport SDP non-blocking, telemetri menyeluruh, LLM live via file bridge, ops VPS unattended, rilis Algo Forge, dan — terakhir — mesin keputusan fusi fuzzy multi-agen dengan bobot tertimbang dinamis.
Pencapaian utama: LLM Gemini terbukti live (skor nyata, fallback=False), integrasi end-to-end berjalan, backtest teknikal PASS konsisten, dan arsitektur keputusan telah dirombak dari single structural confidence menjadi konsensus fuzzy 5 agen.
Isu paling penting yang masih terbuka: scanner OB+FVG menghasilkan 0 setup dalam 6 bulan backtest — strategi terlalu ketat; fusi fuzzy belum pernah teruji dengan trade nyata.
2. KRONOLOGI PROYEK
| Tanggal | Sesi / Milestone | Hasil Kunci | Versi/Commit |
|---|---|---|---|
| (awal) | CENTAUR_CHARTER.md diratifikasi | 5 tenet non-negotiable + SDP v1.0 + layout kanonik | v1.0.0 |
| 2026-08-12 | MQL5 Layer | 8 modul (Core/Network/Data/Execution) + composition root | v2.0.0 d7e4a18 |
| 2026-08-12 | Python Router | main.py — reassembly frame, dispatch, mock→live AI advisory |
smoke ✅ |
| 2026-08-12 | Track A "The Brain" | MarketAnalyzer — prompt SMC, OpenAI/Google, fallback 40.0, timeout 1.5s |
smoke ✅ |
| 2026-08-12 | Track B "The Memory" | TelemetryDB — SQLite thread-safe WAL |
201/201 ✅ |
| 2026-08-12 | System Finalization | CHistoryTracker, QA harness 3/3, DDL prod (v_feedback) | 3/3 OK |
| 2026-08-12 | Riset LLM Integration | AI Assistant MT5 (Inferdeck) tidak callable — 26× LLMCreate err, 403; evolusi kanal → file bridge |
riset ✅ |
| 2026-08-13 | LLM LIVE (Gemini) | Bukti live score=35.0 fallback=False; model aktif gemini-3.1-flash-lite; silent bugs P1–P4 & S1–S6 diperbaiki |
f200110 c63bf31 cbd0d2d |
| 2026-08-13 | DRP Resync + Inventory Fix | 16/16→17/17 (CLLMClient ditemukan di disk) | v2.3.0 |
| 2026-08-13 | VPS Unattended + Ops | AutoLogon, start_centaur_services.bat, schtasks, env registry |
— |
| 2026-08-13 | SocketSend API Fix + SDP Fix + Live Verify | 4003 = signature API berubah (buffer_len); sdp_version tanpa kutip → JSON invalid; FileTruncate tak ada; telemetri TCP mengalir |
v2.4.0 |
| 2026-08-13 | Live Verification Penuh + Resilient Ops | Log spam 97,2% → throttle 1/10 dtk; journal = DISK (UTF-16); guard koneksi ganda; clean_old_logs.bat + Task Scheduler; Algo Forge 21+ commit; handoff BACKTEST |
v2.5.0 |
| 2026-08-13 | DRP Resync v2 + Inventory Docs (CHIRON) | 17/17 terverifikasi; inventori auxiliary files; koreksi §6 16/16→17/17 | v2.6.0 |
| 2026-08-13 | SMOKE Backtest + Fix Tester-Mode (CHIRON) | Backtest #1 PASS 4:12 tapi 0 setup/0 trade; Bug P1 (socket 4014 di tester) & P2 (throttle TimeCurrent) diperbaiki; backtest #2 PASS 4:01.7, log 167 MB→37 baris | v2.7.0 |
| 2026-08-13 | Multi-Agent Fuzzy Fusion Engine (CHIRON) | CFuzzyFusion.mqh — 5 agen, fuzzy logic, bobot dinamis adaptif, gate threshold; unit test + backtest #3 PASS 4:00.1 |
v2.8.0 79275b1 |
Evolusi kanal AI (penting untuk dipahami):
EA→OpenAI langsung → MCP bridge (Rute 2a/2b) → MCP-only single source → file bridge periodik
(ai_request.json ⇄ assistant_bridge.py ⇄ MarketAnalyzer → LLM) — hemat token, sederhana, race-safe.
3. ARSITEKTUR & PRINSIP INTI
3.1 Lima Tenet Non-Negotiable (dari charter)
- Centaur System — Executor + Probability Analyst + Data Harvest Core (yang terakhir = true core).
- Anti-Veto — skor AI hanya memengaruhi sizing/manajemen, TIDAK PERNAH memblokir eksekusi.
- SDP — satu envelope JSON;
CSDPEncodersatu-satunya serializer MQL5; raw JSON dilarang. - Normalisasi Dinamis — nol buffer per-symbol hardcoded; semua jarak dari
SymbolInfo*()+ ATR runtime. - Non-Blocking — semua I/O punya timeout eksplisit; OnTimer/OnTick tidak boleh hang.
3.2 Skema SDP v1.0
Envelope wajib: sdp_version, timestamp, symbol, timeframe, action_type (+ algorithmic_confidence_score, payload).
Aksi: Heartbeat, Tick_Harvest, Setup_Detected, Trade_Opened, Trade_Closed.
3.3 Arsitektur Keputusan v2.8.0 (baru)
Scanner OB+FVG (penyedia setup: arah + level)
│
▼
┌───────────────────────── Multi-Agent Fuzzy Fusion ─────────────────────────┐
│ Agen: Struktur(SMC) · Trend(EMA50/200) · Momentum(RSI14) · Vol(ATR14/50) │
│ · AI(LLM) │
│ Fuzzifikasi (lemah/sedang/kuat) → agregasi BOBOT DINAMIS → defuzzifikasi │
│ centroid → fused 0..100 │
└─────────────────────────────────┬──────────────────────────────────────────┘
▼
fused ≥ InpFuzzyThreshold (55)?
├─ ya → eksekusi (sizing pakai fused; anti-veto)
└─ tidak → setup dilewati (keputusan kolektif)
Bobot dinamis diperbarui online dari outcome trade (win/loss via R-multiple): agen akurat naik bobot, agen salah turun (clamp 0.05–0.60, normalisasi, persistensi file).
4. TEMUAN-TEMUAN KUNCI
- AI Assistant MT5 tidak dapat dipanggil secara programatik —
LLMCreateerror (build 6090), docs 404, Inferdeck 403. Forum: Web API key hanya untuk validasi status akun. → Solusi: file bridge ke MarketAnalyzer (single source of truth). SocketSendsignature MQL5 berubah — parameter ke-3 adalahbuffer_len, bukanmax_wait_ms; semua send lama dikirim dengan nilai timeout sebagai panjang buffer →4003 ERR_INVALID_PARAMETER. Bukan masalah lingkungan, murni bug call-site.- Journal expert ternyata DISK, bukan memori —
MQL5\logs\YYYYMMDD.log(UTF-16); 97,2% isinya spam; pertumbuhan 23,8 MB/hari. - Socket dilarang di Strategy Tester —
SocketCreate()→4014 ERR_FUNCTION_NOT_ALLOWED; retry tiap 5 dtk membanjiri log. - Throttle berbasis
TimeCurrent()tidak efektif di tester — waktu simulated melaju cepat → 167 MB log dalam 4 menit. - 0 setup dalam 6 bulan (XAUUSD M15) — kombinasi unmitigated ketat + proksimitas 0,25 ATR + depth 200 + expansion_min 1.2 terlalu konservatif untuk memicu trade.
- Kredensial git forge kedaluwarsa + Git Credential Manager rusak (
credential.helper=manager-coretanpa binary) → push gagal sampai GCM 2.9.1 diinstall (kredensial ternyata masih tersimpan di Windows Credential Manager). - Sampah disk: 44 GB di
Tester\logs\20260812.log— di luar cakupanclean_old_logs.bat. - Model Gemini berubah cepat —
2.0-flashpensiun (404),2.5-flash-litetak tersedia untuk user baru → default aktifgemini-3.1-flash-lite($0.25/$1.50 per 1M; biaya ≈ $0.00005/setup). - Fuzzy fusion matematik valid — unit test mirror: all-strong=80, all-weak=25.7, konflik=49.2<mixed, netral=50; bobot teradaptasi (struktur/AI naik saat akurat).
5. KESALAHAN & MITIGASI
| # | Masalah | Akar Penyebab | Dampak | Mitigasi | Status |
|---|---|---|---|---|---|
| 1 | SocketSend gagal 4003 |
Signature API MQL5: param ke-3 = buffer_len |
Telemetri TCP mati | SocketSend(sock, buf, ArraySize(buf)) |
✅ fixed v2.4.0 |
| 2 | SDP frame Malformed JSON dropped |
"sdp_version":1.0.0 tanpa kutip |
Router buang frame tiap detik | Tambah kutip: "1.0.0" |
✅ fixed |
| 3 | Kompilasi gagal FileTruncate |
Fungsi tidak ada di MQL5 | Fallback file telemetri | Pola FileClose+FileDelete+reopen |
✅ fixed |
| 4 | Spam log 97,2% (23,8 MB/hari) | Log "no OB+FVG" tanpa throttle efektif | Disk & journal penuh | Throttle 1 pesan/10 dtk | ✅ fixed |
| 5 | SocketCreate() 4014 di tester |
Socket dilarang sandbox tester | Log error tiap 5 dtk; telemetri TCP mati | Guard MQL_TESTER + fallback file telemetri |
✅ fixed v2.7.0 |
| 6 | Log 167 MB di tester | Throttle pakai TimeCurrent() (simulated) |
Log membengkak, test melambat | Throttle GetTickCount64() (wall-clock) |
✅ fixed v2.7.0 |
| 7 | 0 trade / 6 bulan | Scanner terlalu ketat | Strategi tidak menghasilkan sinyal | Belum — kandidat kalibrasi (proksimitas/depth) | ⏳ terbuka |
| 8 | Push forge gagal | GCM tak terinstall; kredensial kedaluwarsa | Kode tak bisa dirilis | Install GCM 2.9.1; helper manager; WinCred tersimpan |
✅ fixed |
| 9 | Disk 44 GB | Log tester sesi lama | Kapasitas disk | Perlu hapus manual / perluas clean_old_logs.bat ke Tester\logs |
⏳ manual |
| 10 | MCP bridge boros token & kompleks | LLM via MCP tiap setup | Biaya & latency | Di-retire → file bridge periodik | ✅ solved |
| 11 | LLMCreate/Inferdeck 403 |
AI Assistant MT5 tidak API-callable | Jalur AI buntu | Kanal: file bridge → MarketAnalyzer (single source) | ✅ solved |
| 12 | Model Gemini 404 | 2.0-flash pensiun; 2.5-flash-lite tak tersedia |
LLM mati | Default chain → 3.1-flash-lite |
✅ solved |
| 13 | Race kondisi bridge (P1–P4) | os.replace race; log request rusak |
Skor salah/id ganda | try/except + retry id sama (RACE_SAFE_OK); timeout 6s < 15s EA | ✅ fixed f200110 |
| 14 | Silent bugs EA (S1–S6) | Zona basi; pending ganda; request non-atomik | Eksekusi salah/skor salah | ZoneStillValid, zona fresh ganti pending, FileMove atomik, skor hanya saat sukses, id unik |
✅ fixed cbd0d2d |
| 15 | Fallback LLM timeout | Bridge lambat / LLM down | Setup tanpa skor | Fallback 40.0 = quarter-risk (anti-veto), tetap eksekusi | ✅ desain |
| 16 | Guard koneksi ganda | Internet/broker putus | Entry harga basi / spam retcode | TERMINAL_CONNECTED + stale >120s blokir entry; ManagePositions skip offline |
✅ fixed |
| 17 | Tooling: edit multi-line CRLF gagal | replace_text_in_file normalisasi LF vs file CRLF |
Patch tidak cocok | Patch byte-exact via Python; verifikasi pasca-edit | ✅ workaround |
| 18 | Edit tidak sengaja 2× (EnsureConnection) | Anchor g_sock.Connect match ganda |
Kode redundan (tapi benar) | Verifikasi ulang + format + cleanup | ✅ caught |
| 19 | ai_response.json stale |
File sisa sesi lama | Skor basi | Id-mismatch menanganinya; hapus bila bersih | ✅ handled |
Pelajaran umum: (a) selalulu verifikasi output tiap edit (kompilasi + baca ulang); (b) uji di tester ≠ live — sandbox tester punya batasan sendiri (socket); (c) throttle log harus berbasis wall-clock, bukan simulated time; (d) kredensial & tooling git adalah bagian dari "operasional" yang bisa jadi single-point-of-failure.
6. PELUANG YANG BISA DI-EXPLORE
Prioritas Tinggi (P0) — prapersyarat validasi strategi
- Kalibrasi scanner OB+FVG — longgarkan proksimitas (0,25→0,5 ATR) dan/atau depth (200→400), atau relaksasi kriteria unmitigated/expansion → tujuannya memunculkan setup di backtest sehingga fusi fuzzy benar-benar teruji.
- Verifikasi live v2.8.0 di demo — attach EA
InpEnableLLM=true: siklus penuh Setup→FUSION→Open→Close→DB + adaptasi bobot dinamis dari trade nyata.
Prioritas Menengah (P1)
- Perluas
clean_old_logs.batkeTester\logs— hapus otomatis log agent/tester >30 hari (temuan 44 GB). - Kalibrasi
v_feedback— regresi skor→R-multiple di Python begitu telemetri berisi (butuh trade nyata/backtest dengan setup). - Persistensi bobot dinamis ke telemetry DB — ganti file
centaur_weights.txtdengan tabel di Data Harvest Core (selaras tenet "data = true core").
Prioritas Lanjutan (P2/P3)
- Per-agen score masuk SDP payload — kirim breakdown 5 agen + bobot di
Setup_Detected/Trade_Opened→ data training lebih kaya untuk ML. - Agen konteks multi-timeframe (HTF bias) — bias arah dari H1/H4 sebagai agen ke-6.
- Deploy multi-symbol — arsitektur sudah instrument-agnostic (charter): XAUUSD + EURUSD + indeks, masing-masing dengan bobot fuzzy terpisah.
- Risk dinamis —
InpRiskPercentstatis → sizing adaptif: fraksi risiko ∝ fused score & drawdown berjalan. - Backtest "every tick" (Model=0) — validasi fill lebih realistis vs OHLC 1 menit.
- Upgrade transport ZMQ (charter §3.1) bila volume telemetri naik.
- MQL5 native LLM API — begitu MetaEditor di-update (jalur AI tanpa bridge).
- Optimasi parameter fuzzy — walk-forward optimization untuk membership/threshold/bobot dasar.
- Ensemble LLM — chain fallback multi-model (Gemini → OpenAI → lokal) untuk skor lebih stabil.
7. STATUS SAAT INI & HANDOFF BERIKUTNYA
Status:
- 17/17 workstream @ 100% · build MQL5 0E/0W · QA Python 3/3 · LLM Gemini LIVE · rilis Algo Forge.
- Commit terakhir:
79275b1(v2.8.0) — ter-push keforge main. - Backtest SMOKE: PASS konsisten (4:12 → 4:01.7 → 4:00.1) — stabil secara teknis.
- Belum ada trade (0 setup/6 bulan) → telemetry DB masih kosong.
Handoff sesi berikutnya (prioritas):
- Kalibrasi scanner (P0) → backtest ulang sampai muncul setup → uji fusi fuzzy + adaptasi bobot.
- Verifikasi live demo v2.8.0.
- Kalibrasi
v_feedbacksetelah data telemetri terisi. - Disk hygiene: hapus
Tester\logs\20260812.log(44 GB) + perluas script cleanup.
8. REFERENSI
00_CONCEPT/CENTAUR_CHARTER.md— charter & 5 tenet (v1.0.0, RATIFIED).00_CONCEPT/BOOTSTRAP.md— DRP v1.0.0 (protokol resinkronisasi sesi AI).00_CONCEPT/PROGRESS.md— log progres & telemetri (v2.8.0).MQL5/Include/Models/CFuzzyFusion.mqh— mesin fusi fuzzy multi-agen (baru).MQL5/Experts/CentaurQuant.mq5— composition root (alur keputusan v2.8.0).Database/schema.sql— DDL prod (PostgreSQL,v_feedback).Python/*— router, analyzer (MarketAnalyzer), telemetry.py, assistant_bridge.py, ingest_telemetry.py, publish_forge.py.
Laporan disusun otomatis oleh MetaTrader Assistant (sesi CHIRON, nonce Qz4m) — data dari PROGRESS.md v2.8.0 + verifikasi langsung di disk & tester.