Skip to content

Commit dde39a1

Browse files
JohnCCarterclaude
andcommitted
feat(research): add BTC MTF confluence sensitivity
CP2 robustness pass over CP1 confluence table. Adds stdlib cluster_confluence_fixed_band (complete-linkage in price + single-linkage in time) and run_sensitivity over predeclared epsilons 0.0025/0.005/0.01. Findings: c001 (~29274) robust 4-TF across methods/epsilons; c002 (~21167) chaining-dependent (4-TF only under single-linkage at eps>=0.005, span>eps; dissolves to 2-TF fragments under fixed-band). Single-linkage chaining 7%/14%/26% of clusters at the three epsilons. Conditional GO to CP3 visual atlas. Read-only, no chart, no tuning, no source-label change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 43111ec commit dde39a1

7 files changed

Lines changed: 492 additions & 36 deletions

File tree

docs/research_wiki/handoff.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ JSON unchanged, no new deps, no artifacts committed.
138138
No open implementation items remain in the #32 tooling track. **Corpus declared clean and
139139
locked** (integrity capstone 2026-06-15:
140140
[`reviews/btc-source-fib-corpus-integrity-20260615.md`](reviews/btc-source-fib-corpus-integrity-20260615.md)).
141-
**MTF confluence atlas in progress.** CP1 (confluence table) DONE — `research/mtf_confluence.py`
142-
(stdlib): 222 cross-TF clusters at epsilon_log=0.005 (2×4-TF); GO to CP2.
143-
[CP1 report](reviews/btc-mtf-confluence-table-20260615.md). **Next: CP2**
144-
sensitivity/robustness (multi-epsilon + complete-linkage), read-only, no tuning-to-fit.
145-
Design: [`reviews/btc-source-fib-next-research-plan-20260615.md`](reviews/btc-source-fib-next-research-plan-20260615.md).
141+
**MTF confluence atlas in progress.** CP1 ([table](reviews/btc-mtf-confluence-table-20260615.md))
142+
+ CP2 ([sensitivity](reviews/btc-mtf-confluence-sensitivity-20260615.md)) DONE —
143+
`research/mtf_confluence.py` (stdlib). CP2: c001 robust 4-TF; **c002 chaining-dependent** (not
144+
tight 4-TF); fixed-band 188 clusters @0.005; chaining 14% @0.005→26% @0.01. **Next: CP3 visual
145+
atlas (conditional)** — render fixed-band clusters + annotate `price_span_log`; no signal/edge.
146146

147147
**Deferred:** 1H source labeling — 4H is the lowest active timeframe; fetch 1H cache first
148148
(`data.fetch --timeframes 1h`). Separate decision before starting.

docs/research_wiki/log.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ Types: `ingest`, `decision`, `review`, `question`, `maintenance`.
1414
> Older entries (2026-06-10 and earlier): [part 3](log-archive-pre-btc-reset-part3.md)
1515
> [part 2](log-archive-pre-btc-reset-part2.md)[part 1](log-archive-pre-btc-reset-part1.md)
1616
17+
## [2026-06-15] review | MTF confluence CP2 — sensitivity / robustness
18+
19+
Robustness pass over CP1. Added stdlib `cluster_confluence_fixed_band` (complete-linkage in
20+
price + single-linkage in time) + `run_sensitivity` (9 new tests). Predeclared epsilons
21+
0.0025/0.005/0.01. Single-linkage total 173/222/266; chaining (span>ε) 12/30/70 = 7%/14%/26%.
22+
Fixed-band 144/188/242 (0 over-ε by construction). **c001 (~29274) robust 4-TF** across
23+
methods/epsilons (3-TF under fixed-band only at 0.01, a band-cut effect). **c002 (~21167)
24+
chaining-dependent** — 4-TF only under single-linkage at ε≥0.005 with span 0.00627>ε; dissolves
25+
to 2-TF fragments under fixed-band. Verdict: confluence is real but CP1 overstated c002.
26+
Conditional GO to CP3 visual atlas (render fixed-band + annotate span). No chart, no tuning,
27+
no source change. Full suite 394 passed, 75%. Report:
28+
[`reviews/btc-mtf-confluence-sensitivity-20260615.md`](reviews/btc-mtf-confluence-sensitivity-20260615.md).
29+
1730
## [2026-06-15] review | MTF confluence atlas CP1 — confluence table
1831

1932
First analytical slice on the locked corpus. New stdlib module `research/mtf_confluence.py`

docs/research_wiki/reviews/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ on 2026-06-08. They are **not** current evidence.
2929
| [btc-source-fib-next-research-plan-20260615.md](btc-source-fib-next-research-plan-20260615.md) | Next research-pass design (read-only) — recommends corpus integrity report (#2) now, MTF confluence atlas (#1) next |
3030
| [btc-source-fib-corpus-integrity-20260615.md](btc-source-fib-corpus-integrity-20260615.md) | Corpus integrity capstone (read-only) — counts 9/21/67/365, conventions, source-quality state, known caveats; corpus declared clean. Next: MTF confluence atlas |
3131
| [btc-mtf-confluence-table-20260615.md](btc-mtf-confluence-table-20260615.md) | MTF confluence atlas CP1 (read-only) — 222 cross-TF level clusters at epsilon_log=0.005 (2×4-TF); GO to CP2 sensitivity. `research/mtf_confluence.py` (stdlib) + CSV |
32+
| [btc-mtf-confluence-sensitivity-20260615.md](btc-mtf-confluence-sensitivity-20260615.md) | MTF confluence CP2 (read-only) — epsilon sensitivity (0.0025/0.005/0.01) + fixed-band vs single-linkage. c001 robust 4-TF; c002 chaining-dependent; chaining 14%→26%. Conditional GO to CP3 visual atlas. Summary CSV |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
epsilon_log,method,total_clusters,n_4tf,n_3tf,n_2tf,max_price_span_log,clusters_over_epsilon
2+
0.0025,single_linkage,173,1,13,159,0.004562,12
3+
0.0025,fixed_band,144,1,11,132,0.002477,0
4+
0.005,single_linkage,222,2,24,196,0.016427,30
5+
0.005,fixed_band,188,1,15,172,0.004711,0
6+
0.01,single_linkage,266,6,40,220,0.082249,70
7+
0.01,fixed_band,242,0,28,214,0.009918,0
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# BTC/USD MTF Confluence — Sensitivity / Robustness (Checkpoint 2, 2026-06-15)
2+
3+
Read-only robustness pass over the [CP1 confluence table](btc-mtf-confluence-table-20260615.md).
4+
Answers one question: **is the MTF-confluence result robust, or mostly an effect of the
5+
chosen epsilon and single-linkage chaining?**
6+
7+
**Scope honored:** read-only, no chart, no visual atlas, no trading/signal/edge
8+
interpretation, no 1H, no reaction-review, no auto-fib, no source-label change, no new deps,
9+
no committed PNG/artifacts. Epsilon values are **predeclared** (`0.0025, 0.005, 0.01`), not
10+
tuned. New code is stdlib-only + tested. Helper:
11+
[`research/mtf_confluence.py`](../../../src/fibengine/research/mtf_confluence.py) (+ 9 new
12+
tests). Committed summary: [btc-mtf-confluence-sensitivity-20260615.csv](btc-mtf-confluence-sensitivity-20260615.csv).
13+
14+
---
15+
16+
## Observed
17+
18+
- **Epsilon sensitivity (single-linkage, CP1 method):** cluster count scales with epsilon —
19+
**173 → 222 → 266** at epsilon_log `0.0025 / 0.005 / 0.01`. 4-TF clusters: **1 → 2 → 6**;
20+
3-TF: 13 → 24 → 40; 2-TF: 159 → 196 → 220.
21+
- **Chaining grows fast with epsilon.** Clusters whose `price_span_log > epsilon` (only
22+
possible under single-linkage): **12 / 30 / 70** (= 7% / 14% / 26% of all clusters). The
23+
widest single-linkage cluster reaches `price_span_log` **0.0046 / 0.0164 / 0.0822** — i.e.
24+
at epsilon 0.01 one "cluster" spans ~8.6% in price, far beyond the 1% threshold.
25+
- **Fixed-band removes all over-epsilon clusters by construction** (`clusters_over_epsilon`
26+
= 0 at every epsilon) and yields fewer clusters: **144 / 188 / 242**. 4-TF under fixed-band:
27+
**1 / 1 / 0**.
28+
- **c001 (~29274, ratios 0/1, 2021 cycle):** survives as a **4-TF** cluster intact under
29+
*both* methods at epsilon `0.0025` and `0.005` (span 0.00123, well inside epsilon). At
30+
epsilon `0.01` single-linkage keeps it 4-TF, but fixed-band's greedy band cut places the
31+
1M level in the neighbouring band → it reads as **3-TF** (1w,1d,4h, ~29283). A binning
32+
boundary effect, not a structural loss — the 1M level is still at ~29274.
33+
- **c002 (~21167, ratios 0.382/0.618, 2022–23 bottom):** does **not** survive as a tight
34+
cluster. Its CP1 4-TF status exists only under single-linkage at epsilon ≥ 0.005, and there
35+
its `price_span_log` is **0.00627 > 0.005** — it is itself a chained cluster. Details:
36+
- epsilon 0.0025, single-linkage: **no** 4-TF cluster near 21167 (closest is a 3-TF
37+
`1M,1w,4h` at ~20881). The 4-TF agreement does not exist at the tight epsilon.
38+
- epsilon 0.005, fixed-band: dissolves into several **2-TF** fragments (`1d,4h`; `1M,4h`;
39+
`1w,4h`; `1w,1d`) near 20386–21884 — no 4-TF or 3-TF survivor.
40+
- epsilon 0.01, single-linkage: balloons to a **7-level** 4-TF cluster spanning `0.023`
41+
(~2.3%) — heavy chaining. Fixed-band splits it into `1M,1d,4h` and `1w,1d,4h` (both 3-TF).
42+
43+
## Inferred
44+
45+
- **The result is partly robust, partly chaining-dependent — and the two strongest CP1
46+
clusters fall on opposite sides of that line.** c001 is a genuine, tight, epsilon- and
47+
method-stable 4-TF confluence. c002 is *not* a tight 4-TF coincidence; it is a region of
48+
several looser 2-TF pairings near the 2022–23 bottom that single-linkage chained into one
49+
4-TF cluster at the primary epsilon.
50+
- **Chaining inflates the headline counts at the loose end.** The jump to 6 four-TF clusters
51+
at epsilon 0.01 is largely chaining (fixed-band gives 0 four-TF there). The dense-TF
52+
dominance (`1d,4h`) persists across all cells, as expected from row counts.
53+
- **Local structure near c002 is real but weaker than CP1 implied:** fixed-band keeps the
54+
pieces multi-timeframe (≥2-TF), so they do not dissolve to 1-TF noise — there *is* MTF
55+
agreement in that price region, just not a single 4-TF point.
56+
57+
## Unverified
58+
59+
- **Greedy band cut points are price-position-dependent** (a known fixed-width-binning
60+
property). The c001→3-TF drop at epsilon 0.01 is an instance; a different deterministic
61+
banding could keep it 4-TF. Fixed-band is a robustness *probe*, not a canonical clustering.
62+
The parameter-free intact/chained metric (below) does not depend on cut placement.
63+
- Whether c002's region "should" count as one confluence or several is a definitional
64+
choice, not a fact the data settles.
65+
- No claim about price behavior, support/resistance strength, or predictive value — these
66+
remain geometric counts.
67+
68+
---
69+
70+
## Epsilon policy
71+
72+
Predeclared before running: **`epsilon_log ∈ {0.0025, 0.005, 0.01}`** (≈0.25% / 0.5% / 1.0%
73+
in price). `0.005` is the CP1 primary. Not tuned to produce a desired count.
74+
75+
## Method definitions
76+
77+
- **Single-linkage (CP1):** rows are connected iff `|Δlog_price| ≤ epsilon` **and** anchor
78+
windows overlap; a cluster is a connected component spanning ≥2 distinct timeframes. A
79+
cluster's total `price_span_log` **can exceed epsilon** when rows chain via intermediates.
80+
- **Fixed-band (CP2, new):** *complete-linkage in price, single-linkage in time.* Greedy
81+
banding over log-sorted rows — a band starts at the lowest unassigned row and extends while
82+
`log_price − band_min ≤ epsilon`, so **every cluster has `price_span_log ≤ epsilon`** (all
83+
member pairs within epsilon). Within a band, rows split into time-overlap connected
84+
components; keep components spanning ≥2 timeframes. Every fixed-band cluster is a **subset
85+
of one single-linkage cluster** at the same epsilon (partition refinement); the ≥2-TF
86+
survivor count can therefore *fall* (a 2-TF cluster may split into two dropped 1-TF bands).
87+
88+
## Count table (per epsilon × method)
89+
90+
| epsilon_log | method | total | 4-TF | 3-TF | 2-TF | over-ε | max span_log |
91+
|---|---|--:|--:|--:|--:|--:|--:|
92+
| 0.0025 | single-linkage | 173 | 1 | 13 | 159 | 12 | 0.00456 |
93+
| 0.0025 | fixed-band | 144 | 1 | 11 | 132 | 0 | 0.00248 |
94+
| 0.005 | single-linkage | **222** | **2** | 24 | 196 | 30 | 0.01643 |
95+
| 0.005 | fixed-band | 188 | 1 | 15 | 172 | 0 | 0.00471 |
96+
| 0.01 | single-linkage | 266 | 6 | 40 | 220 | 70 | 0.08225 |
97+
| 0.01 | fixed-band | 242 | 0 | 28 | 214 | 0 | 0.00992 |
98+
99+
### Parameter-free chaining probe (single-linkage, no band-cut dependence)
100+
101+
Of all single-linkage clusters, share with `span ≤ epsilon` (intact) vs `> epsilon` (chained):
102+
103+
| epsilon_log | total | intact | chained | chained % |
104+
|---|--:|--:|--:|--:|
105+
| 0.0025 | 173 | 161 | 12 | 7% |
106+
| 0.005 | 222 | 192 | 30 | 14% |
107+
| 0.01 | 266 | 196 | 70 | 26% |
108+
109+
**Most clusters are intact at the primary epsilon (192/222);** chaining is a minority effect
110+
at 0.005 but becomes material (26%) at 0.01.
111+
112+
### TF-combo breakdown (top combos per cell)
113+
114+
- **0.0025 SL (173):** 1d,4h=114 · 1w,4h=21 · 1M,4h=11 · 1w,1d,4h=9 · 1w,1d=6 · 1M,1w=4 · … · 1M,1w,1d,4h=1
115+
- **0.0025 FB (144):** 1d,4h=97 · 1w,4h=16 · 1M,4h=10 · 1w,1d,4h=9 · 1M,1w=4 · … · 1M,1w,1d,4h=1
116+
- **0.005 SL (222):** 1d,4h=143 · 1w,4h=30 · 1w,1d,4h=16 · 1M,4h=13 · … · 1M,1w,1d,4h=2 · 1M,1w,1d=1
117+
- **0.005 FB (188):** 1d,4h=122 · 1w,4h=25 · 1M,4h=12 · 1w,1d,4h=11 · 1w,1d=6 · … · 1M,1w,1d,4h=1
118+
- **0.01 SL (266):** 1d,4h=164 · 1w,1d,4h=28 · 1w,4h=27 · 1M,4h=14 · … · 1M,1w,1d,4h=6
119+
- **0.01 FB (242):** 1d,4h=152 · 1w,4h=33 · 1w,1d,4h=21 · 1M,4h=15 · … · 1M,1w,1d=1 (no 4-TF)
120+
121+
`1d,4h` dominates every cell (dense-TF bias by construction, unchanged by method).
122+
123+
## Survival of top CP1 clusters
124+
125+
| CP1 cluster | 0.0025 SL | 0.0025 FB | 0.005 SL | 0.005 FB | 0.01 SL | 0.01 FB | verdict |
126+
|---|---|---|---|---|---|---|---|
127+
| **c001** ~29274 | 4-TF | 4-TF | 4-TF | 4-TF | 4-TF | 3-TF\* | **robust** |
128+
| **c002** ~21167 | (3-TF, ~20881) | 2-TF frags | 4-TF (span>ε) | 2-TF frags | 4-TF (7-lvl, span 0.023) | 3-TF×2 | **chaining-dependent** |
129+
130+
\* c001's 4th TF (1M) lands in the adjacent greedy band at the loose epsilon — a cut-position
131+
effect, not a structural loss. c003–c010 are predominantly `1w,1d,4h` / `1M,*` 3-TF and many
132+
have `span = 0` (exact-price coincidences, e.g. c004/c006/c007 at $64829/$13764/$9085); those
133+
zero-span clusters are immune to both epsilon and chaining and survive trivially.
134+
135+
## Chaining impact
136+
137+
- At the primary epsilon, **30/222 (14%)** single-linkage clusters are chaining-affected
138+
(span > ε); fixed-band removes all of them (0 over-ε) and reduces the total 222 → 188 (−34,
139+
−15%). The 4-TF count drops 2 → 1: **c002 is the cluster lost**, c001 is kept.
140+
- The picture **remains meaningful**: 188 fixed-band clusters at primary epsilon, still
141+
including a true 4-TF (c001), 15 three-TF, and 172 two-TF. MTF confluence is not an artifact
142+
of chaining — but the *strength* of the second-ranked cluster (c002) was overstated by CP1's
143+
single-linkage definition.
144+
145+
---
146+
147+
## Stop/Go → Checkpoint 3 (visual atlas)
148+
149+
**CONDITIONAL GO — with a corrected headline.** The core finding holds: real, epsilon- and
150+
method-stable MTF confluence exists (c001 the clearest case; 188 fixed-band clusters at primary
151+
epsilon). But CP2 corrects CP1: **c002 is chaining-dependent, not a tight 4-TF confluence**,
152+
and 4-TF counts at loose epsilon are inflated by chaining. A visual atlas (CP3) is justified
153+
*if* it (a) renders the **fixed-band** clusters (or shows both definitions side by side), and
154+
(b) annotates `price_span_log` so wide/chained clusters are visible. Do not promote any
155+
cluster as support/resistance or signal. Still no chart in CP2; CP3 remains the first step that
156+
draws anything, and stays conditional on this corrected basis.
157+
158+
## Verification
159+
160+
- Counts re-derived on disk via `run_sensitivity` over the 2772-row / 462-fib corpus;
161+
predeclared epsilons only.
162+
- Fixed-band invariant checked: `clusters_over_epsilon = 0` at all epsilons (test +
163+
CLI output).
164+
- c001/c002 survival traced directly from cluster outputs at each epsilon × method.
165+
- 9 new unit tests (known-chain split, fixed-band max-span ≤ ε, fixed-band cross-TF &
166+
time-overlap requirements, refinement, deterministic ordering, span-partition,
167+
sensitivity determinism, sensitivity CSV header). Full suite: 394 passed, 75% coverage.
168+
- No source labels changed; committed output is the 6-row summary CSV under `docs/`; full
169+
per-epsilon cluster CSVs are gitignored under `experiments/review/mtf_confluence/`.
170+
171+
## Links
172+
173+
- [CP1 confluence table](btc-mtf-confluence-table-20260615.md) · [corpus integrity](btc-source-fib-corpus-integrity-20260615.md) · [next-research-plan](btc-source-fib-next-research-plan-20260615.md)
174+
- [committed sensitivity summary CSV](btc-mtf-confluence-sensitivity-20260615.csv)

0 commit comments

Comments
 (0)