@battlegrid/mcp-server 31.2.4 → 31.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,173 +0,0 @@
1
- # Strategy Studio recipes — copy-adaptable fragments
2
-
3
- Validated against the live server 2026-08-28; shapes binding, tokens illustrative — re-discover
4
- before compiling. Column recipes are objects for a custom section's `columns[]`; condition
5
- recipes drop into `conditions[]`.
6
-
7
- ## Column recipes
8
-
9
- | Intent | Column | Header it generates |
10
- |---|---|---|
11
- | Live traded price | `{ "metric": "LAST", "transformId": "value", "timeframe": { "rel": "anchor" } }` | `last` |
12
- | Momentum build-up | `{ "metric": "RSI14", "transformId": "trajectory", "timeframe": { "rel": "anchor" }, "window": 4 }` | `RSI14_t3…_now`, `RSI14_trend` |
13
- | Closed-bar-only trajectory (no forming-bar noise) | add `"bars": "closed"` to any trajectory | same, drawn from closed bars |
14
- | Extension from trend | `{ "metric": "SMA50", "transformId": "distance", "timeframe": { "rel": "anchor" } }` | `dist_SMA50` (signed %) |
15
- | Perp premium | `{ "metric": "MARK", "transformId": "spread", "timeframe": { "rel": "anchor" }, "inputs": [{ "metric": "ORACLE" }] }` | `mark_oracle_spread` |
16
- | Cross-venue basis | `MARK spread SPOT_CLOSE_BN` (or `SPOT_CLOSE_CB`) | `mark_bnClose_spread` |
17
- | Funding paid over a day | `{ "metric": "FUNDING_RATE", "transformId": "aggregate", "timeframe": { "rel": "anchor" }, "window": 24 }` | `rate_mean24` |
18
- | Board-wide standing | `{ "metric": "ATR_PCT", "transformId": "rank", "timeframe": { "rel": "anchor" }, "ordering": "hi" }` | `atrPct_rank_hi` (1 = most volatile) |
19
- | Biggest movers, sign-agnostic | `CLOSE_CHANGE rank far` | `closeChg_rank_far` |
20
- | Most extended from VWAP on the board | `{ "metric": "VWAP", "transformId": "distance", "chainedTransformId": "rank", "timeframe": { "rel": "anchor" }, "ordering": "far" }` | `dist_VWAP_rank_far` (confirm via contract) |
21
- | EMA ribbon compression trend | `{ "metric": "EMA5", "transformId": "spread", "chainedTransformId": "trajectory", "timeframe": { "rel": "anchor" }, "inputs": [{ "metric": "EMA13" }], "window": 4 }` | `EMA5_EMA13_spread_now`, `_trend` |
22
- | Chop filter on the entry rung | `{ "metric": "CLOSE", "transformId": "efficiency", "timeframe": { "rel": "lower" }, "window": 5, "bars": "closed" }` | `close_ltf_er` (≥0.6 = directional) |
23
- | One-bar volume concentration | `{ "metric": "VOLUME", "transformId": "maxShare", "timeframe": { "rel": "lower" }, "window": 4, "bars": "closed" }` | `volBase_ltf_maxShare` |
24
- | Room to structure | `{ "metric": "STRUCT_ZONES", "transformId": "nearestZoneDist", "timeframe": { "rel": "regime" }, "side": "resistance" }` | `zones_htf_resist_dist` |
25
- | Crowd fade input | `{ "metric": "CROWD_UPBIAS", "transformId": "value", "timeframe": { "rel": "anchor" } }` | `upBias` (%, last 4 settled sessions) |
26
- | Daily trend state on any anchor | `{ "metric": "MA_ALIGN", "transformId": "value", "timeframe": { "abs": "1d" } }` | `MAalign_1d` |
27
- | Last **closed** daily read (deterministic) | `{ "metric": "RSI14", "transformId": "value", "timeframe": { "abs": "1d" }, "offset": 1 }` | `RSI14_1d` — formula `RSI14[t - 1]` |
28
- | Daily extension from the 200 | `{ "metric": "SMA200", "transformId": "distance", "timeframe": { "abs": "1d" } }` | `dist_SMA200_1d` |
29
- | Daily-structure breakout state | `{ "metric": "PRICE_ZONE", "transformId": "value", "timeframe": { "abs": "1d" } }` | `zone_1d` — `is "breakout high"` / `"breakdown low"` |
30
- | Room to the daily swing high | `{ "metric": "SWING_HIGH", "transformId": "distance", "timeframe": { "abs": "1d" } }` | `dist_swingHi_1d` (signed %; `gte 0` = above it) |
31
-
32
- Rung suffixes: `{ "rel": "lower" }` → `_ltf`, `{ "rel": "regime" }` → `_htf` (the anchor's
33
- ladder successor — 1d for a 4h anchor), pinned `{ "abs": "<tf>" }` → `_<tf>` (e.g. `_1d`).
34
- Pins bind to discovery's `rankedTimeframes` (a superset of the anchor set), are fixed across
35
- anchor retunes, and `offset` does not change the header — one offset per `metric × timeframe`
36
- per section. `offset` is a `value`-transform parameter only: `distance` rejects it (typed
37
- error), so a level is always measured as it stands now. That is a statement about `offset`, not
38
- about prior-day levels: `PDH`/`PDL` are published structure metrics at the daily anchor and take
39
- `distance` and `crossDetect`, so the literal previous-session extreme is authored as
40
- `dist_PDH_1d` rather than reconstructed from an offset. The daily *swing* levels (`zone_1d`,
41
- `dist_swingHi_1d`) are the tracked pivot — a different level, not a substitute. Conditions
42
- compare a column against a literal, never against another column. Rank ordering semantics:
43
- `hi` most positive, `lo` most negative, `far`/`near` by magnitude (offered only where sign
44
- matters).
45
-
46
- ## Condition patterns
47
-
48
- **Band (between).** RSI pullback zone rather than a single threshold:
49
- `{ "kind": "clause", "column": { "sectionKey": null, "header": "RSI14_now" }, "op": "between", "low": 35, "high": 55 }`
50
- (`sectionKey: null` is legal only while the header is unique report-wide.)
51
-
52
- **Label membership (in).** Accept two of a classification's states:
53
- `{ "kind": "clause", "column": { "sectionKey": "includeMtfConfluence", "header": "ADX_htf_state" }, "op": "in", "labels": ["trending", "extreme"] }`
54
-
55
- **Veto (NOT + required).** Block the whole compose-trade path on a disqualifier — evaluated
56
- before any billing or LLM call:
57
-
58
- ```json
59
- { "conditionKey": "NO_EVENT_RISK", "name": "No liquidation tape", "verdict": null, "required": true,
60
- "exit": false, "clock": "LIVE", "closes": 1,
61
- "definition": { "kind": "group", "op": "NOT", "members": [
62
- { "kind": "clause", "column": { "sectionKey": null, "header": "oiRegime" }, "op": "is", "label": "long liquidation" } ] } }
63
- ```
64
-
65
- All eight keys are required on every condition — `exit`, `clock` and `closes` included. `clock`
66
- selects the evidence frame (`LIVE` reads the forming bar, `CLOSE` reads settled bars) and `closes`
67
- (1–5) is how many consecutive closed bars must hold; `closes` is always `1` under `LIVE`. `exit:
68
- true` closes open positions the verdict opposes and is legal only under `clock: "CLOSE"`.
69
-
70
- **Quorum (N_OF).** Robust confirmation instead of a brittle ALL:
71
-
72
- ```json
73
- { "kind": "group", "op": "N_OF", "n": 2, "members": [
74
- { "kind": "clause", "column": { "sectionKey": null, "header": "buyPres" }, "op": "gte", "value": 0.55 },
75
- { "kind": "clause", "column": { "sectionKey": null, "header": "RVOL" }, "op": "gte", "value": 1.2 },
76
- { "kind": "clause", "column": { "sectionKey": null, "header": "closeChg" }, "op": "gt", "value": 0 } ] }
77
- ```
78
-
79
- **Building block + carriers.** Factor shared state once (`verdict: null`), reference it from
80
- directional carriers; the first TRUE carrier **in declaration order** decides — order carriers
81
- most-specific first.
82
-
83
- **Benchmark gate.** Read regime off a `benchmarkTicker` section (all rows are the benchmark's
84
- values) and `conditionRef` it from every carrier — one place to flip the book risk-on/off. Keep that
85
- section to indicators: crowd/session metrics and `rank` transforms are refused on a bound section
86
- (contract 49) — rank the coins on an ordinary section and `conditionRef` the two together.
87
-
88
- **Required-count trap.** `required: true` at `allocation: 0` on a *signal rule* is rejected
89
- (contract 34). A required *condition* is independent of signal weights — the two gates stack.
90
-
91
- ## Entry discipline recipes
92
-
93
- The `entry` object is required on every CREATE, all seven keys, no defaults.
94
-
95
- | Intent | Object |
96
- |---|---|
97
- | Today's behaviour, unchanged | `{ "trigger": "AT_SIGNAL", "confirmTf": "<strategy tf>", "closes": 1, "bandAtrMultiple": 1.0, "levelSource": "SWING_HIGH", "levelOffsetAtrMultiple": 0, "validForBars": 4 }` |
98
- | Wait for the bar to close, skip a runaway | `{ "trigger": "ON_CANDLE_CLOSE", "confirmTf": "<strategy tf>", "closes": 1, "bandAtrMultiple": 1.0, … }` |
99
- | Two-close confirmation on the lower rung | `{ "trigger": "ON_CANDLE_CLOSE", "confirmTf": "<lower rung>", "closes": 2, "bandAtrMultiple": 0.75, … }` |
100
- | Break of the swing high, half an ATR through | `{ "trigger": "STOP_THROUGH_LEVEL", "levelSource": "SWING_HIGH", "levelOffsetAtrMultiple": 0.5, "validForBars": 8, "closes": 1, … }` |
101
- | Buy the retest of the broken level | `{ "trigger": "ON_RETEST", "levelSource": "SWING_HIGH", "levelOffsetAtrMultiple": 0, "validForBars": 12, "closes": 1, … }` |
102
-
103
- Bounds: `closes` 1–5 and `1` unless `ON_CANDLE_CLOSE`; `bandAtrMultiple` > 0 and ≤ the platform's
104
- `defaultMaxEntryDeviationAtrMultiple`; `levelOffsetAtrMultiple` 0–2 unsigned and `0` unless a level
105
- trigger; `validForBars` 1–24. `confirmTf` is the strategy timeframe or the rung below it, nothing
106
- else. A meaningful value under a trigger that ignores it is REFUSED, not ignored — that is
107
- deliberate, so a dial never silently does nothing.
108
-
109
- ## Custom section shape
110
-
111
- `{ kind, sectionKey, title, benchmarkTicker, notes, columns }`. `benchmarkTicker` and
112
- `notes` are **required-nullable** — send explicit `null` rather than omitting them, because the
113
- section is rebuilt whole on save and an omitted key clears the value. **Omit `sectionKey` on a
114
- CREATE**: the server derives it from the section.
115
-
116
- A section carries **no `timeframe`** (48.0.0). Its relative columns resolve against the strategy
117
- timeframe; a column reaches any other timeframe by pinning it — `timeframe: { abs: '4h' }` on the
118
- column, which it could always do.
119
-
120
- ## Weight matrices (rules)
121
-
122
- **Conviction pyramid (default).** 1–2 × Critical (the thesis signals, usually `required`),
123
- 2–4 × Important (independent confirmation — different modules, not correlated oscillators),
124
- 1–3 × Normal (context), everything else Off. With weights 3/2/2/1 and the Critical + one
125
- Important triggered at score 1.0: aggregate = (3+2)/(3+2+2+1) = 0.625 → a gate of 0.6 means
126
- "thesis + one confirmation, minimum".
127
-
128
- **Gate math check.** Before setting `minAggregateScore`, list the trigger combinations that
129
- should route, compute Σ(score×alloc)/Σ(alloc) for the weakest acceptable one, and gate just
130
- below it. `simulate_aggregate_score` does this arithmetic for you from compiled values.
131
-
132
- **Directional symmetry.** A both-ways book weights bull/bear siblings identically
133
- (`ma_ema_aligned_bull`/`_bear` both 2-required) and lets conditions decide direction.
134
-
135
- **Param tuning.** Always read `get_strategy_signal_definition({ signalId, timeframe })` first;
136
- send the full replacement object. Examples validated as canonical defaults: `volume_surge`
137
- `{"multiplier": 2}`, `rsi_overbought` `{"threshold": 70}`, `funding_extreme_positive`
138
- `{"thresholdPct": 0.0005}`, `trend_adx_trending` `{"threshold": 25}`,
139
- `comparison_btc_decorrelation` `{"maxCorrelation": 0.3}`.
140
-
141
- ## Trade-level + position-management presets by persona
142
-
143
- | Persona (anchor) | Stop band (ATR) | RR | Break-even | Trailing | Time decay |
144
- |---|---|---|---|---|---|
145
- | Scalper (5m/15m) | 0.5 – 1.2 | 1.5 | 0.7R | 0.9R, giveback 30, buffer 0.15 | ON: 45/15 min, tighten 15 → max 60, stale 30 |
146
- | Intraday mean-revert (1h) | 1.0 – 2.5 | 1.5 | 0.8R | off | ON: 120/60 min, tighten 10 → max 40, stale 25 |
147
- | Swing breakout (4h) | 0.75 – 1.75 | 2 | 1R | 1.2R, giveback 35, buffer 0.3 | off |
148
- | Swing trend (4h) | 1.0 – 2.5 | 2 | 1R | 1.5R, giveback 45–55, buffer 0.3 | off |
149
-
150
- Post-entry invalidation: `decisionInvalidationExitEnabled: true` closes a filled position when a
151
- **closed** strategy-timeframe candle finishes beyond the decision's invalidation level, reduce-only.
152
- Bar-close only — the protective stop still owns intrabar moves.
153
-
154
- Bounds to respect (validated): break-even trigger 0.5–2R; trailing trigger 0–2R step 0.01
155
- (0 = trail from entry); giveback 25–55%; buffer 0.01–1%; grace ≥ interval; stop-band floor <
156
- ceiling ≤ the 3×ATR structural cap; RR within the catalog's served range (0.5–3 today). Wider
157
- stop ⇒ smaller position (risk-budget sizing), never more risk.
158
-
159
- ## Coin selection patterns
160
-
161
- - Focused edit / review: `{ "mode": "explicit", "tickers": ["BTC", "ETH", "SOL"] }`
162
- - Scanning book: `{ "mode": "ranked", "limit": 40, "category": "CRYPTO" }`
163
- - Sector books: `category` from the served list (`L1`, `MEMES`, `DEFI`, `TRADFI`, `STOCKS`,
164
- `INDICES`, `COMMODITIES`) — e.g. a memes-only fade book previews against `MEMES`.
165
- - Rank-based conditions need a cohort at least as wide as the rank thresholds they test.
166
-
167
- ## Market Read patterns
168
-
169
- - Reference the decision, not just data: `"Act only while {SQUEEZE_ON} is TRUE"` renders the
170
- condition's outcome *with its evidence*.
171
- - Qualify on collision: `{custom:<uuid>.MAalign}` / `{includeMtfConfluence.MAalign}`.
172
- - After previewing, check `marketReadMarkers[].status` — fix every `unknown` / `ambiguous`
173
- marker before compiling; `qualifiedForms` lists the exact replacements.
@@ -1,250 +0,0 @@
1
- # TradingView ports — popular scripts, translated to the studio
2
-
3
- The most-used TradingView community scripts encode processes traders already trust. This file
4
- ports the **process** of each — regime filter → setup state → trigger → stop/exit engine — onto
5
- the studio's validated vocabulary. It never claims formula parity: where an indicator does not
6
- exist in the catalog, the substitution is named (the studio's rule: offer the nearest
7
- expressible thing **labelled as a substitute**, never as the thing itself). Headers below were
8
- validated live on 2026-08-28; re-discover before compiling.
9
-
10
- **Event columns caveat (read first).** `crossDetect` and event metrics (`MACD_cross`,
11
- `EMA5_13`) print `Bullish`/`Bearish` only on the bar a cross occurs and are null otherwise —
12
- null resolves a clause UNRESOLVED, not FALSE. Use them as *triggers* inside a carrier, and pair
13
- them with a persistent *state* (the spread's sign, `MAalign`) for regime, exactly as the source
14
- scripts separate trigger from filter.
15
-
16
- ## 0 · Daily-chart strategies — the pattern that carries every TV daily script
17
-
18
- Most TradingView strategies run on the daily chart. The studio's anchors top out intraday
19
- (discovery's `timeframes`), but **pinned timeframes** carry the daily thesis onto any anchor:
20
- `{abs: "1d"}` columns are valid wherever discovery's `rankedTimeframes` includes `1d`
21
- (validated), render with a `_1d` header suffix (`MAalign_1d`, `dist_SMA200_1d`, `RSI14_1d`),
22
- and ignore anchor retunes. Two dials make the port faithful:
23
-
24
- - **`offset: 1` on a pinned `value` column reads the last CLOSED daily bar** (`RSI14[t - 1]`,
25
- validated) — the strategy's daily inputs then change exactly once per daily close, so a
26
- required condition on them decides "on daily closes" even though the anchor cycle re-checks
27
- intraday. Offset 0 reads the forming daily bar (marked provisional).
28
- - **A 4h anchor's regime rung is the daily** (ladder successor), so `{rel: "regime"}` columns
29
- (`MAalign_htf`) and the `htf_*` signals already evaluate on 1d for 4h strategies.
30
-
31
- Recipe: anchor 4h → pinned-1d thesis section (trend, RSI, distance-to-MA at `offset: 1`) →
32
- `required: true` daily conditions gating every carrier → anchor-rung columns only for entry
33
- timing and risk. The result is arguably stronger than the TV original: decisions bind to daily
34
- closes while stops, trailing, and time decay keep managing the position intraday.
35
-
36
- ## Expressibility triage
37
-
38
- | TradingView script | Verdict | Port anchor |
39
- |---|---|---|
40
- | Squeeze Momentum [LazyBear] / TTM Squeeze | **Direct port** — `KC_SQUEEZE` reads the state itself | `KC_SQUEEZE`, `bollinger_squeeze` |
41
- | Supertrend / UT Bot Alerts | **Direct port** for the state; flip still substituted | `ST_LINE`, `ST_DIR`, `EMA5_13` for the flip, position-management trailing |
42
- | Chandelier Exit | Direct port of the *mechanism* | trailing from entry (`trailingTriggerR: 0`) |
43
- | MACD + 200 MA filter | Direct process port | `MACD_cross`, `dist_SMA200`, `macd_bull_cross` |
44
- | Golden / Death Cross | Direct process port | `SMA50_SMA200_spread` + `_trend` |
45
- | RSI-2 (Connors) | **Direct port** — `RSI2` is native | `RSI2`, `dist_SMA200`, time decay |
46
- | VWAP reversion | Direct process port | `dist_VWAP`, `dist_VWAP_rank_far` |
47
- | Donchian / Turtle breakout | Process port (N-bar channel → swing structure) | `zone`, `dist_swingHi`, `sr_resistance_break` |
48
- | ICT/SMC: FVG + Order Blocks | Direct process port of the zone logic | `STRUCT_ZONES` columns + `structure_*` signals |
49
- | WaveTrend, QQE, Hull Suite, Ichimoku, Parabolic SAR, Keltner | **All native since contract 46.1** — port directly | `WT1`/`WT2`, `QQE_RSI_MA`/`QQE_STOP`, `HMA20`, `ICHI_*`, `PSAR`, `KC_*` |
50
-
51
- ---
52
-
53
- ## 1 · Squeeze Momentum [LazyBear] (TTM Squeeze) — 4h
54
-
55
- **Source process.** Squeeze ON while Bollinger Bands sit inside Keltner Channels (volatility
56
- coiled); wait; when the squeeze releases, enter in the direction of the momentum histogram.
57
-
58
- **Port.** Keltner Channels are native (`KC_UPPER`/`KC_MID`/`KC_LOWER`), so the squeeze is the
59
- source's own definition: `BB_UPPER spread KC_UPPER` negative AND `BB_LOWER spread KC_LOWER`
60
- positive is bands-inside-Keltner. The board-relative proxy below remains serviceable but is no
61
- longer the only option — it substitutes
62
- *cross-sectional and absolute* Bollinger compression — a stricter, universe-aware read:
63
- `bbWidthPct_rank_lo lte 10` AND `ADX lt 20` as the `SQUEEZE_ON` building block. Momentum
64
- direction comes from the MACD histogram trajectory (`MACD_now gt 0` with `MACD_trend rising`
65
- for longs) instead of the LazyBear linreg histogram. Release = expansion bar with
66
- participation: `RVOL gte 1.5` and `pctB` beyond 0.85 / 0.15. This is Playbook 1
67
- (`playbooks.md`) — it *is* the LazyBear process under studio vocabulary; keep
68
- `bollinger_squeeze` at Critical-required (its `bandwidthPct` param is the absolute half of the
69
- detection) and `volatility_atr_expanding` as the release confirmation.
70
-
71
- ## 2 · Supertrend / UT Bot Alerts — 1h/4h
72
-
73
- **Source process.** An ATR-offset trailing line flips below/above price; entries on the flip,
74
- and the line itself is the stop for the life of the trade.
75
-
76
- **Port — the key insight: the studio's stop engine is native, not an indicator.** What the
77
- Pine script simulates with a plotted line, position management executes: enable trailing with
78
- `trailingTriggerR: 0` (trail from entry — the Supertrend/UT Bot behavior), `giveback` as the
79
- ATR-offset analog (30–40 tight like factor-2 Supertrend, 45–55 loose like factor-3), plus the
80
- stop band (`minStopLossAtrMultiple`/`max…`) bounding the initial distance. The *flip entry*
81
- is native: `ST_DIR` carries the direction and `ST_LINE` the plotted stop. **`ST_DIR` is a
82
- persisting state, not a flip event** — it reads the same on every bar of a trend, so the FLIP
83
- itself still needs an event column beside it. The named substitute for the flip is a trend-state
84
- change:
85
- `MAalign is "bullish"` (state) with the `EMA5_13 is "Bullish"` cross event as the trigger, and
86
- `ma_ema_bull_cross` / `ma_ema_aligned_bull` Critical/Important-required in `rules`. Say the
87
- substitution out loud when presenting the strategy.
88
-
89
- ```json
90
- "trailingEnabled": true, "trailingTriggerR": 0, "trailingGivebackPct": 35,
91
- "trailingBufferPct": 0.2, "breakEvenEnabled": false
92
- ```
93
-
94
- ## 3 · Chandelier Exit — any persona
95
-
96
- **Source process.** Stop trails the highest high since entry minus `3 × ATR(22)`; never widens.
97
-
98
- **Port.** Pure position-management mapping — trail from entry with a giveback sized to the
99
- chandelier distance: `trailingTriggerR: 0`, `trailingGivebackPct` ~45–55 (a 3×ATR pullback on
100
- a typical setup surrenders roughly half its open run — tune against the previewed `atrPct`),
101
- `maxStopLossAtrMultiple` near the structural cap so the initial stop can sit chandelier-wide.
102
- The studio stop also never widens; time decay stays off (chandelier gives trends room).
103
-
104
- ## 4 · MACD + 200 MA filter — 4h (the classic trend-following combo)
105
-
106
- **Source process.** Only long while price is above the 200-period average; enter on a MACD
107
- bullish cross; mirror for shorts below.
108
-
109
- **Port.** Regime as a required building block, cross as the carrier's trigger:
110
-
111
- ```json
112
- [
113
- { "conditionKey": "ABOVE_200", "name": "Above the 200 SMA",
114
- "definition": { "kind": "clause", "column": { "sectionKey": null, "header": "dist_SMA200" }, "op": "gt", "value": 0 },
115
- "verdict": null, "required": false },
116
- { "conditionKey": "MACD_LONG", "name": "MACD bull cross in uptrend",
117
- "definition": { "kind": "group", "op": "ALL", "members": [
118
- { "kind": "conditionRef", "conditionKey": "ABOVE_200" },
119
- { "kind": "clause", "column": { "sectionKey": null, "header": "MACD_cross" }, "op": "is", "label": "Bullish" } ] },
120
- "verdict": "UP", "required": false }
121
- ]
122
- ```
123
-
124
- Columns: `SMA200 distance` → `dist_SMA200`; `MACD crossDetect` → `MACD_cross` (event — TRUE
125
- only on the crossing bar, otherwise UNRESOLVED; that momentariness is faithful to the source,
126
- which also only fires on the cross). Rules: `macd_bull_cross`/`macd_bear_cross` 3 required ·
127
- `ma_sma200_above`/`ma_sma200_below` 2 required · `trend_adx_trending` 1. Gates ~0.6 / 2.
128
- Swing-trend geometry (1–2.5 ATR, RR 2, trail late).
129
-
130
- ## 5 · Golden Cross / Death Cross regime book — 4h position
131
-
132
- **Source process.** SMA50 crossing above SMA200 defines the bull regime; below, the bear.
133
-
134
- **Port.** The spread composition gives both the *state* (sign) and the *freshness* (trend):
135
- `SMA50 spread SMA200 × trajectory w4` → `SMA50_SMA200_spread_now` (>0 = golden regime) and
136
- `SMA50_SMA200_spread_trend` (`rising` = the cross is developing, not decaying). Carrier:
137
- `GOLDEN` verdict UP = `spread_now gt 0` AND `trend is "rising"`; add a market-breadth gate —
138
- the always-addressable `mktBreadth_crypto gte 0` (net % of the crypto field closing up) keeps
139
- the book out of single-name traps. Rules: `ma_sma200_above` 3 required, `ma_ema_aligned_bull`
140
- 2, `htf_ma_aligned_bull` 2. Position persona: wide stops (1.5–2.5 ATR), RR 2, trail
141
- 1.5R/giveback 50.
142
-
143
- ## 6 · RSI-2 (Larry Connors) — 1h mean reversion
144
-
145
- **Source process.** In an uptrend (close > 200 SMA), buy panic dips (RSI(2) < 10); exit fast
146
- (cross of the 5-period average / a few bars).
147
-
148
- **Port — direct.** `RSI2` is native as of contract 49.1, so this ports exactly and no substitution
149
- note is owed. `DIP_BUY` verdict UP = `dist_SMA200 gt 0` (ref a required `ABOVE_200`) AND
150
- `RSI2 lte 10`. Keep the literal `lte 10` as the gate: `RSI2 × classifyZone` exists and reads on the
151
- same Connors 10/90 bands, but a zone label is a fixed reading while the literal is a threshold the
152
- author can see and tune.
153
- Rules: `rsi_oversold` 3 required `{"threshold": 25}` (RSI14 gate tuned toward the fast-dip
154
- regime — read the signal schema first) · `ma_sma200_above` 2 required · `bollinger_lower_touch`
155
- 1. The source's fast exit is time, not price: `timeDecayEnabled: true`, grace 180, interval
156
- 60, tighten 15 → max 50, stale 20 — the studio's honest port of "if it hasn't bounced in a few
157
- bars, leave". RR 1.2–1.5, stops 1.5–2.5 ATR (dips need room), break-even 0.8R.
158
-
159
- ## 7 · VWAP reversion — 15m/1h intraday
160
-
161
- **Source process.** Fade stretches away from session VWAP back toward it; stand aside when the
162
- stretch is trend, not noise.
163
-
164
- **Port.** `VWAP distance` → `dist_VWAP` (signed %); the board-relative stretch is
165
- `VWAP distance × rank far` → `dist_VWAP_rank_far lte 5` (top-5 most stretched either way).
166
- `FADE_TO_VWAP` verdict from the sign: DOWN when `dist_VWAP gte 2` and `RSI14 gte 65`; UP when
167
- `dist_VWAP lte -2` and `RSI14 lte 35`; veto trend days with a required
168
- `NOT [ADX_state in ["trending","extreme"]]`. Rules: `rsi_overbought`/`rsi_oversold` 2 each,
169
- `bollinger_upper_touch`/`lower_touch` 2, `cvd_bear_divergence`/`bull_divergence` 1. Scalp
170
- geometry + aggressive time decay (VWAP reversion is a session trade — the anchor resets daily
171
- at 00:00 UTC, which the column's own gloss states).
172
-
173
- ## 8 · Donchian / Turtle breakout — 4h
174
-
175
- **Source process.** Buy the N-bar-high breakout, ride with a wide trailing stop, exit on the
176
- opposite channel.
177
-
178
- **Port.** The catalog's structural highs replace the fixed N-bar channel: `zone is
179
- "breakout high"` (price beyond the tracked swing high) with `dist_swingHi gte 0` as the
180
- numeric confirmation, `RVOL gte 1.5` for participation, and `sr_resistance_break` 3 required
181
- in rules (its own params define the break). Turtle exits are the trend preset: stops 1.5–2.5
182
- ATR, RR 2+, trail from 1R with giveback 50, no time decay. Mirror with `"breakdown low"` /
183
- `dist_swingLo` / `sr_support_break` for shorts. **Daily variant on any anchor:** pin the same
184
- structure at 1d — `zone_1d is "breakout high"`, `dist_swingHi_1d gte 0` (both validated) —
185
- which is the studio's daily-breakout condition. That pins the tracked *daily swing* pivot. For
186
- the literal previous-session extreme instead, author `PDH`/`PDL` directly — both are native
187
- structure metrics at the daily anchor, and both take `distance` and `crossDetect`, so
188
- `dist_PDH_1d gte 0` or a `crossDetect` on `PDH` expresses the prior-day break exactly. Pick by
189
- which level the source actually means; neither is a substitution for the other.
190
-
191
- ## 9 · ICT / Smart Money Concepts: FVG + Order Blocks — 15m/1h
192
-
193
- **Source process.** Establish higher-timeframe bias; wait for price to return into a fair
194
- value gap or order block aligned with that bias; enter on the reaction, stop beyond the zone.
195
-
196
- **Port — the zone half is native.** `STRUCT_ZONES` *is* the platform's FVG/order-block engine:
197
- `zones_htf_support_type` (`bullish FVG` / `bullish order block`), `zones_htf_support_dist`
198
- (signed %; support below price is negative — `between -1.5 0` = sitting on the zone),
199
- `zones_htf_support_age_h gte 12` (a standing zone, not the last move's shadow). Bias =
200
- `MAalign_htf is "bullish"` as a required building block. Carrier: bias + in-zone + a tape
201
- quorum (`N_OF(2)`: `buyPres gte 0.55`, `RVOL gte 1.2`, `closeChg gt 0`). Rules:
202
- `structure_fvg_approach` / `structure_ob_approach` 3/2 required (their `proximityPct` params
203
- are the "in the zone" dial), `structure_zone_confluence` 2, `sr_at_support` 2. Stops: tight
204
- band (0.5–1.5 ATR) — the zone's far edge is the invalidation, and the studio places stops by
205
- ATR/structure natively. **A grammar limit, not a missing metric** — a clause compares one column
206
- against a literal, so an ordered sequence of events has no expressible form at all: liquidity
207
- sweeps, displacement legs,
208
- killzone clocks, and Turtle-Soup false-break sequencing (ordering between events is outside
209
- the grammar) — offer this zone-reaction port as the nearest expressible neighbor, labelled.
210
-
211
- ## Now native — do not substitute for these
212
-
213
- WaveTrend (`WT1`/`WT2`), QQE (`QQE_RSI_MA`/`QQE_STOP`), Hull (`HMA20`), Ichimoku
214
- (`ICHI_CONV`/`ICHI_BASE`/`ICHI_SPAN_A`/`ICHI_SPAN_B`/`ICHI_LAG`), Parabolic SAR (`PSAR`), Keltner
215
- (`KC_UPPER`/`KC_MID`/`KC_LOWER`), daily pivots (`PIVOT_P`/`PIVOT_R1`–`R3`/`PIVOT_S1`–`S3`),
216
- Williams %R (`WILLR14`), Stochastic RSI (`STOCH_RSI14`), Bollinger boundaries
217
- (`BB_UPPER`/`BB_LOWER`), ADX components (`DI_PLUS`/`DI_MINUS`). All arrived with contract 46.1 —
218
- every one of them was listed as inexpressible in this file before it.
219
-
220
- Contract 49.1 did it again with seven more: Connors RSI-2 (`RSI2`, and `RSI2 × classifyZone` on its
221
- own 10/90 bands), the TTM squeeze state (`KC_SQUEEZE`), the 9/21/50 EMAs (`EMA9`/`EMA21`/`EMA50`)
222
- and the prior-day levels (`PDH`/`PDL`). Two of those were standing absence claims in this file:
223
- RSI-2 was called a named substitute, and the prior-day levels were said to need a grammar form no
224
- metric could supply — true of the `distance` offset it cited, and never a reason a PUBLISHED level
225
- could not exist. Author the prior-day levels at `1d` and nowhere else: a level computed from the
226
- prior daily bar has no reading on a 15-minute one, and construction refuses it rather than
227
- resolving empty.
228
-
229
- Re-read the absence section against the vendored digest before trusting any row in it. That check
230
- is `skill-contract.test.ts`, and it is the only thing that catches a claim which raises no error
231
- and merely tells a paying author their strategy cannot be built.
232
-
233
- ## Not expressible — the catalog keys this needs
234
-
235
- The one section where a claim that the catalog LACKS something may live, and every row names the key
236
- it denies so the claim stays checkable. A claim about the grammar's SHAPE (a clause compares one
237
- column against a literal; `distance` rejects an `offset`) is permanent and belongs in prose above.
238
- A claim that a metric is absent belongs here, or nowhere.
239
-
240
- Only a bare backticked key counts as the claim — write the neighbour as a column code or an
241
- expression, never as a lone key, or the row denies a metric that is in fact served.
242
-
243
- | Script / primitive | Key the catalog would need | Nearest expressible neighbour |
244
- |---|---|---|
245
- | Slow-baseline trend filters (100-period) | `SMA100` | `dist_SMA50` or `dist_SMA200`, whichever the source's horizon is nearer |
246
- | 200-period EXPONENTIAL baseline | `EMA200` | `dist_SMA200`. Deferred on measurement, not preference: at the platform's warmup floor an exponential 200 still carries 12.4% of its seed bar while a simple 200 is exact over the same window |
247
- | Prior-WEEK high/low | `PWH` / `PWL` | the prior-DAY levels at the daily anchor, or `zone_1w` structure |
248
-
249
- Never compile a "port" of these under the source's name without the substitution note — a
250
- player who asked for WaveTrend and silently got Stochastic has no way to learn otherwise.