CAT researchOverviewEURUSDGBPUSDXAUUSDGBPCADEURCADAUDJPYGBPJPYResearch notes

ZMS — MTF AVWAP-Z Structure strategy: first tester read (2026-08-26)

Script: mtf_zstructure_strategy.pine → TV "MTF AVWAP-Z Structure [ZMS]" (USER;238734d0b0344ea7b5f318bbac9d0317, v5 saved 2026-08-26) Spec / plan: docs/superpowers/specs/2026-08-26-mtf-avwapz-structure-strategy-design.md, docs/superpowers/plans/2026-08-26-mtf-avwapz-structure-strategy.md Status: UNTESTED design, first in-sample read. No edge claim. Nothing here is pre-registered.

What was built

Daniel's design (2026-08-26 brainstorm): H1/H4 AVWAP-Z extreme episode = bias (lowest-low bar of the episode = stop); on the 5m, an opposite-side extreme episode = counter-impulse; Path 1 = pullback below the last 5m triangle bar, then stop order at the impulse extreme; Path 2 = a same-side 5m extreme inside the correction (above the HTF stop) → market entry when the 5m z comes back inside. T1 = driver basis (50%), T2 = driver opposite extreme band (live-tracked), stop = HTF episode extreme, bias lives until stop-close / target touch / timeout. H1 levels win when both TFs agree; H1 wins conflicts. Pyramiding max 3 per bias, R:R gate 1.0 to T2. PBK/AKAO deliberately out of v1.

Engine: verbatim port of the AVWAP-Z z engine, native on the chart TF, request.security(…, expr[1], lookahead_on) for H1/H4 (completed-bar semantics, identical historical/realtime).

Verification (evidence)

Check Result
Native engine parity, 5m chart (ZMS z chart vs AVWAP-Z Z-score) 300/300 bars, max diff 0
Native engine parity, H1 chart 399/399 bars, max diff 0
Native engine parity, H4 chart 399/399 bars, max diff 0; thresholds identical (2.2141)
MTF alignment on 5m: zH1 at each new H1 period vs H1 indicator z at that completed bar 34/34 bars, max diff 6.5e-13; thresholds 5e-13
MTF alignment on 5m: zH4 vs H4 indicator z 9/9 bars, max diff 1.8e-13
H4 threshold from a 5m chart +0.081σ vs the H4 chart (2.2948 vs 2.2141): request.security only loads ~200 days of H4 → 887-bar calibration instead of 2000. Engine now uses min(calibLen, non-na bars); HUD shows "(H4 cal N)" when reduced. Same effect on the H1 leg for the first ~83 days of the 5m range.
Event-log audit (2026-08-17 → 08-26, 2453 5m bars) bias start/dead, ARM/READY/order/fill sequence follows the rules; stop ratchets during running episodes; H1 death hands the driver to H4
HUD + cell-stats tables render (fix: strategies with calc_on_every_tick=false do not execute on the open realtime bar, so barstate.islast alone never fires while the market is open — draw on islastconfirmedhistory too)
Fill accounting bug found and fixed: T1 partial exits increment strategy.closedtrades and were counted as entries (HUD showed "entries 5 / 3"); fills are now detected by the pending order id

Build pipeline lessons are in the memory file (tradingview-mcp-quirks).

Tester reads — EURUSD, FXCM feed, defaults unless stated

Costs: slippage 2 ticks/side, no commission. Sizing 10% equity per entry (1 pip ≈ 0.10 USD at 10k initial capital → USD figures ×10 = pips). Cell stats are per closed leg (T1 and T2 legs count separately).

5m chart (Feb 9 → Aug 26 2026, ~6.5 months)

Variant trades win% PF net pips max DD pips
Defaults (H1 + H4) 90 54.4 1.02 +7 365
H1 bias only 55 60.0 1.34 +93 134
H4 bias only 47 34.0 0.40 −359 392
Defaults + fib depth 0.382 65 47.7 0.90 −59 313

Per-cell (defaults build):

cell n win% PF avg pips net pips
H1 · Path 1 (breakout) 34 67.6 1.82 +6.4 +217
H1 · Path 2 (deep correction) 19 52.6 1.45 +5.4 +103
H4 · Path 1 31 45.2 0.50 −13.5 −419
H4 · Path 2 6 33.3 2.88 +30.5 +183

With fib 0.382: H1P1 n=13 PF 0.92 — the filter removes the profitable fast breakouts; not helpful.

15m chart (Jan 2 2025 → Aug 26 2026, 20 months)

36 trades, 47% win, PF 0.45, −241 pips. Cells: H1P1 n=1, H1P2 n=22 PF 0.62, H4P1 n=4, H4P2 n=9 PF 0.25. On a 15m chart the "impulse" is a 15m extreme episode — a different, rarer object. The design is 5m-specific.

Sensitivity sweep (same day, EURUSD 5m, H1-bias-only base) — IN-SAMPLE, one lever at a time

Not an optimisation: each row changes one input from the H1-only base to see which levers matter. Any "best" row here is selected after seeing the results and must be treated as fitted until forward data says otherwise.

Variant (H1 only unless stated) trades win% PF net pips max DD pips
Base: split 50, R:R 1.0, max entries 3, Extreme band 57 59.6 1.40 +120 135
T1 split 0 (all at opposite band) 31 48.4 1.28 +111 232
T1 split 100 (all at basis) 31 71.0 1.42 +84 74
Min R:R off 62 59.7 0.76 −171 502
Min R:R 1.5 49 55.1 1.20 +44 106
Max entries 1 (no pyramiding) 35 65.7 1.72 +106 40
Target band Elevated 46 56.5 0.89 −25 131
Combined: max entries 1 + split 100 19 84.2 3.45 +131 28

Reading: (1) the R:R gate is structural — removing it adds 5 trades that cost 290 pips; (2) pyramiding adds almost no net (+14p) for 3x the drawdown; (3) basis-only exits keep most of the net at half the DD — consistent with the July finding that basis-tag was the best exit and band-to-band a runner only. The combined row is 19 trades in 6.5 months: too few to mean anything beyond "the losses come from the adds and the far target".

Plain reading

  • The H1-bias / 5m-structure combination is the only positive cell: +217p (n=34 legs, PF 1.8) on Path 1, +103p on Path 2, over 6.5 months in-sample, before any out-of-sample or cost stress. That is a small sample in a single regime window and must not be read as edge.
  • H4 bias reproduces the July anti-evidence (pure 4h fades PF 0.55 over 14y): PF 0.40 here. Default recommendation for forward observation: Use H4 bias = off.
  • The stop at the HTF episode extreme is far from 5m entries (H4: 50+ pips); the R:R gate at 1.0 is doing real work. Losses are structural and large; DD 134 pips even H1-only.
  • "Correction" under rule (b) is often one bar; deeper corrections (fib) hurt. Daniel's stated preference for fast, same-bar detectors is consistent with this — but it also means most entries are momentum continuations of the 5m impulse, not classic pullback entries.
  • Sample: 5m history on this feed only reaches Feb 2026; the 1h fade regime has been dormant since Sep 2025 (July study), so the window is unfavourable a priori.

XAUUSD out-of-sample test (2026-08-26, same day) — FAILS

Pre-registered intent: the July program's standing rule is that a rule which dies on gold was never there. This is the transfer test, run on the SAME script with only the cost constant changed.

Setup. FX:XAUUSD (FXCM), 5m chart, Feb 2 -> Aug 26 2026 (~6.7 months, comparable window to the EURUSD read). mintick = 0.01, so the EURUSD build's slippage=2 is only $0.04 round-turn on gold. A cost variant with slippage=18 ($0.36 RT, matching the ~$0.35 spread assumption used in July) was compiled for the costed rows; everything else is byte-identical to mtf_zstructure_strategy.pine. Stats-table "pips" on gold = 0.1 price units (pipMult = 1/(mintick*10)), i.e. divide by 10 for dollars of gold move.

Engine parity on gold: 350/350 bars, max |diff| = 0 vs the AVWAP-Z indicator. The port is correct on this symbol; the result below is a real result, not a broken engine.

Variant cost trades win% PF net $ max DD $
Defaults (H1+H4) none ($0.04 RT) 50 30.0 0.43 −133 145
Defaults (H1+H4) $0.36 RT 50 30.0 0.42 −135 146
H1 bias only none 33 45.5 1.10 +9 44
H1 bias only $0.36 RT 33 45.5 1.09 +8 44
EURUSD "best" combo (H1 only, max entries 1, split 100) $0.36 RT 10 70.0 0.68 −12 34

Per-cell, defaults + costs ("pips" = $0.1 gold):

cell n win% PF avg pips net pips
H1 · Path 1 7 42.9 0.77 −46.5 −326
H1 · Path 2 19 42.1 1.08 +23.8 +453
H4 · Path 1 20 20.0 0.16 −482 −9,648
H4 · Path 2 4 0.0 0.00 −947 −3,788

Verdict: the strategy does not transfer to gold.

  1. The EURUSD winner is the gold loser. H1·Path 1 was the whole case on EURUSD (PF 1.82, +217p). On gold it is PF 0.77 on n=7. The only non-negative gold cell is H1·Path 2 (PF 1.08) — the cell that was second on EURUSD. A signal whose best cell swaps between instruments is a sampling artifact, not a mechanism.
  2. The tuned configuration fails hardest. The EURUSD sweep's best row (PF 3.45) delivers PF 0.68 here, with 70% winners and a negative total — the classic signature of fitted exits: many small wins, few huge losses. This is the strongest evidence in the whole study that the sweep was fitting noise.
  3. Costs are not the excuse. Realistic gold spread moved PF by 0.01 (1.10 -> 1.09). The design is flat on gold before any cost, so "it would work with better fills" is not available as a defence.
  4. H4 bias is catastrophic, not merely bad. −$1,343 of gold move across 24 trades. The mechanism is visible: the stop sits at the H4 episode extreme, which on gold is $50–100 from a 5m entry, so the R:R gate passes trades whose target is equally far, and each loss is a full structural stop. On EURUSD the same flaw cost −419 pips; gold just has the volatility to show it properly.

What this does NOT prove. It does not prove the EURUSD H1 cell is fake — only that it is unsupported outside its own sample. Both windows are ~6.5 months of one regime, and the July program showed this pair's edge was already dormant since Sep 2025. The honest status is unchanged and now weaker: untested idea, one favourable in-sample window, failed its first transfer test.

Consequence for the plan. The "improvements" list from earlier is now re-ordered: the risk-shape fix (trade stop at 5m structure rather than at the HTF episode extreme) is no longer item 2 of a tuning list, it is the only change with a mechanism-level argument behind it, and it should be tested on BOTH instruments simultaneously before anything else is touched. Tuning EURUSD further is contraindicated.

Build note. slippage is a compile-time constant, so the gold rows required a separate compile. The saved TV script was restored to the EURUSD build (v7, slippage=2, defaults) after the test; no permanent XAU variant was created. To reproduce: sed 's/slippage=2,/slippage=18,/' mtf_zstructure_strategy.pine.

GBPUSD test (2026-08-26, same day) — the cell ranking INVERTS again

GBPUSD was a declared holdout instrument (MASTER_HANDOFF_claude_code.md); Daniel unlocked it explicitly. FX:GBPUSD (FXCM), 5m, Feb 9 -> Aug 26 2026. mintick 0.00001 = same as EURUSD, so the EURUSD build's slippage=2 (0.4 pip RT) is directly comparable; a cost-stress row at slippage=4 (0.8 pip RT) was also run. Engine parity on GBPUSD: 400/400 bars, max |diff| = 0.

Variant cost trades win% PF net $ max DD $
Defaults (H1+H4) 0.4p RT 107 53.3 1.18 +19 45
H1 bias only 0.4p RT 50 48.0 1.25 +10 20
H4 bias only 0.4p RT 82 58.5 1.76 +48 24
H4 bias only 0.8p RT 82 58.5 1.74 +47 25
EURUSD "best" combo (H1 only, max entries 1, split 100) 0.4p RT 14 57.1 0.79 −5 12

H4-only cells (costed): H4·Path 1 n=62, 66.1% win, PF 2.72, +1,705 pips; H4·Path 2 n=20, PF 1.05.

The three-instrument picture — this is the actual finding

Headline configurations:

Config EURUSD XAUUSD GBPUSD
Defaults (H1+H4) 1.02 0.42 1.18
H1 only 1.34 1.09 1.25
H4 only 0.40 ~0.1 1.76
EURUSD-tuned combo 3.45 0.68 0.79

Per-cell PF under defaults:

cell EURUSD XAUUSD GBPUSD
H1 · Path 1 1.82 0.77 0.73
H1 · Path 2 1.45 1.08 1.00
H4 · Path 1 0.50 0.16 2.12
H4 · Path 2 2.88 (n=6) 0.00 2.06

1. Every cell's rank changes with the instrument. H4·Path 1 spans PF 0.16 -> 2.12. H1·Path 1 spans 1.82 -> 0.73. On EURUSD the strategy is an H1 strategy; on GBPUSD it is an H4 strategy; on gold it is neither. There is no configuration of this design that is "the" configuration — the tester simply reports which sub-rule happened to fit that instrument's last six months.

2. My headline recommendation was wrong, and provably so. After EURUSD and gold I recommended Use H4 bias = off. On GBPUSD that setting is the single best variant in the entire study (PF 1.76, robust to double costs). Two instruments agreeing did not make the rule real; the third reversed it. This is the clearest example in this project of an in-sample recommendation that would have been actively harmful.

3. The tuned combo fails on both out-of-sample instruments (3.45 -> 0.68 -> 0.79), with high win rates and negative totals in both. The sweep fitted noise; that is now confirmed twice, not argued.

4. What actually survives all three: H1-only, weakly. PF 1.34 / 1.09 / 1.25 — the only configuration that is not negative anywhere. But (a) the gold instance is +$8 on 33 trades, i.e. indistinguishable from zero; (b) the profit inside it comes from a different path on each instrument (EURUSD Path 1 carries it, GBPUSD Path 2 carries it, gold neither). A positive number whose internal source moves each time is not an identified mechanism. It is the weakest possible "not yet falsified", not an edge.

Standing conclusion. ZMS reproduces the July program's result exactly: the AVWAP-Z pair generates real context but every mechanical assembly of it is instrument-fitted. No variant of this design should be traded mechanically, and no further parameter selection should be done on any single instrument — any future change must be judged on all three simultaneously, in advance.

XAUUSD on 15m with H4 bias (2026-08-26) — best gold number so far, and it still fails the triple

Daniel asked to try gold on a 15m chart with the H4 bias (the 5m runs had used both biases and a 5m impulse). This is a fourth configuration searched on gold, so it is exploration, not validation, and it was held to the three-instrument rule written above. Engine parity on XAUUSD 15m: 325/325 bars, max |diff| = 0. Methodological note: on a 15m chart the H4 percentile window reaches the full 2000 bars (no "H4 cal N" flag), versus 882 bars from a 5m chart — so this run uses correctly calibrated H4 thresholds, unlike the 5m gold runs. Window: Dec 2 2024 -> Aug 26 2026 (21 months, 3x the 5m window). Cost $0.36 RT (slippage=18).

XAUUSD 15m, by bias:

Config n win% PF net $ Outliers $ ex-outlier PF ex-outlier net
H4 only 30 43.3 2.14 +97.80 64.93 1.38 +32.87
Defaults (H1+H4) 36 44.4 1.66 +67.02 105.38 0.62 −38.36
H1 only 15 60.0 2.65 +43.01 40.45 1.10 +2.56

Cells (H4-only, costed): H4·Path 1 n=16, PF 0.31, −4,632 pips; H4·Path 2 n=14, PF 8.79, +13,731 pips.

The whole gold 15m result is two trades. TradingView flags exactly two outliers in the entire study: +$64.93 (an H4 trade) and +$40.45 (an H1 trade). Their sum, $105.38, is exactly the Outliers PnL reported for the defaults run — confirming there are only these two. Remove them and: H4-only drops 2.14 -> 1.38, H1-only drops 2.65 -> 1.10 (+$2.56 over 21 months on 14 trades, i.e. zero), and the default config goes negative (0.62, −$38). A PF of 8.79 on n=14 with a 43% win rate was the tell before the outlier data confirmed it.

Transfer test of this exact configuration (15m chart + H4 bias only):

Instrument n win% PF net $ ex-outlier PF ex-outlier net
XAUUSD 30 43.3 2.14 +97.80 1.38 +32.87
EURUSD 23 39.1 0.20 −38.99 0.11 −43.28
GBPUSD 28 53.6 1.83 +33.29 0.79 −6.53

Verdict: fails. The configuration that returns PF 2.14 on gold returns PF 0.20 on EURUSD — the worst single number produced anywhere in this study, worse than any gold or H4 result on the 5m chart. On the ex-outlier basis only gold is above 1.0, and both FX pairs are below it. This is the same instrument-fitting seen on the 5m chart, now reproduced on a different timeframe with a longer window and correctly calibrated thresholds — so neither "wrong timeframe" nor "short window" nor "bad H4 calibration" explains the earlier failures. They were the design.

Rate of trades. 30 trades in 21 months (1.4/month) on gold, 23 and 28 on the FX pairs. Even where the sign is favourable, no configuration of ZMS on 15m produces a sample that could distinguish edge from luck within a year of forward trading.

NASDAQ:META, 5m chart + H1 bias (2026-08-26) — worst result in the study, and the first with a MECHANISM

First equity test (Daniel's ask). NASDAQ:META, 5m, RTH session 0930-1600, Aug 5 2024 -> Aug 26 2026 (24 months). mintick 0.01; the FX build's slippage=2 = $0.04 round-turn, which is realistic-to-conservative for a mega-cap at penny spreads (per-share commission NOT modelled — the real result would be worse). Engine parity on META: 322/322 bars, max |diff| = 0 — the port is correct on equities too.

Config n win% PF net $ Outliers $ ex-outlier PF ex-outlier net
H1 bias only 25 44.0 0.29 −187 −76 (losses) 0.41 −111

Cells: H1·Path 1 n=10, 60.0% win, PF 0.26; H1·Path 2 n=15, 33.3% win, PF 0.30.

Note the H1·Path 1 signature: a 60% win rate producing a 0.26 profit factor. Most trades win small; the losers are catastrophic. On the FX/gold tests the outliers were wins; here they are losses (Outliers PnL is −$76). Removing them still leaves PF 0.41.

The mechanism: overnight gaps versus the structural stop

This is the first instrument tested that gaps. ZMS holds positions with a resting stop at the H1 episode extreme, and its bias timeout is 96 H1 bars (~14 trading days on a stock), so positions routinely carry overnight and over weekends. Measured on META 5m over the loaded window (2,172 bars, 28 sessions):

Quantity Value
Strategy's own risk (close -> plotted H1 stop), median 1.75%
Strategy's own risk, 90th percentile 3.99%
META overnight gap, median 0.62%
META overnight gap, 75th / 90th percentile 1.50% / 2.94%
META overnight gap, max in window 10.41%
Sessions whose gap exceeds the median stop distance 21.4%

Roughly one overnight gap in five exceeds the strategy's entire typical risk budget, and the largest is ~6x it. A resting stop offers no protection against that — price opens through it and fills at the open. This fully explains the 60%-win / 0.26-PF shape, and it is a structural incompatibility, not a fitting artifact: no parameter of ZMS addresses it.

This failure is different in kind from the FX/gold failures, and more useful. EURUSD/XAUUSD/GBPUSD failed because the design is instrument-fitted (the winning cell moves). META fails because the design's risk model assumes continuous trading. That is a named, testable defect with a named fix: either flatten before the close (intraday-only variant) or size to gap risk rather than to stop distance. Neither is a tuning change.

Consequence. ZMS as specified must not be applied to any gapping instrument — equities, single-stock CFDs, futures with session breaks. If equities are wanted later, they need an explicit intraday-only variant (flat-by-close, bias expires at the session end), which is a different strategy and would need its own three-instrument test.

Flat-before-session-close test (2026-08-26) — the gap fix works, and it still doesn't save the design

Daniel asked to test closing trades before the session ends. Implemented as a real feature in mtf_zstructure_strategy.pine (default OFF, so every earlier result stays reproducible):

  • Flat before session close (intraday only) + Flatten N bars before session end (default 2).
  • Mechanics: orders fill at the NEXT bar's open (process_orders_on_close=false), so a close issued on the session's last bar would fill AFTER the gap — defeating the purpose. The window is therefore derived from the previous session's bar count (causal, no lookahead) and fires sessExitBars early, so the market order fills inside the session. session.islastbar is a backstop for short/half days. Inside the window: working orders are cancelled, the LTF setup is dropped, and the position is closed.
  • Control verified: with the flag off, META reproduces the baseline exactly (PF 0.288, −$187.04, n=25) — the new code is a true no-op when disabled.
  • Input ids shifted at in_20 (in_20 = flat-flag, in_21 = bars; display bools moved to in_22..in_25).

META (the instrument the fix was designed for)

Variant n win% PF gross + gross − net max DD
Overnight allowed 25 44.0 0.288 75.69 262.73 −187.04 227.83
Flat before close 11 27.3 0.145 5.54 38.28 −32.74 35.66

The gap hypothesis is confirmed — and it cuts both ways. Forcing intraday-only retains just 14.6% of the gross losses (so ~85% of losses were overnight, exactly as predicted) but also only 7.3% of the gross profits (~93% of gains were overnight too). Damage falls 82% (−$187 -> −$33) and drawdown falls 84% (228 -> 36), but the profit factor gets worse (0.288 -> 0.145) and $5.54 of gross profit over 24 months is nothing. On META the strategy's entire P&L, in both directions, was overnight gap exposure — not the 5m structure it is designed to trade. It was an unhedged overnight lottery wearing a structure strategy's clothes.

The same switch on the other three (5m, H1 bias only, same build both sides)

Instrument overnight allowed flat before close effect
EURUSD PF 1.40, +$12.03, DD 13.5, outliers $5.68 PF 1.49, +$9.24, DD 6.9, outliers $0 improves
GBPUSD PF 1.25, +$10.46 PF 0.55, −$14.99 destroys
XAUUSD PF 1.10, +$8.79 PF 0.54, −$20.18 destroys
META PF 0.29, −$187, DD 228 PF 0.15, −$32.74, DD 36 damage −82%, PF worse

(Gold rows use the FX cost build on both sides so the on/off delta is like-for-like; absolute gold PF is therefore optimistic, though cost was earlier shown to move gold PF by only 0.01.)

The EURUSD row is, structurally, the best result in this entire study: profit factor up, win rate 60% -> 66%, drawdown halved, 77% of the net retained on 82% of the trades, and — uniquely — Outliers PnL of exactly $0. Every other positive result in this study was carried by one or two outlier trades; this one is not carried by any. If any ZMS configuration ever deserved a second look, it is this one.

And it fails the three-instrument rule anyway, decisively: 0.55 on GBPUSD, 0.54 on gold. A genuine risk-management improvement should help everywhere or be roughly neutral. This one halves drawdown on one instrument and halves profit factor on two others. So it is not a risk improvement — it is another re-slicing of noise, and per the standing rule it must not be adopted.

What the four instruments now say together

Removing overnight exposure removes most of the P&L on META (93% of gross profit), most of it on GBPUSD and gold (both flip negative), and only on EURUSD leaves a cleaner, smaller version of the same result. Across the board, most of what ZMS earns comes from holding through sessions rather than from the 5m impulse-correction-breakout structure the design is built on. The design's stated thesis is not what produces its numbers on any instrument except possibly EURUSD — and on EURUSD the sample is 47 trades in 6.5 months.

This is the fifth independent demonstration of one pattern: every modification to ZMS helps some instruments and harms others, with no predictable direction. That is what a design with no underlying edge looks like when you keep testing it. Nothing further should be added to this design; the remaining structural-stop idea should be treated as a new strategy with pre-registered pass criteria, not as another ZMS variant.

Divergence continuation: PBK/AKAO oscillator on untriangled swings (2026-08-26)

Daniel's design: after an HTF extreme episode prints triangles, price often makes a further low (or high) that does not reach the z threshold, so no triangle prints on that swing. If the AKAO oscillator is higher at that lower low (or lower at that higher high) than it was at the triangle swing, that is a regular divergence. Mark that swing, arm the bias there with it as the stop, and run the normal 5m entry steps.

This is the first change in the whole ZMS arc that adds a new INFORMATION SOURCE rather than re-slicing existing rules — precisely what the July program said was required before building further variants.

Implementation (mtf_zstructure_strategy.pine, default OFF)

  • Ported PBK's oscillator formula: rational-quadratic Nadaraya-Watson kernel regression, ATR-normalised deviation (kernel_rq + z_of in playbook_indicator.pine), evaluated on H1 and H4 through the existing request.security wrapper.
  • Documented deviation: PBK chooses (h, r) with a self-optimising walk-forward search. That choice is path-dependent and not reproducible across chart loads (see the TV quirks notes), and running the search inside two request.security calls is far too heavy. The kernel is therefore pinned to PBK's own warm-up default h=16 / r=8, exposed as inputs so the rest of its bank (h 6/10/16/24 x r 1/8) stays testable.
  • Per-TF memory of the last triangle swing (price extreme + oscillator value there + age) survives the bias's death, so a later untriangled swing can still be compared against it. Max HTF bars after the triangle swing = 30 by default.
  • On a divergent untriangled swing: mark it (fuchsia/purple DIV label), arm a bias with that swing as the stop, reset the entry budget, and ratchet the reference so a further swing can chain.
  • Trades now carry their bias source in the comment, and the stats table splits 8 cells (H1/H4 x triangle/Divergence x Path 1/2) so the new signal is judged on its own, not as part of a blend.
  • Control verified: with the flag off, EURUSD reproduces the defaults baseline exactly (PF 1.023, n=90).

Result — three instruments, 5m, defaults (H1+H4)

Instrument OFF: PF / net ON: PF / net OFF ex-outlier PF ON ex-outlier PF
EURUSD 1.02 / +$2.76 (n=90) 1.62 / +$49.79 (n=116) 0.77 0.97
GBPUSD 1.21 / +$20.51 (n=109) 1.04 / +$5.61 (n=158) 1.28 0.70
XAUUSD 0.43 / −$133 (n=50) 0.78 / −$85 (n=107) 0.20 0.65

On EURUSD this looks like the best change ever made to the design: profit factor 1.02 -> 1.62, net +$2.76 -> +$49.79, and the divergence cells look outstanding (H1D-Path 1: n=17, PF 3.64, +425 pips; H4D-Path 1: n=29, PF 2.01, +346 pips — against an H4 triangle cell that is PF 0.00 in the same run).

Why it still fails

1. The divergence cells invert across instruments, exactly like everything before them.

Divergence cell EURUSD GBPUSD
H1D · Path 1 n=17, PF 3.64, +425 pips n=37, PF 0.51, −483 pips
H1D · Path 2 n=29, PF 0.52, −331 pips n=46, PF 1.15, +117 pips
H4D · Path 1 n=29, PF 2.01, +346 pips n=15, PF 0.47, −257 pips
H4D · Path 2 n=9, PF 1.62, +113 pips n=12, PF 2.17, +322 pips

The flagship cell (H1D·Path 1) is PF 3.64 on EURUSD and PF 0.51 on GBPUSD. Every cell flips sign or rank.

2. The EURUSD gain is outlier-carried. Outliers PnL $51.93 against a total of $49.79: strip them and the "best change ever made" is PF 0.97, −$2.14. It improves the ex-outlier number (0.77 -> 0.97) but never gets it above 1.0.

3. It destroys the only clean positive in the entire study. GBPUSD with the feature OFF is the single configuration anywhere in this work whose ex-outlier PF exceeds 1.0 (1.279, +$25.61) — a positive result not carried by one or two trades. Turning divergence continuation on takes it to 0.698, −$42.36.

Verdict: not adoptable. Same signature as the previous five modifications — helps two instruments, harms the third, and the one it harms was the only genuinely outlier-free result we have.

What is actually learned (this one is worth keeping)

The July rule was "no further mechanical variants without a fundamentally new ingredient." This change supplied one — a genuinely independent oscillator, on swings the z engine cannot see at all — and the outcome was indistinguishable in character from every parameter re-slice: instrument-dependent, outlier-carried, non-transferable. So the failure mode is not a shortage of ingredients. It is the framework: an HTF extreme/divergence bias with a distant structural stop, entered on 5m structure, does not generalise across instruments, and adding better information to it does not change that.

The one thing genuinely worth carrying forward: the untriangled divergent swing is a real, detectable object that the AVWAP-Z engine misses entirely, and marking it on the chart (labels are on) has standalone discretionary value even though trading it mechanically does not clear the bar.

Divergence swings ONLY — the detector tested in isolation (2026-08-26)

Daniel asked to test the divergent untriangled swings on their own. In the previous run the divergence bias was added to the triangle bias, so its cells were always blended with triangle-sourced trades; it had never been measured standalone. New input Divergent swings ONLY (default off): triangle episodes still run (they establish the reference swing and oscillator level the divergence is measured against) but produce no entries of their own. Verified: all four triangle cells report n=0 when it is on.

Bar stated before running (same standard as the closed screen): PF > 1 and ex-outlier PF > 1 and best month <= 60% of net, on all three instruments.

Results — 5m, H1+H4, divergence swings only

Instrument n win% PF ex-outlier PF net pips best month share of net
EURUSD 85 56.5 1.74 1.61 +988.8 2026-03 81.6%
GBPUSD 109 54.1 1.28 1.20 +586.3 2026-03 93.7%
XAUUSD 87 43.7 0.62 0.57 −11,313.2 2026-05 (net negative)

Cells (divergence-only):

cell EURUSD GBPUSD XAUUSD
H1D · Path 1 n=16, PF 5.25, +610 n=36, PF 1.14, +93 n=22, PF 0.27, −5,530
H1D · Path 2 n=29, PF 0.44, −384 n=46, PF 1.64, +428 n=39, PF 0.74, −2,843
H4D · Path 1 n=30, PF 3.01, +645 n=15, PF 0.47, −257 n=16, PF 1.50, +2,271
H4D · Path 2 n=10, PF 1.65, +118 n=12, PF 2.17, +322 n=10, PF 0.21, −5,211

Give the idea its due

This is the best configuration the project has produced on FX majors. It is the first time any variant cleared both PF > 1 and ex-outlier PF > 1 on two instruments simultaneously — every earlier positive was either single-instrument or collapsed when its outlier trades were removed. Traded alone, the divergent swing detector beats the triangle-episode bias it was built to supplement (on EURUSD the triangle cells contribute nothing here, and the divergence cells return PF 5.25 / 3.01 on Path 1).

Why it still fails

1. Both FX results are the same month. EURUSD's best month and GBPUSD's best month are both 2026-03, contributing 81.6% and 93.7% of their respective net profits. EURUSD and GBPUSD are ~0.9-correlated against the dollar, so this is not two independent confirmations — it is one USD event counted twice. Strip March 2026 and both FX results are close to nothing. That single observation explains the entire "two instruments agree" appearance.

2. Gold fails outright (PF 0.62, ex-outlier 0.57, −11,313 pips), and its own best month is a different one (2026-05), so there is not even a consistent regime story across the three.

3. The cell roles still invert. H1D·Path 1 is PF 5.25 on EURUSD and 1.14 on GBPUSD; H1D·Path 2 is 0.44 on EURUSD and 1.64 on GBPUSD; H4D·Path 1 is 3.01 on EURUSD and 0.47 on GBPUSD. Whatever is working is not the same thing on the two pairs.

Verdict: fails the stated bar on all three counts. Not adoptable, and it does not reopen ZMS.

What this adds to the closure

The previous screen killed the strategy because its best result was one month on one instrument. This run shows the pattern is not incidental: the strongest standalone signal in the project is also one month — and when a second instrument appears to confirm it, that confirmation is the same month in a correlated pair.

Practical consequence for any future work here: two correlated FX majors are one test, not two. The three-instrument rule should be read as requiring genuinely independent markets, and every result must be reported with its best-month share and the month itself, not just PF.

The detector stays where the last note put it: a real object worth having marked on the chart (the DIV labels), with no mechanical edge that survives this standard.

USDJPY (holdout spent) + EURGBP control — the divergence result is a USD-March artifact

Daniel asked to run USDJPY. That spends one of the two reserved holdouts, and it was the right one to spend: after discovering that EURUSD and GBPUSD are ~0.9 correlated and therefore constitute a single test, USDJPY was the most independent FX market available. It also produced the idea for the control that settles the question.

Base ZMS on the holdout (defaults, everything off): USDJPY n=78, win 47.4%, PF 0.90, ex-outlier PF 0.82, −182.5 pips. The closed strategy fails on the holdout too, consistent with the closure.

Divergence-only across five instruments

Instrument USD leg? n win% PF ex-outlier PF net pips best month share of net net ex-best-month
EURUSD yes 85 56.5 1.74 1.61 +988.8 2026-03 81.6% +181.8
GBPUSD yes 109 54.1 1.28 1.20 +586.3 2026-03 93.7% +36.9
USDJPY yes 52 59.6 1.58 1.23 +630.6 2026-03 65.9% +214.9
XAUUSD quasi 87 43.7 0.62 0.57 −11,313.2 2026-05 (negative)
EURGBP NO 55 41.8 0.70 0.60 −132.9 2026-05 (negative)

The separation is perfect

Every instrument with a USD leg is positive and its best month is 2026-03. Every instrument without a clean USD leg is negative and its best month is a different one. There is no overlap.

EURGBP is the control that makes this conclusive: it is a cross with no dollar leg, so a March 2026 dollar move physically cannot express itself there. It returns PF 0.70 and a different best month. Gold — dollar- denominated but driven by its own flows — behaves the same way (PF 0.62, best month 2026-05).

Conclusion: the divergence-only result is not an edge in the detector. It is one dollar event in March 2026, observed three times through three windows onto the same underlying move. Three "independent confirmations" were one observation.

Fairness to the idea

Two things remain true and should not be lost in the verdict:

  • Divergence-only is still the strongest configuration the project produced, and it is the only one where the USD pairs stay slightly positive even after removing their best month (+182, +37, +215 pips). That residue is small, unverified, and could easily be noise at these sample sizes — but it is not zero, and it is better than anything the triangle bias produced.
  • Traded alone, the detector beat the triangle-episode bias it was designed to supplement, on every USD pair.

Neither changes the verdict: it fails the stated bar (best month <= 60% on all three: 81.6 / 93.7 / 65.9), it fails on two of five instruments outright, and its apparent cross-instrument agreement is an artifact.

Method result worth keeping

This is the clean version of the lesson from the previous section: correlation between test instruments destroys the value of a multi-instrument screen. A screen of EURUSD + GBPUSD + USDJPY looks like three tests and is closer to one. Any future validation here must include at least one instrument that cannot express the same driver — a non-USD cross (EURGBP), an index, or crypto — and must report which month carries the result, not merely how concentrated it is.

Holdout status: USDJPY is now spent. XAGUSD remains untouched.

NVDA (2026-08-26) — second equity, and a third independent-driver control

NASDAQ:NVDA, 5m, RTH. Two jobs: a second equity test (after META established the overnight-gap defect), and an independent-driver control — NVDA is priced in dollars but driven by AI/earnings flows, so a March 2026 dollar event cannot produce the same result there.

Config n win% PF ex-outlier PF net pips best month share of net
Base ZMS (overnight allowed) 55 41.8 1.07 0.89 +136.9 2026-07 454.9%
Divergence-only (overnight allowed) 51 43.1 0.88 0.75 −168.0 2024-09 (negative)
Divergence-only + flat before close 20 70.0 1.92 1.55 +84.2 2026-07 105.3%

("pips" here = 0.1 price units, i.e. 10 cents.)

1. The control works — NVDA's best month is never 2026-03

NVDA's best months are 2026-07 and 2024-09. Not March 2026, in any configuration. Adding NVDA to the control set:

Instrument driver divergence-only PF best month
EURUSD USD 1.74 2026-03
GBPUSD USD 1.28 2026-03
USDJPY USD 1.58 2026-03
XAUUSD metal / quasi-USD 0.62 2026-05
EURGBP no USD leg 0.70 2026-05
NVDA equity / AI flows 0.88 2024-09

Three clean USD pairs: all positive, all March 2026. Three instruments driven by something else: all negative, none in March. The separation is now 6-for-6 with no exceptions. The divergence "edge" is one dollar event, and NVDA is the third independent instrument to say so.

2. The equity gap defect reconfirmed

Forcing intraday-only on NVDA changes everything: trade count 51 -> 20 and PF 0.88 -> 1.92. As on META, the overwhelming majority of both the activity and the P&L came from holding through the close rather than from the 5m structure the design claims to trade. This is the second equity to show it, so it is a property of the design on gapping instruments, not a META quirk.

3. Why the flat-close row is not a result

PF 1.92 with ex-outlier 1.55 looks like the best equity number in the study. It is not usable:

  • n = 20 over roughly two years — about one trade every five weeks.
  • Best month = 105.3% of net profit, so every other month combined is net negative. Same disease that killed the GBPUSD candidate in the pre-registered screen.
  • Base ZMS on NVDA has ex-outlier PF 0.89 — below 1 — so the headline 1.07 is outlier-carried too.

Standing position unchanged

ZMS remains closed. Equities remain excluded (the gap defect is now confirmed on two names, and the only configuration that avoids it produces ~10 trades a year). The divergence detector remains a chart marker with no mechanical edge — and the USD-artifact explanation for its apparent FX success is now supported by three independent controls (EURGBP, XAUUSD, NVDA) rather than one.

Holdout status unchanged: XAGUSD still untouched. NVDA was not a holdout.

AMD + INTC (2026-08-26) — and the one cell that passes every stated criterion

Daniel asked for AMD and Intel. Caveat stated before running: AMD, INTC and NVDA are all semiconductors and highly correlated, so by the rule established two sections above these three are closer to one test than three. INTC is the most useful of them because its price path has diverged sharply from NVDA's.

All runs 5m, RTH, slippage=2 ($0.04 RT). Per-share commission is NOT modelled — material for cheap stocks where the average trade is small.

Symbol Config n win% PF ex-outlier PF net pips best month share
NVDA base ZMS 55 41.8 1.07 0.89 +136.9 2026-07 454.9%
NVDA divergence-only 51 43.1 0.88 0.75 −168.0 2024-09
NVDA div-only + flat close 20 70.0 1.92 1.55 +84.2 2026-07 105.3%
AMD base ZMS 80 32.5 0.30 0.24 −4,739.5 2025-11
AMD divergence-only 93 48.4 0.90 0.81 −536.3 2025-11
AMD div-only + flat close 41 53.7 0.74 0.58 −93.0 2026-02
INTC base ZMS 53 34.0 0.24 0.19 −1,372.7 2024-12
INTC divergence-only 76 43.4 0.22 0.20 −1,696.9 2025-07
INTC div-only + flat close 34 73.5 6.70 5.73 +102.0 2026-03 45.4%

The INTC cell passes every criterion I have stated all session

PF 6.70 > 1. Ex-outlier PF 5.73 > 1. Best month 45.4% <= 60%. It is the only cell in the entire project to clear all three, and it is not outlier-carried (removing the largest win leaves PF 5.73) and not single-month (the best month is under half the profit). By the letter of the bar, it passes.

It should not be believed, and the reason is in the table above, not in my expectations.

Why it fails anyway: correlated instruments disagree

The same configuration on three highly-correlated semiconductor stocks returns:

Config: divergence-only + flat close PF n
NVDA 1.92 20
AMD 0.74 41
INTC 6.70 34

0.74 to 6.70 across three names that trade together. If this configuration captured a real intraday structure, correlated instruments in the same sector, over the same period, on the same timeframe, should not disagree by a factor of nine. They do. INTC is the top of a three-name spread, not a validated result — the same shape as every earlier "winner" in this project, just discovered on a stock instead of a currency.

The multiple-comparison arithmetic, stated plainly

This session examined roughly forty instrument x configuration cells. Finding one at PF 6.70 on n=34 is an expected outcome of that search, not evidence against it. The honest reading of the INTC cell is: it is the best-looking survivor of a large search, on a small sample, with commissions omitted, contradicted by its two nearest neighbours.

Two further weaknesses worth stating:

  • n = 34 across ~2 years, and it is the fewest-trade config of the three tested on INTC.
  • Net +102 pips = $10.20 of price movement per share, total, over two years. On a ~$25 stock with per-share commissions unmodelled, an average trade of ~$0.30/share is exactly the size that real costs eat.

What AMD and INTC do add

  1. Base ZMS is dead on both (PF 0.30 and 0.24) — among the worst readings anywhere, reinforcing the closure.
  2. The gap dependence is now confirmed on four equities. Forcing intraday-only changes every semiconductor result substantially (AMD 93->41 trades, INTC 76->34, NVDA 51->20), exactly as on META. On gapping instruments this design's results are dominated by overnight exposure, not by its own 5m logic.
  3. No new USD-March contamination: best months here are 2024-12, 2025-07, 2025-11, 2026-02, 2026-07 — scattered, as expected for equities. The single 2026-03 appearance is in the INTC cell discussed above and carries only 45.4% of a very small profit.

Standing position

Unchanged. ZMS stays closed, equities stay excluded, and the INTC cell is logged as an observation, not a candidate. If it were ever to be revisited, the pre-registered test is already obvious and cheap: it must hold on AMD and NVDA with identical settings. It does not.

Direction split — answering "can ZMS be tuned for XAUUSD?" (2026-08-26)

Daniel asked whether ZMS could be fine-tuned for gold exclusively, and whether gold's trending nature makes that impossible. The decisive diagnostic is cheap: split every result by trade direction. If the profit is one-sided and that side matches the instrument's trend, the "edge" is directional beta, not structure. A LONG/SHORT split (n, win%, PF, ex-outlier PF, net) was added to the stats table.

Result

Run direction n win% PF ex-outlier PF net pips
XAUUSD 5m, defaults LONG 30 36.7 0.50 0.34 −7,304
XAUUSD 5m, defaults SHORT 20 20.0 0.21 0.14 −5,872
XAUUSD 15m, H4-only (the best gold config) LONG 13 76.9 5.46 3.37 +13,903
XAUUSD 15m, H4-only SHORT 17 17.6 0.10 0.04 −4,732
EURUSD 5m, defaults LONG 50 42.0 0.90 0.74 −92
EURUSD 5m, defaults SHORT 40 70.0 1.33 1.21 +176

The answer: the gold "edge" is the gold trend

The only gold configuration that ever looked good — 15m, H4 bias, PF 2.09 — decomposes into PF 5.46 long / PF 0.10 short, with a 76.9% win rate one way and 17.6% the other. Gold rose from roughly $2,600 to $4,600 across this sample. Buying dips in a historic bull market wins; fading rallies in one is near-total loss. That is beta, described in strategy language.

It is also one month: that same config's best month is 2026-03 at 97.5% of net. So the single best gold result in the project is long-only and single-month — two independent disqualifications.

EURUSD confirms it in mirror image

EURUSD over the same window trended the other way, and its split is inverted: shorts PF 1.33, longs 0.90. In both instruments, the profitable side is the side the instrument was already going. Two instruments, opposite trends, same rule — that is much stronger than a single-instrument observation, and it is the cleanest evidence in this project that what looks like signal is direction exposure.

(EURUSD defaults are also single-month: best month 2026-03 at 721.4% of net.)

A unifying hypothesis for the cell inversions

This plausibly explains the phenomenon documented repeatedly above — that the "best cell" reshuffles between instruments (H1 vs H4, Path 1 vs Path 2, triangle vs divergence). If each instrument's profitable cell is largely whichever cell happened to trade in that instrument's trend direction during its sample window, then the inversions are not mysterious at all: they are the trends differing, not the structure differing. Stated as a hypothesis, not a finding — it fits every case examined here but was not pre-registered.

So: can ZMS be tuned for XAUUSD exclusively?

No, and the attempt is actively hazardous. Any honest gold-specific optimisation would converge on the long side, because that is where the money is in this sample — and it would produce an excellent-looking backtest that is a leveraged proxy for "gold went up," with a short book that loses 90% of what it touches. The moment gold ranges or reverses, both halves fail: the longs lose their tailwind and the shorts remain broken.

The constraints are hard, not parametric:

  • Directional: it is a reversion design; gold's sample is one large trend. Reversion into a trend is negative by construction, which is what PF 0.10 on the short side means.
  • Statistical: gold 5m history is 6.7 months, 15m is 21 months, all one regime, with n=30 in the config of interest. There is nothing left to validate a tuned version against.
  • Structural: the H4 stop sits $50–100 from a 5m entry (H4·Path 1 averages −482 pips/trade on gold).

The honest alternative for gold

Invert the premise rather than tune the parameters. This project's own Stage-0 program found trend-continuation on gold was the one family that nearly cleared significance (p = 0.055, n = 1,709), while every reversal-entry idea died. The direction split above points the same way: on gold, the with-trend side works and the counter-trend side is destroyed.

That is a different strategy — enter with the stretch on a pullback, not against it — not a reconfigured ZMS. If gold is the target, that is the design worth specifying, and it should be pre-registered against XAGUSD (still untouched) plus a non-USD control before any tuning.

Next (not started)

  1. ~~XAUUSD build~~ DONE 2026-08-26 — FAILED (section above). Gold transfer test is the decisive result.
  2. Structural-stop rebuild (trade stop = 5m correction low / 5m episode low; HTF extreme demoted to bias invalidation only), judged on EURUSD + XAUUSD + GBPUSD simultaneously, criteria written down BEFORE the run. This is the only remaining item with a mechanism behind it, and the GBPUSD result is the reason the pass criterion must be "positive on all three with the same sub-cell carrying it", not "positive overall".
  3. Forward-observe EURUSD 5m — H4 setting left at default (on), since the earlier "turn H4 off" advice was refuted by GBPUSD. Observation only, not validation.
  4. Trailing / breakeven-after-T1 (Daniel: "later"); stubs exist. Deferred until item 2 settles the risk shape.
  5. Optional: pyakao port for cost/fill stress and long out-of-sample windows (the 5m TV window is ~6 months).
  6. Do NOT tune EURUSD parameters further — the sweep's best row is now known to invert on transfer.
  7. Do NOT apply ZMS to gapping instruments (equities/futures with session breaks) — see the META section: the resting structural stop is defeated by overnight gaps in ~21% of sessions. An equity version requires an explicit flat-by-close variant, which is a new strategy, not a setting.
  8. Report ex-outlier PF beside headline PF for every future ZMS number — most positive results in this study were one or two trades.