SniperGold_ML/ml/p3/smc_semantic
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-23 07:03:30 +07:00
..
human_package docs: standardize project markdown to English 2026-08-22 17:21:46 +07:00
machine_package docs: standardize project markdown to English 2026-08-22 17:21:46 +07:00
output docs: define future ML path architecture from canonical Candidate Setup 2026-08-23 07:03:30 +07:00
audit_choch_state.py research: P3-S.3 CHoCH/MSS formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:01:54 +07:00
audit_liquidity_sweep.py research: P3 SMC Semantic Golden Dataset Phase 1 - Liquidity Sweep (locate+formalize+60 golden cases+machine annotation+event-state audit) 2026-08-22 07:23:37 +07:00
comparison.py research: P3-S.1 machine annotation freeze (f7_v2) + human annotation package (blind) 2026-08-22 08:10:48 +07:00
gen_human_package.py research: P3-S.1 machine annotation freeze (f7_v2) + human annotation package (blind) 2026-08-22 08:10:48 +07:00
gen_p3_s14_report.py test: define F4 mtf-training-alignment session report generator 2026-08-23 06:48:03 +07:00
integrity_audit.py research: P3-S.1 machine annotation freeze (f7_v2) + human annotation package (blind) 2026-08-22 08:10:48 +07:00
machine_annotator.py research: P3-S.1 machine annotation freeze (f7_v2) + human annotation package (blind) 2026-08-22 08:10:48 +07:00
md_language_inventory.py docs: add markdown language inventory tooling (P3-MD standardization audit) 2026-08-22 17:22:11 +07:00
parity_choch_pivot_check.py research: P3-S.3 CHoCH/MSS formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:01:54 +07:00
probe_state.py research: P3 SMC Semantic Golden Dataset Phase 1 - Liquidity Sweep (locate+formalize+60 golden cases+machine annotation+event-state audit) 2026-08-22 07:23:37 +07:00
README.md docs: standardize project markdown to English 2026-08-22 17:21:46 +07:00
review_output.py research: P3 SMC Semantic Golden Dataset Phase 1 - Liquidity Sweep (locate+formalize+60 golden cases+machine annotation+event-state audit) 2026-08-22 07:23:37 +07:00
sample_cases.py research: P3 SMC Semantic Golden Dataset Phase 1 - Liquidity Sweep (locate+formalize+60 golden cases+machine annotation+event-state audit) 2026-08-22 07:23:37 +07:00
smc_semantic_common.py fix: correct f7 liquidity grab event lifecycle (P3-S.0 safe semantic bug repair) 2026-08-22 07:46:00 +07:00
spec_test_cases_candidate_setup.json research: checkpoint P3-S.7/P3-S.8/P3-S.9 evidence chain (MTF alignment, candidate setup, architecture review) 2026-08-22 21:53:38 +07:00
spec_test_cases_choch_mss.json research: P3-S.3 CHoCH/MSS formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:01:54 +07:00
spec_test_cases_displacement.json research: P3-S.6 Displacement formal spec + conformance audit (CONFORMING) 2026-08-22 18:40:14 +07:00
spec_test_cases_fvg.json research: P3-S.4 FVG formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:53:29 +07:00
spec_test_cases_liquidity_sweep.json research: formalize liquidity sweep specification and conformance audit 2026-08-22 16:40:11 +07:00
spec_test_cases_mtf_alignment.json research: checkpoint P3-S.7/P3-S.8/P3-S.9 evidence chain (MTF alignment, candidate setup, architecture review) 2026-08-22 21:53:38 +07:00
spec_test_cases_mtf_training_alignment.json test: define F4 MTF training alignment coverage 2026-08-23 06:46:36 +07:00
spec_test_cases_order_block.json research: P3-S.5 Order Block formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 18:13:22 +07:00
spec_tests_candidate_setup.py research: checkpoint P3-S.7/P3-S.8/P3-S.9 evidence chain (MTF alignment, candidate setup, architecture review) 2026-08-22 21:53:38 +07:00
spec_tests_candidate_setup_runtime.py test: define F3 candidate setup regression coverage 2026-08-22 23:19:31 +07:00
spec_tests_choch_mss.py research: P3-S.3 CHoCH/MSS formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:01:54 +07:00
spec_tests_displacement.py research: P3-S.6 Displacement formal spec + conformance audit (CONFORMING) 2026-08-22 18:40:14 +07:00
spec_tests_event_contract.py test: define F1 event contract regression coverage 2026-08-22 22:01:26 +07:00
spec_tests_fvg.py research: P3-S.4 FVG formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 17:53:29 +07:00
spec_tests_liquidity_sweep.py research: formalize liquidity sweep specification and conformance audit 2026-08-22 16:40:11 +07:00
spec_tests_mtf_alignment.py research: checkpoint P3-S.7/P3-S.8/P3-S.9 evidence chain (MTF alignment, candidate setup, architecture review) 2026-08-22 21:53:38 +07:00
spec_tests_mtf_training_alignment.py test: define F4 MTF training alignment coverage 2026-08-23 06:46:36 +07:00
spec_tests_order_block.py research: P3-S.5 Order Block formal spec + conformance audit (PARTIALLY CONFORMING) 2026-08-22 18:13:22 +07:00
spec_tests_zone_contract.py test: define F2 zone contract regression coverage 2026-08-22 22:32:56 +07:00
test_f7_lifecycle.py fix: correct f7 liquidity grab event lifecycle (P3-S.0 safe semantic bug repair) 2026-08-22 07:46:00 +07:00

ml/p3/smc_semantic — SMC Semantic Golden Dataset (Phase 1: LIQUIDITY SWEEP)

Session: P3 SMC Semantic Validation (2026-08-22). NO ML.

UPDATE P3-S.0 (2026-08-22) — f7 event lifecycle fix

  • f7 (DetectLiquidityGrabs) corrected from persistent state -> event lifecycle: f7_lifecycle() with expiration SEQ_WINDOW=40 (InpSeqWindow v4.4 — existing semantics).
  • Test: test_f7_lifecycle.py (R1-R6 + historical) — 15/15 PASS.
  • Machine annotation rebuilt: output/machine_annotations_f7_v2.csv (22/60 cases changed, all persistent-state corrected; f10/f11 unchanged).
  • Details: docs/P3_S_F7_EVENT_LIFECYCLE_FORENSIC.md.

UPDATE P3-S.1 (2026-08-22) — Machine Freeze + Human Annotation prep

  • machine_annotations_f7_v2.csv = FROZEN machine reference (source_commit b519a34).
  • Integrity audit: integrity_audit.py -> output/integrity_audit_f7_v2.json — ALL PASS (case set 60/60 v1==v2; YES 45 / NO 15 all stale; diff 22/38/22/0 lifecycle-only; field contract complete).
  • Blind package: human_package/ (cases.csv, f7 template, protocol, context_m15/) + machine_package/ (BLINDED — annotators must not open).
  • comparison.py extended: inter-rater A/B + machine-vs-consensus + levels 1-3 + false agreement + timeframe/rejection agreement.
  • Human annotation: PENDING (waiting for annotators A/B -> human_A_f7.csv / human_B_f7.csv).
  • Details: docs/P3_S1_HUMAN_MACHINE_F7_VALIDATION.md.

Objective

Prove whether the MQL5 implementation (FEATURE_CONTRACT v1.0) represents the SMC Liquidity Sweep concept semantically the same way humans understand it.

Architecture

MQL5 (existing code)  -> machine_annotator.py  -> machine_annotations.csv
Trader (MT5 chart)    -> human_A.csv / human_B.csv   (BLINDED, up to decision_timestamp)
Python                -> comparison.py               -> comparison_report.json

Files

File Role
smc_semantic_common.py shared infrastructure (reuses p3_common + train_model; exact f7/f10/f11 semantics)
sample_cases.py stratified sampling of 50-100 golden cases (state machine, vol, regime, year)
machine_annotator.py machine annotation from existing code (v2: f7 lifecycle corrected)
test_f7_lifecycle.py regression R1-R6 + historical before/after (P3-S.0)
human_annotation_template.csv empty template for human annotators (A/B)
comparison.py Human A vs B; Machine vs Human; false-agreement; timeframe audit
audit_liquidity_sweep.py event-vs-state test + actual definition + spec regression test
probe_state.py quick state-distribution probe (debug)
review_output.py sanity check of annotation results
output/ cases.csv, cases_meta.json (BLINDED), machine_annotations.csv, audit JSON, comparison JSON

Usage

1. python sample_cases.py 60 42        # create 60 golden cases -> output/cases.csv (+meta BLINDED)
2. python machine_annotator.py         # machine annotation -> output/machine_annotations.csv
3. python audit_liquidity_sweep.py     # event-vs-state audit -> output/audit_liquidity_sweep.json
4. [HUMAN] copy human_annotation_template.csv -> human_A.csv & human_B.csv;
   annotators view the MT5 chart ONLY up to decision_timestamp.
   MUST NOT view cases_meta.json / machine_annotations.csv before finishing.
5. python comparison.py human_A.csv human_B.csv   # -> output/comparison_report.json

Key findings of this session (see docs/P3_SMC_SEMANTIC_GOLDEN_DATASET.md)

  • f7 (DetectLiquidityGrabs) = PERMANENT STATE: active 99.95% of bars, NEVER resets to 0 after the first grab; a single grab dominates the state with median 94 bars (max 996).
  • f10/f11 (DetectEQ) = monotonic state (35-43x repetition per onset).
  • f10/f11 have NO close-back/rejection (definition chosen via AUC, DESAIN_MTF_v45.md).
  • Machine "no sweep" exists only in 104 bars (0.05%) -> the golden set deliberately uses state age to expose the event-vs-state semantics.
  • Windowed-vs-fullfeed f7 divergence: 0/1500 probes (empirically a non-issue).

Discipline

Do not choose definitions based on backtests. STOP before production modification if there is definition ambiguity / high human disagreement / event-state bug.