Onyx Patterns

Weekly AI reflection

One short, coherent story per week that connects every detector finding with what you wrote in the journal. The piece you'd otherwise have to write yourself every Sunday — only with sharper numbers and zero blind spots.

What it is

Twenty-eight detectors fire every time you open the patterns page. Each card on its own tells one truth — your Monday morning is worse than your average, your stop-losses drift on Fridays, you tend to size up after wins. But the trader's actual question isn't 'how do I read this one card', it's 'what's the story across all of them?' Connecting the dots manually across 28 detectors plus 7 days of journal entries is the kind of cross-pattern synthesis the deterministic engine can't do.

The weekly AI reflection is exactly that synthesis layer. Sonnet 4.6 reads every Layer-1 finding the engine produced for you AND the last seven days of journal entries — pre-market plan, lessons, mood scores, rule violations — and writes one coherent four-section reflection: the thread of the week, what the data say, what your journal says about it, and what to do concretely this week. It's the cross-cutting voice the per-card AI-analysis (TRA-306) can't be, because each per-card call only sees one card.

Cost-cap by design. One Anthropic call per user per ISO-week. The card rotates with the calendar week — Monday morning fresh, Sunday evening the same one you read mid-week. This is intentional: a daily reflection would create alarm fatigue and burn the AI budget on noise. A weekly cadence matches how traders actually review (most do it weekend-only) and keeps Pro Plus economically sane to ship.

Formula
Cache key: `narrative_<ISO-year>-W<ISO-week>` per user. The week tag rotates on the ISO-Monday (Europe/Berlin) so a fresh reflection appears at the start of every working week without anyone touching a button.
 
Inputs to the prompt: every pattern card from `pattern_cache.get_or_compute` (cleaned of frontend-only metadata like lock flags) + the user's `JournalEntry` rows from the last 7 days, capped at 14 entries and truncated to 400 characters per free-text field to keep the prompt budget bounded.
 
Model: `claude-sonnet-4-6`. Sonnet over Haiku because the task is synthesis across heterogeneous structured + free-text data, not a fast single-shot lookup. Average call: ~1.5 k input tokens, ~500 output tokens, ~€0.012 per generation. With 1 call/user/week, even a 1 000-user month is around €50 in Anthropic spend.
 
Compliance preamble. Every call carries the same investment-advice disclaimer that all our AI surfaces use. The model is explicitly instructed: no performance promises, no investment advice, self-reflection on the trader's own data only.
Example

A trader closes Pro Plus subscription this Monday. They have 6 weeks of imported trades on EURUSD + DAX, journal entries on 4 of the last 7 days with mood scores between 2 and 4. The engine has surfaced: Revenge-Trading (47.9 % of losses followed by a new trade within 20 min), Friday Drift (avg-R drops from 1.2R Mon-Thu to 0.4R Fri), and a fresh Stop-Loss Drift finding (the trader's SL distance on EURUSD widened by 30 % over the last two weeks vs the prior baseline).

Result**The card reads (abbreviated):** > ## 1. The thread of the week > The dominant theme this week is loss of stop-discipline, and it's bleeding into your Friday performance. > > ## 2. What the data say > Three findings line up: half your losses (47.9 %) trigger a follow-up trade within 20 minutes — revenge pattern. Your average R on Fridays is one-third of your Monday-to-Thursday baseline. Your SL distance on EURUSD has widened 30 % in two weeks, which means the recent losses are 30 % bigger than the strategy was calibrated for. > > ## 3. What your journal says about it > Two of the four logged days carry mood-start under 3. The pre-market notes on Fri the 7th say 'one more trade to make up the loss' — that's exactly the revenge wording the detector picked up. > > ## 4. This week, concretely > 1. No new trades within 20 min of any closed loss. Wall-clock rule, not a feeling. > 2. Re-tighten EURUSD SL to the 14-day ATR multiplier you started with — your widening hasn't been documented as a deliberate change anywhere. > 3. On Fridays before the EU close, halve your normal position size. No exceptions until the avg-R closes the gap back to your weekday baseline.
How to read it

The card is a starting point for a conversation, not a verdict. The AI synthesises what's visible in your data this week — it has no idea what's going on in the market, in your life, in your broker outage from Tuesday. Read the four sections as a structured second opinion you can argue with.

Section 1 — the thread: if the AI repeatedly identifies the SAME thread across multiple weeks, that's a real behavioural lock-in. One week of revenge trading is bad; six weeks in a row is your single most important leak.

Section 2 — what the data say: these are the same numbers from the per-card analyses, just connected. If you disagree with the connection the AI drew, the connection probably isn't the strongest one — but the underlying numbers ARE accurate. The detectors are deterministic; only the synthesis is AI.

Section 3 — what your journal says: this is the section that hard-breaks if your journal is empty. The AI will say so honestly — it won't fabricate journal content. If you see 'your journal is empty this week' in section 3, that's a signal to start logging: every additional day of journal context next week makes section 3 sharper.

Section 4 — concrete actions: evaluate each action on two criteria. Specific — does it tell you what to do or not do, with a measurable trigger? Generic 'be more disciplined' should never appear; if it does, that's a prompt bug we want to know about. Yours — does it fit your strategy and risk tolerance? Reject any action that doesn't. The point isn't to follow the AI; it's to surface options you wouldn't have considered.

Where TradeOnyx uses it

How to read the card — visual elements top to bottom:

1. Kicker + title in the card header — always visible regardless of tier. The kicker tells you which surface you're on (Onyx-Engine · Week-in-Review); the title sets the question ("What your data say this week"). 2. Subtitle — one-sentence promise of the read. Useful for the upgrade conversation if you're not Pro Plus yet. 3. The four-section markdown body — only for Pro Plus. Sections render with bold gold-tinted H1 / H2 headings to mirror the Onyx-Engine aesthetic. 4. Cache-age hint — small grey line below the body: 'Generated for 2026-W19, 2 day(s) ago. Refreshes every ISO week.' Tells you when you're reading a fresh take vs the cached one. 5. AI disclaimer — italic grey footer reminding you this is reflection on your own data, not investment advice. Required by our compliance posture; appears on every AI-generated surface.

When in your weekly review loop to read it: Sunday evening or Monday morning, before you write your own week-in-review. The card is the second-opinion outline. Read it first, then write your own version next to it. Where the two agree → strong signal. Where they disagree → the part that deserves the deepest dig.

Tier: Pro Plus. Free and Pro users see the card header + a teaser skeleton with an upgrade overlay. The body never generates for non-Pro Plus accounts — even the API rejects upstream so the Anthropic budget is bounded to paying users.

Locale: the card respects the language switch in the dashboard footer. German market gets German reflection in natural trader-language ('du', not 'Sie'); English locale gets the same in EN. Both go through the same compliance preamble.

Related reading