Master Blueprint · Comprehensive Project Record

ALFA CAPITAL LAB

ACL-RND-001 · Quantitative Strategy Research, Validation & Platform Engine · Family Capital Initiative
MASTER — V 1.0
Document: ACL-MASTER-001
Produced: June 2026
Status: Living Blueprint
Phase 1–2: ✅ Complete
Prime Directive — ACL-RND-001

Memvalidasi kombinasi pair × strategi × session × kondisi market secara statistik, membangun platform eksekusi yang solid, teruji, dan siap diotomasi. Setiap keputusan didasarkan pada data historis yang terstruktur — bukan intuisi semata. Output akhir: blueprint eksekusi yang locked, dipercaya, dan siap live.

✓ Phase 1 · Data Foundation
✓ Phase 2 · Strategy Codification
▶ Platform Build · Alfa Capital Platform
◎ Phase 3 · Backtest & Validation
○ Phase 4 · Live Execution
01
Data Foundation
~3.17M candles · 9,015 events · 411,756 flags
✓ Complete & Verified
02
Strategy Codification
Rulebook V1 · 8 Core Rules · strategy.* schema
✓ Complete & Locked
P
Alfa Capital Platform
Next.js + FastAPI + PostgreSQL · Internal SaaS
▶ Building Now
03
Backtest & Validation
5 pairs × sessions × conditions · 10-year data
◎ Queued — After Platform
5 Pair Fixed Universe · H4 → H1 → M15 Cascade
Bias (H4) → Zone (H1) → Entry (M15) · Min RR: 1:2 hardcoded
PairClusterSession FilterTF StackKarakteristik Utama
XAUUSD
Gold · Commodity
XAU AsiaLondonNY
H4H1M15
Asia: accumulation · London: trap setup · NY: trending
NAS100
Nasdaq · US Index
US Index NY Only
H4H1M15
Liquidity peak NY open · volume tipis di luar NY
US500
S&P 500 · US Index
US Index NY Only
H4H1M15
Korelasi tinggi NAS100 · broader market sentiment
GBPUSD
Cable · FX Major
GBP Cluster AsiaLondonNY
H4H1M15
Peak volatility London open · GBP event sensitive
GBPJPY
Geppy · FX Cross
GBP Cluster AsiaLondonNY
H4H1M15
Volatilitas tinggi · peak London + London/NY overlap
Phase 1 — Data Foundation ✓ COMPLETE
01
Phase 1

Data Foundation

Collect · Clean · Structure · Label — Historical 2000–2026
Output
Clean Database
Objective: Membangun single source of truth untuk seluruh data historis. Bukan sekadar download CSV — data yang bersih, berlabel, dan siap diuji. Fondasi yang tidak solid = Phase 3 tidak valid.
Delivery Status — Phase 1
OHLCV ~3.17M candles — 5 pairs × M15/H1/H4 × 2000–2026. MT5 + Histdata.com. PostgreSQL partitioned.
Session box range — Asia, London, NY, Overlap. High/Low per pair per hari tersimpan.
Economic calendar — 9,015 events (USD, GBP, JPY) via FRED API. Actual, forecast, previous.
News flags — 411,756 flags PRE_NEWS/POST_NEWS ±4H radius per candle di semua TF.
PostgreSQL schemas — market, fundamental, config, audit, util. Partitioned, UTC-first, production-ready.
Perl TCP forwarder — pg_forward.pl port 8443. Cron auto-restart. Koneksi dari laptop via DBeaver.
Phase 1 — Final Numbers
OHLCV Total
~3,170,000 candles · 5 pairs × 3 TF × 2000–2026
Database
PostgreSQL · thejourn_acl_rnd · ArenHost jakarta.kencang.com:8443
Economic Events
9,015 events · FRED API · USD + GBP + JPY
News Flags
411,756 flags · PRE_NEWS & POST_NEWS · semua timeframe
Data Source
MT5 Exness Trial + Histdata.com CSV · UTC-first
Status
VERIFIED · Zero gap pada jam market buka · siap digunakan Phase 3
Data verified → Phase 2 Strategy Codification
02
Phase 2

Strategy Codification

Translate edge → explicit binary rules · Rulebook V1 Locked
Output
Rulebook V1
Objective: Menterjemahkan cara berpikir trader menjadi if-then rules yang rigid, tidak ambigu, dan dapat dikodekan. Setiap rule bersifat binary — kondisi terpenuhi atau tidak. Tidak ada grey area. Rulebook V1 adalah kontrak antara Chief Trader dan sistem.
Core Strategy Framework
Layer 1 — Primary
Supply & Demand · SnR
Zone formation criteria terdefinisi
Valid vs broken vs mitigated zone
Fresh zone vs tested zone
Zone strength scoring
Layer 2 — Enhancement
SMC / ICT Model
Market structure shift confirmation
Order block identification rules
Fair value gap (FVG) criteria
Liquidity sweep detection
Layer 3+4 — Filter & Bias
Session · Timing · H4→H1→M15
Per-pair session filter
High-impact news exclusion window
H4: macro bias · H1: zone · M15: entry
Min RR 1:2 hardcoded
Rulebook V1 — 8 Core Rules (Locked)
Rule IDRule NameBinary DefinitionStatus
R.01
Bias Confirmation
H4 candle close di atas/bawah structure terakhir → bias bullish/bearish. Ranging jika tidak ada clear break. Entry hanya searah bias H4.
Kontra-bias = no trade, zero exception.
✓ Locked
R.02
Zone Validity
Zone valid: terbentuk dari impulse candle, belum ditembus >50%, memiliki clear origin candle.
Zone 3× tested = lower priority.
✓ Locked
R.03
Entry Trigger
M15: rejection signal (pin bar / engulfing / BOS minor) di area zone H1 valid dengan bias H4 aligned. Semua 3 kondisi wajib terpenuhi.
Satu kondisi tidak terpenuhi = no entry.
✓ Locked
R.04
Stop Loss Placement
SL di luar zone + buffer: 5–10 pip (FX) / 0.5–1.0 point (indeks/gold). SL maksimal 2% modal per trade.
SL melebihi 2% = skip trade.
✓ Locked
R.05
Take Profit Target
TP1 di 1:2 RR (50% close). TP2 di next major structure/zone opposite (50% remaining). Min RR untuk entry: 1:2.
RR di bawah 1:2 = skip entry.
✓ Locked
R.06
News Filter
No new entry 30 menit sebelum dan 60 menit sesudah high-impact news untuk pair relevan.
Trade open: pertahankan atau manual close sebelum news.
✓ Locked
R.07
Session Filter
Entry hanya dalam session yang valid per pair (lihat Universe table). XAUUSD: Asia/London/NY. NAS100 & US500: NY only. GBP pairs: Asia/London/NY.
Entry di luar session = invalid.
✓ Locked
R.08
Zone Test Count
Zone yang telah ditest 3× atau lebih diklasifikasikan sebagai degraded — masih tradeable tapi konfirmasi SMC tambahan wajib. Zone 4× tested = invalid.
Track test count per zone di database.
✓ Locked
Database Schema — strategy.*
strategy.rules 8 rules
rule_code, rule_name, definition
is_binary, rule_category
created_by, is_shared
rulebook_version (fork-able)
strategy.rule_parameters 27 params
param_key, param_value
user_id (override per user)
pair, timeframe scoped
strategy.zones / setups
zones — Phase 3 detection fill
setups — all_rules_met computed
backtest_runs — tracking
Phase 2 Exit Gate — G.01–G.05
G.01 — 8 core rules terdefinisi binary, nol ambiguitas
G.02 — Per-pair specifics dikonfirmasi Chief Trader
G.03 — schema strategy.* dieksekusi & verified di PostgreSQL
G.04 — Rulebook V1 tersimpan sebagai dokumen final
G.05 — Chief Trader konfirmasi rules mencerminkan cara trading sesungguhnya
Rulebook V1 locked → Platform Build (prerequisite before Phase 3)
Alfa Capital Platform — Internal SaaS Build ▶ BUILDING NOW
P
Platform

Alfa Capital Platform

Internal SaaS · Manual Rule Setup · Backtest Runner · Results Dashboard
Output
Live Platform
Objective: Membangun rumah digital tempat seluruh pipeline ACL berjalan — dari rule configuration, backtest execution, result visualization, sampai live signal monitoring. Platform ini bukan untuk publik — dirancang untuk internal use Chief Trader & trading team. Mulai dari internal tool yang solid, skalabel ke multi-user setelah Phase 3 selesai.
Tech Stack — Full Architecture
Frontend
Next.js 14+App RouterFramework utama
Tailwind CSSUtility-firstStyling
shadcn/uiRadixUI components
Recharts / D3Chart libData visualisasi
ZustandState mgmtGlobal state
Backend
FastAPIPythonAPI layer utama
SQLAlchemyORMDB connector
Pydantic v2ValidationSchema & types
CeleryQueueAsync backtest jobs
JWT / OAuth2AuthAuthentication
Infrastructure
ArenHost cPanelSharedFrontend hosting
PostgreSQLthejourn_acl_rndPrimary DB
SupabaseFree tierAuth & cloud DB
MT5 Python BridgeLaptopLive data feed
Perl ForwarderPort 8443DB tunnel cPanel
Dev Tools & Phase 4
DBeaverSQL clientDB management
VS CodeIDEDevelopment
Git / GitHubVersion ctrlSource code
Dedicated LaptopPhase 424/7 live server
VPS UpgradePost-profitSetelah live proven
Platform Pages — Complete Sitemap
Auth & Access
Foundation — semua user wajib melewati ini
/login
/register
/forgot-password
Authentication Pages
Login dengan email/password. Register untuk user baru (invite-only). Reset password via email. JWT token management. Session timeout 8 jam.
Auth
Dashboard & Overview
Landing page setelah login
/dashboard
Main Dashboard
Overview status seluruh sistem: database health, last backtest run, active rulebook version, 5 pair status cards (latest signal/no-signal), upcoming high-impact news dalam 24 jam, recent activity log.
All Phases
Data Management · Phase 1 Layer
Monitor, verify, dan update data historis
/data/overview
Data Overview
Summary: total candles per pair per TF, date range coverage, last updated. Gap detection alerts. Database size & health metrics. Quick action: trigger data refresh.
Phase 1
/data/ohlcv
OHLCV Explorer
Table view candle data dengan filter: pair, timeframe, date range. Search & export. Inline chart preview. Flag indicator (PRE_NEWS / POST_NEWS). Missing candle detection & report.
Phase 1
/data/calendar
Economic Calendar
Tampilkan semua high-impact events: NFP, CPI, FOMC, BOE, dll. Filter by currency (USD/GBP/JPY) dan date range. Impact color coding. Actual vs forecast comparison. News flag coverage statistics.
Phase 1
/data/sessions
Session Box Manager
View & verify session High/Low records: Asia, London, NY, Overlap per pair per hari. Chart overlay: session box visualisasi. Range pip statistics per session per pair.
Phase 1
Strategy & Rulebook · Phase 2 Layer
Configure, manage, dan version-control rulebook
/strategy/rulebook
Rulebook Manager
View semua rules aktif (R.01–R.08). Edit parameters per rule. Version control: fork rulebook untuk testing variant. Diff view antara versions. Lock/unlock rule untuk backtest. Chief Trader approval flow.
Phase 2
/strategy/rules/[id]
Rule Detail Page
Detail satu rule: definisi binary, parameters, per-pair overrides, backtest performance history untuk rule ini. Toggle rule aktif/nonaktif. Audit log: siapa yang ubah apa dan kapan.
Phase 2
/strategy/parameters
Parameter Config
Configure semua 27 default parameters. Per-pair override: misal buffer SL berbeda untuk XAUUSD vs GBPUSD. Preview impact sebelum save. Reset to default option. JSON export/import.
Phase 2
/strategy/zones
Zone Library
View semua supply & demand zones yang terdeteksi (Phase 3 fill). Filter by pair, TF, validity status, test count. Zone strength scoring visualisasi. Mark zone manually. Zone lifecycle tracking: fresh → tested → degraded → invalid.
Phase 2
Backtest Engine · Phase 3 Layer
Run, monitor, dan analyze backtest results
/backtest/new
New Backtest Run
Configure backtest: pilih pair(s), session(s), date range (in-sample / out-of-sample), rulebook version, market condition filter (trending/ranging/high-vol). Preview estimated trades sebelum run. Submit ke queue.
Phase 3
/backtest/runs
Run History
List semua backtest runs: status (queued/running/done/failed), parameters, duration, total trades. Filter & sort. Quick stats: win rate, profit factor, max DD per run. Click untuk detail lengkap.
Phase 3
/backtest/runs/[id]
Backtest Detail
Full result: equity curve chart, trade-by-trade log, win rate per pair per session per condition, monthly breakdown, drawdown chart, profit factor. Walk Forward Analysis result. Monte Carlo survival rate. Gate status: LOCKED atau REJECTED per combination.
Phase 3
/backtest/compare
Run Comparison
Side-by-side comparison 2–4 backtest runs. Metric table: win rate, PF, max DD, avg RR, sample size per combination. Highlight perbedaan signifikan. Export comparison report sebagai PDF.
Phase 3
/backtest/matrix
Validation Matrix
Heat map: pair × session × condition. Warna: merah (REJECTED) → kuning (borderline) → hijau (LOCKED). Click cell untuk drill-down. Filter by threshold. Export matrix sebagai gambar/CSV. Gate summary: berapa kombinasi LOCKED dari total.
Phase 3
Analytics & Reporting
Deep insights dari seluruh data & backtest
/analytics/performance
Performance Analytics
Performance breakdown: per pair, per session, per year, per day-of-week, per market condition. Identify kombinasi terbaik dan terburuk. Correlation analysis antar pairs. Seasonal pattern detection.
Phase 3
/analytics/risk
Risk Analytics
Max drawdown timeline. Consecutive losses analysis. Monte Carlo percentile bands (5th, 25th, 50th, 75th, 95th). Stress test results: 3× spread scenario, black swan periods. Risk-adjusted return metrics.
Phase 3
/analytics/reports
Report Generator
Generate & export comprehensive reports: Phase 3 Validation Report (PDF), Rulebook Snapshot (PDF/HTML), Backtest Summary per pair. Schedule auto-report. Share link dengan expiry.
All
Settings & Administration
System config & user management
/settings/profile
User Profile
Edit nama, email, timezone setting (display only — DB tetap UTC). Change password. API key management untuk external integrations.
All
/settings/system
System Settings
Database connection status & health. Perl forwarder status monitor. FRED API key management. MT5 bridge connection status. Cron job monitor (auto-restart forwarder). Notification settings (email alert untuk backtest complete / system down).
Admin
/settings/users
User Management
Invite & manage trading team members. Role assignment: Chief Trader (full access) / Analyst (read + run) / Viewer (read only). Revoke access. Activity log per user.
Admin
/settings/audit
Audit Log
Seluruh perubahan sistem: rule edits, parameter changes, backtest runs, user actions. Filter by user, action type, date. Export audit trail. Immutable log — tidak bisa dihapus.
Admin
Platform Build Sequence — Milestone Order
M.01
Project Setup & Auth Foundation
Init Next.js project, FastAPI skeleton, PostgreSQL connection, Supabase auth setup, JWT middleware, login/register pages.
Next.jsFastAPISupabase AuthFirst
Start Here
M.02
Dashboard & Data Layer Pages
Main dashboard, OHLCV explorer, economic calendar viewer, session box manager. Connect ke existing Phase 1 database.
Phase 1 dataRead-only UICharts
Core
M.03
Strategy & Rulebook Module
Rulebook manager, rule detail, parameter config. Read & edit existing Rulebook V1. Version control & fork functionality.
Phase 2 dataCRUD rulesVersioning
Core
M.04
Backtest Engine Integration
New backtest form, job queue (Celery), progress tracking, result storage. Phase 3 engine backend ditulis di sini.
Phase 3 coreCelery queueEngine build
Required
M.05
Result Dashboard & Validation Matrix
Equity curve, trade log, validation matrix heatmap, comparison tool, gate status (LOCKED/REJECTED). Full analytics suite.
Phase 3 outputRechartsPDF export
Required
M.06
Settings, Admin & Audit Layer
User management, system health monitor, Perl forwarder status, audit log, notification system. Production-hardening.
AdminMonitoringHardening
Optional/Last
Platform live → Phase 3 Backtest & Validation dapat dimulai
Phase 3 — Backtest & Validation ◎ QUEUED
03
Phase 3

Backtest & Validation

Uji setiap kombinasi pair × strategi × session × kondisi secara statistik
Output
Locked Pairs
Objective: Menjalankan Rulebook V1 terhadap 10 tahun data historis. Output bukan sekadar win rate — melainkan per pair, per session, per kondisi, sehingga dapat diidentifikasi kombinasi mana yang truly robust dan mana yang kebetulan profitable. Platform adalah interface tempat ini semua berjalan dan divisualisasikan.
Backtest Matrix — Kombinasi yang Diuji
Pair Universe
5 Pairs
XAUUSD · NAS100 · US500 · GBPUSD · GBPJPY
Session Variants
3 Sessions
Asia · London · NY (per pair sesuai filter)
Market Condition
3 Regimes
Trending · Ranging · High-Volatility (news)
Strategy Variants
SnD + SMC
Pure SnD · SnD+SMC · SnD+Session filter
Data Period
10 Tahun
In-sample 7Y + Out-of-sample 3Y
Min Sample Size
≥ 200
Trade per kombinasi untuk validitas statistik
Validation Threshold — Minimum Gate Lolos
Win Rate
≥ 50%
Minimum acceptable
Profit Factor
≥ 1.5
Gross profit / gross loss
Max Drawdown
≤ 10%
Dari peak equity
RR Average
≥ 1:2
Per trade average
Sample Size
≥ 200
Trades per kombinasi
Konsistensi
Per Year
Tidak ada tahun negatif
Advanced Validation
V3.1
Walk Forward Analysis
In-sample 7Y untuk optimize, out-of-sample 3Y untuk validate. Degradasi >30% = FAIL. Strategi bagus di in-sample saja = overfitted.
In-sample: 7YOut-of-sample: 3YDegradasi >30% = FAIL
CORE
V3.2
Monte Carlo Simulation
1,000 simulasi dengan randomisasi urutan trade. Survival rate ≥ 95%. Menguji apakah profitabilitas bergantung keberuntungan urutan atau sistematis robust.
1,000 runsSurvival rate ≥ 95%
REQUIRED
V3.3
Stress Test — Extreme Conditions
3× spread, high slippage, black swan periods (COVID Mar 2020, SVB Mar 2023, dsb). Strategi harus survive — bukan profit — di kondisi ini.
3× spread scenarioBlack swan period
REQUIRED
Final Gate — Lock Decision
✓ LOCKED
Semua threshold terpenuhi. Walk forward valid. Monte Carlo ≥ 95%. Siap masuk Phase 4 Live Execution.
✗ REJECTED
Satu atau lebih threshold tidak terpenuhi. Kembali ke Phase 2 revisi rules — bukan dipaksakan lanjut.
Semua combination LOCKED → Phase 4 Live Execution
Phase 4 — Live Execution ○ FUTURE
04
Phase 4

Live Execution & Automation

Deploy validated strategy → real capital, automated execution
Output
Live System
Prerequisite: Phase 3 LOCKED — semua threshold terpenuhi, walk forward valid, Monte Carlo ≥ 95%. Eksekusi teknis semata — jika Phase 1–3 solid, Phase 4 adalah finishing step. Infrastructure: dedicated laptop sebagai 24/7 server → VPS upgrade setelah live proven profitable.
MT5 Auto-Execution Bridge — Python script eksekusi order otomatis dari signal Platform
Live Signal Dashboard — Real-time: current bias H4, zone proximity, entry conditions
Risk Manager — Auto lot-size calculation, max daily loss limiter, exposure monitor
24/7 Server Setup — Dedicated laptop → cron keepalive → VPS migration post-profit
Trade Journal — Auto-log setiap trade: entry, exit, reason, rule yang terpenuhi
Alert System — Telegram / email alerts: new signal, trade opened, SL hit, TP hit
⚠ Phase 4 Gate — Wajib Dipenuhi Sebelum Go-Live
01Platform berjalan stabil minimal 30 hari tanpa downtime di live environment.
02Paper trading 60 hari: performance mencerminkan backtest result (±15% tolerance).
03Emergency stop mechanism tested: sistem harus bisa halt semua eksekusi dalam < 5 detik.
PostgreSQL · thejourn_acl_rnd · ArenHost jakarta.kencang.com:8443
UTC-first · Partitioned OHLCV · Forward-compatible untuk multi-user SaaS
market Phase 1 ✓
ohlcv (partitioned 2000–2027)
session_boxes
fundamental Phase 1 ✓
economic_events
news_flags
strategy Phase 2 ✓
rulebook_versions
rules (8 rules)
rule_parameters (27)
zones
setups
backtest_runs
config Phase 1 ✓
pairs
timeframes
sessions
audit Phase 1 ✓
import_log
data_quality
platform NEW — Platform
users
user_sessions
notifications
audit_log
Phase 1 · Complete
Data Foundation
~3.17M candles historis, 9,015 economic events, 411,756 news flags. PostgreSQL database production-ready di ArenHost. UTC-first, partitioned, verified.
✓ Done3.17M candles9,015 events
Phase 2 · Complete
Strategy Codification
8 core binary rules (R.01–R.08) terdefinisi dan dikonfirmasi Chief Trader. strategy.* schema dieksekusi. Rulebook V1 locked. Exit gate G.01–G.05 terpenuhi.
✓ Done8 Rules Locked27 Parameters
Platform · Active Now
Alfa Capital Platform Build
Membangun Next.js + FastAPI platform: auth, dashboard, data explorer, rulebook manager, backtest runner, analytics. 6 milestone build sequence. Platform adalah prerequisite sebelum Phase 3 bisa dijalankan.
▶ Building6 MilestonesM.01–M.06
Phase 3 · Queued
Backtest & Validation
Rulebook V1 dijalankan terhadap 10Y data. Walk forward + Monte Carlo + Stress test. Setiap kombinasi pair×session×condition dinilai: LOCKED atau REJECTED. Dijalankan dari Platform.
◎ After PlatformWalk ForwardMonte Carlo
Phase 4 · Future
Live Execution & Automation
MT5 auto-execution bridge, live signal dashboard, risk manager. 24/7 dedicated laptop server → VPS upgrade post-profit. Paper trading 60 hari sebelum real capital.
○ FutureMT5 Bridge60-day paper first
Critical Constraints & Non-Negotiables
⚠ Non-Negotiable Rules — ACL Project
01UTC-first always. Semua timestamp stored dan processed dalam UTC. SET timezone = 'UTC' sebelum CREATE PARTITION. Session-level UTC enforcement di setiap koneksi DB.
02Binary rules, zero grey area. Setiap rule Phase 2 harus dapat dijawab YES atau NO. Jika masih ada "tergantung kondisi" → rule belum selesai ditulis.
03Forwarder awareness. Perl TCP forwarder drop connection pada operasi panjang. Mitigation: fresh connection per pair/TF operation + keepalive parameters.
04Schema forward-compatible. Platform columns (created_by, is_shared, rulebook_version) sudah ada sejak Phase 2 — tidak boleh ada schema migration besar di Phase 4.
05No live capital sebelum gate terpenuhi. Phase 4 gate wajib: 30 hari platform stable + 60 hari paper trading dalam ±15% dari backtest result.
06Min RR 1:2 hardcoded. Tidak ada trade di bawah RR 1:2. Ini dikodekan di sistem, bukan diserahkan ke judgment trader.
07Fixed universe selama RnD. Tidak ada pair tambahan sampai Phase 3 selesai. 5 pairs sudah cukup untuk membuktikan sistem.
------WebKitFormBoundaryqugHFavByZXUu41n Content-Disposition: form-data; name="overwrite" 0