@battlegrid/mcp-server 32.0.88 → 32.0.89
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/skills/EXPORT.json +13 -13
- package/skills/battlegrid-arena-play/SKILL.md +27 -6
- package/skills/battlegrid-officers/SKILL.md +1 -1
- package/skills/battlegrid-radar-deployment/SKILL.md +9 -4
- package/skills/battlegrid-radar-deployment/references/radar-stage-examples.md +4 -3
- package/skills/battlegrid-strategy-authoring/SKILL.md +93 -29
- package/skills/battlegrid-strategy-authoring/references/strategy-stage-examples.md +26 -3
- package/skills/battlegrid-strategy-doctor/SKILL.md +6 -3
- package/skills/battlegrid-strategy-examples/SKILL.md +371 -95
- package/skills/battlegrid-strategy-examples/references/playbooks.md +2 -2
- package/skills/battlegrid-strategy-examples/references/recipes.md +106 -0
- package/skills/battlegrid-strategy-examples/references/tradingview-ports.md +76 -22
- package/skills/battlegrid-trade-analysis/SKILL.md +13 -4
|
@@ -76,10 +76,10 @@ weak/developing/trending/extreme), `includeMovingAverages` (`dist_EMA20`, `MAali
|
|
|
76
76
|
|
|
77
77
|
Platform `includePerpSpotFlow` (`perpSpotFlow` vocab: confirmed_bull / confirmed_bear /
|
|
78
78
|
perp_led_fragile / spot_led_accumulation / neutral), `includeStructureZones`
|
|
79
|
-
(`zones_htf_support_dist` signed % of price from the zone
|
|
79
|
+
(`zones_htf_support_dist` signed % of price from the zone's near edge (its high), positive above a support zone and 0 inside it; `_age_bars`, whole bars of the zone timeframe), custom `Tape`
|
|
80
80
|
(`BUY_PRESSURE value`→`buyPres` 0–1, `RVOL value`, `CLOSE_CHANGE value`). Conditions:
|
|
81
81
|
`SPOT_ACCUM` (`perpSpotFlow is "spot_led_accumulation"`); `NEAR_SUPPORT`
|
|
82
|
-
(`zones_htf_support_dist between 0 2` + `
|
|
82
|
+
(`zones_htf_support_dist between 0 2` + `zones_htf_support_age_bars gte 3`); `DIP_BID` verdict
|
|
83
83
|
UP — refs plus an `N_OF(2)` quorum over `buyPres gte 0.55` / `RVOL20 gte 1.2` / `closeChg gt 0`
|
|
84
84
|
(quorum beats a brittle ALL); `FRAGILE_POP` verdict DOWN (`perp_led_fragile` +
|
|
85
85
|
`zones_htf_resist_dist between -2 0` + `RVOL20 gte 1.3`). Levels 0.5–1.2 ATR, RR 1.5, ATR floor
|
|
@@ -16,6 +16,7 @@ rather than events all live there. This document assumes them.
|
|
|
16
16
|
- Column recipes
|
|
17
17
|
- Cross detection
|
|
18
18
|
- Recency and structure
|
|
19
|
+
- Candle at a swing and liquidity-pool sweeps
|
|
19
20
|
- Board-relative rank recipes
|
|
20
21
|
- Cross-venue and perp/spot basis
|
|
21
22
|
- Crowd positioning
|
|
@@ -31,6 +32,8 @@ rather than events all live there. This document assumes them.
|
|
|
31
32
|
| Momentum build-up | `{ "metric": "RSI14", "transformId": "trajectory", "timeframe": { "rel": "anchor" }, "window": 4 }` | `RSI14_t3…_now`, `RSI14_trend` |
|
|
32
33
|
| Closed-bar-only trajectory | add `"bars": "closed"` to any trajectory | same, drawn from closed bars |
|
|
33
34
|
| Extension from trend | `{ "metric": "SMA50", "transformId": "distance", "timeframe": { "rel": "anchor" } }` | `dist_SMA50` (signed %) |
|
|
35
|
+
| Touch of the 20 EMA within half an ATR | `{ "metric": "EMA20", "transformId": "levelInteraction", "timeframe": { "rel": "anchor" }, "touchAtr": 0.5 }` | `EMA20_lvl_a0.5` — a column carries a buffer or an ATR multiple, never both |
|
|
36
|
+
| Touch of VWAP within 10 bps | `{ "metric": "VWAP", "transformId": "levelInteraction", "timeframe": { "rel": "anchor" }, "buffer": 10 }` | `VWAP_lvl_b10` |
|
|
34
37
|
| Funding paid over a day | `{ "metric": "FUNDING_RATE", "transformId": "aggregate", "timeframe": { "rel": "anchor" }, "window": 24 }` | `rate_mean24` |
|
|
35
38
|
| Chop filter on the entry rung | `{ "metric": "CLOSE", "transformId": "efficiency", "timeframe": { "rel": "lower" }, "window": 4, "bars": "closed" }` | `close_ltf_er` (≥0.6 directional; 4 changes, the last 5 closes) |
|
|
36
39
|
| One-bar volume concentration | `{ "metric": "VOLUME", "transformId": "maxShare", "timeframe": { "rel": "lower" }, "window": 4, "bars": "closed" }` | `volBase_ltf_maxShare` |
|
|
@@ -132,6 +135,109 @@ step down of the decided pivot, which is a lower high against the pivot before i
|
|
|
132
135
|
"definition": { "kind": "clause", "column": { "sectionKey": null, "header": "fractalHi" }, "op": "decreased", "hold": { "atLeast": 2, "of": 8 } } }
|
|
133
136
|
```
|
|
134
137
|
|
|
138
|
+
## Candle at a swing and liquidity-pool sweeps
|
|
139
|
+
|
|
140
|
+
A candle pattern AT a swing, and a sweep OF a liquidity pool, are compositions of shipped columns — no
|
|
141
|
+
one column reads either whole. Each recipe below is a whole condition; adapt its verdict and its `required`,
|
|
142
|
+
and keep its shape.
|
|
143
|
+
|
|
144
|
+
| Intent | Column | Header |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| Swing low age at a 21/21 pair | `{ "metric": "SWING_FRACTAL_LOW_BARS_AGO", "transformId": "value", "timeframe": { "rel": "anchor" }, "leftBars": 21, "rightBars": 21 }` | `fractalLoAgo_l21r21` |
|
|
147
|
+
| Swing high age at a 21/21 pair | `{ "metric": "SWING_FRACTAL_HIGH_BARS_AGO", "transformId": "value", "timeframe": { "rel": "anchor" }, "leftBars": 21, "rightBars": 21 }` | `fractalHiAgo_l21r21` |
|
|
148
|
+
| Pin bar of the bar 21 back | `{ "metric": "CANDLE_PIN", "transformId": "value", "timeframe": { "rel": "anchor" }, "offset": 21 }` | `pin_o21` |
|
|
149
|
+
| Engulfing of the bar 21 back | `{ "metric": "CANDLE_ENGULFING", "transformId": "value", "timeframe": { "rel": "anchor" }, "offset": 21 }` | `engulf_o21` |
|
|
150
|
+
| Buyside pool interaction | `{ "metric": "LIQUIDITY_POOL_ABOVE", "transformId": "levelInteraction", "timeframe": { "rel": "anchor" } }` | `poolAbove_lvl` |
|
|
151
|
+
| Sellside pool interaction | `{ "metric": "LIQUIDITY_POOL_BELOW", "transformId": "levelInteraction", "timeframe": { "rel": "anchor" } }` | `poolBelow_lvl` |
|
|
152
|
+
| Closed back under the buyside pool the last bar retired | `{ "metric": "LIQUIDITY_POOL_ABOVE_RECLAIMED", "transformId": "value", "timeframe": { "rel": "anchor" } }` | `poolAboveRecl` |
|
|
153
|
+
| Closed back over the sellside pool the last bar retired | `{ "metric": "LIQUIDITY_POOL_BELOW_RECLAIMED", "transformId": "value", "timeframe": { "rel": "anchor" } }` | `poolBelowRecl` |
|
|
154
|
+
|
|
155
|
+
**Candle at a swing** — LuxAlgo's *Swing Highs/Lows & Candle Patterns* at its length 21: a swing pivot of
|
|
156
|
+
21 bars each side, and the candle pattern of the pivot bar itself, Pine's `[21]`. A pivot is decided on
|
|
157
|
+
the bar that completes its right side, where the swing age reads the pair's `rightBars`, so on that bar
|
|
158
|
+
the pivot bar is `rightBars` bars back and the pattern column reads it at that offset. **The offset
|
|
159
|
+
equals the swing pair's `rightBars` and changes with it**: a 10/5 pair reads `fractalLoAgo_l10r5 between 5 5`
|
|
160
|
+
beside `pin_o5`. The age never reads below `rightBars`, so `between 21 21` is "decided on this bar": the
|
|
161
|
+
condition reads TRUE once per pivot, on its deciding bar — where LuxAlgo draws the label back on the pivot
|
|
162
|
+
bar, the condition never paints back. The patterns are the `candlePatterns` rules (the skill body,
|
|
163
|
+
`## Bar geometry`), each judged against the ten bars before the pivot bar. LuxAlgo's script tests bullish
|
|
164
|
+
and bearish engulfing with one identical condition; `engulf` reads `bullish` for a white body over a black
|
|
165
|
+
one and `bearish` for the mirror, so that defect never arises here. An offset column and a column off the
|
|
166
|
+
2/2 pair each hold Once.
|
|
167
|
+
|
|
168
|
+
A hammer at the swing low:
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{ "conditionKey": "HAMMER_AT_SWING_LOW", "name": "Hammer at a 21/21 swing low", "verdict": "UP", "required": false, "exitSide": null,
|
|
172
|
+
"definition": { "kind": "group", "op": "ALL", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
173
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "fractalLoAgo_l21r21" }, "op": "between", "low": 21, "high": 21, "hold": { "atLeast": 1, "of": 1 } },
|
|
174
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "pin_o21" }, "op": "is", "label": "lower_wick", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
A shooting star at the swing high, the mirror:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{ "conditionKey": "SHOOTING_STAR_AT_SWING_HIGH", "name": "Shooting star at a 21/21 swing high", "verdict": "DOWN", "required": false, "exitSide": null,
|
|
181
|
+
"definition": { "kind": "group", "op": "ALL", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
182
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "fractalHiAgo_l21r21" }, "op": "between", "low": 21, "high": 21, "hold": { "atLeast": 1, "of": 1 } },
|
|
183
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "pin_o21" }, "op": "is", "label": "upper_wick", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
A bullish engulfing at the swing low:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{ "conditionKey": "BULLISH_ENGULFING_AT_SWING_LOW", "name": "Bullish engulfing at a 21/21 swing low", "verdict": "UP", "required": false, "exitSide": null,
|
|
190
|
+
"definition": { "kind": "group", "op": "ALL", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
191
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "fractalLoAgo_l21r21" }, "op": "between", "low": 21, "high": 21, "hold": { "atLeast": 1, "of": 1 } },
|
|
192
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "engulf_o21" }, "op": "is", "label": "bullish", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
A bearish engulfing at the swing high, the mirror:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{ "conditionKey": "BEARISH_ENGULFING_AT_SWING_HIGH", "name": "Bearish engulfing at a 21/21 swing high", "verdict": "DOWN", "required": false, "exitSide": null,
|
|
199
|
+
"definition": { "kind": "group", "op": "ALL", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
200
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "fractalHiAgo_l21r21" }, "op": "between", "low": 21, "high": 21, "hold": { "atLeast": 1, "of": 1 } },
|
|
201
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "engulf_o21" }, "op": "is", "label": "bearish", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Sweep of a liquidity pool** — two forms. On ONE candle, the bar's high traded through the nearest
|
|
205
|
+
buyside pool above price and its close came back under it: `levelInteraction` over `LIQUIDITY_POOL_ABOVE`
|
|
206
|
+
reads `reject_from_below` (sellside: `reject_from_above` on `LIQUIDITY_POOL_BELOW`). Over TWO candles, a
|
|
207
|
+
close beyond the pool retires it (`poolAboveOk` reads false on that bar) and the next bar closes back:
|
|
208
|
+
from that next bar `poolAbove` already reads the next pool up, so the second bar is read through the
|
|
209
|
+
retired pool instead — `LIQUIDITY_POOL_ABOVE_RETIRED` (`poolAboveRetired`) is the pool the previous bar's
|
|
210
|
+
close retired, on that one bar only, and `LIQUIDITY_POOL_ABOVE_RECLAIMED` (`poolAboveRecl`) is true when
|
|
211
|
+
this bar's close is back at or under it. The "same or next candle" sweep is an `ANY` over the two. The
|
|
212
|
+
retired pool is a level, so `poolAboveRetired_lvl is "reject_from_above"` reads a retest that held after
|
|
213
|
+
the breakout, and `dist_poolAboveRetired` how far the close sits from it.
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{ "conditionKey": "BUYSIDE_POOL_SWEPT", "name": "Swept the buyside pool and closed back under it", "verdict": "DOWN", "required": false, "exitSide": null,
|
|
217
|
+
"definition": { "kind": "clause", "column": { "sectionKey": null, "header": "poolAbove_lvl" }, "op": "is", "label": "reject_from_below", "hold": { "atLeast": 1, "of": 1 } } }
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{ "conditionKey": "SELLSIDE_POOL_SWEPT", "name": "Swept the sellside pool and closed back over it", "verdict": "UP", "required": false, "exitSide": null,
|
|
222
|
+
"definition": { "kind": "clause", "column": { "sectionKey": null, "header": "poolBelow_lvl" }, "op": "is", "label": "reject_from_above", "hold": { "atLeast": 1, "of": 1 } } }
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The same or next candle, on either side:
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{ "conditionKey": "BUYSIDE_POOL_SWEPT_TWO_BAR", "name": "Swept the buyside pool and closed back under it, on the same or the next candle", "verdict": "DOWN", "required": false, "exitSide": null,
|
|
229
|
+
"definition": { "kind": "group", "op": "ANY", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
230
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "poolAbove_lvl" }, "op": "is", "label": "reject_from_below", "hold": { "atLeast": 1, "of": 1 } },
|
|
231
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "poolAboveRecl" }, "op": "is", "label": "true", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{ "conditionKey": "SELLSIDE_POOL_SWEPT_TWO_BAR", "name": "Swept the sellside pool and closed back over it, on the same or the next candle", "verdict": "UP", "required": false, "exitSide": null,
|
|
236
|
+
"definition": { "kind": "group", "op": "ANY", "hold": { "atLeast": 1, "of": 1 }, "members": [
|
|
237
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "poolBelow_lvl" }, "op": "is", "label": "reject_from_above", "hold": { "atLeast": 1, "of": 1 } },
|
|
238
|
+
{ "kind": "clause", "column": { "sectionKey": null, "header": "poolBelowRecl" }, "op": "is", "label": "true", "hold": { "atLeast": 1, "of": 1 } } ] } }
|
|
239
|
+
```
|
|
240
|
+
|
|
135
241
|
## Board-relative rank recipes
|
|
136
242
|
|
|
137
243
|
`rank` turns any column into an ordinal across the scanned board. Ordering semantics: `hi` most
|
|
@@ -13,6 +13,9 @@ engine) and names its substitutions where the catalog lacks a primitive.
|
|
|
13
13
|
- Donchian / Turtle breakout
|
|
14
14
|
- ICT / SMC (FVG + order blocks)
|
|
15
15
|
- Pivot highs / lows, HH-HL structure and break of structure
|
|
16
|
+
- Any pivot length (`leftBars` / `rightBars`)
|
|
17
|
+
- Swing Highs/Lows & Candle Patterns [LuxAlgo]
|
|
18
|
+
- Liquidity pools and their sweeps
|
|
16
19
|
- Chaikin Money Flow
|
|
17
20
|
- Now native, formerly substituted
|
|
18
21
|
- Statistics over a series' own history
|
|
@@ -63,13 +66,15 @@ rules about the columns themselves, not about porting — they live in the skill
|
|
|
63
66
|
- **VWAP reversion** → `dist_VWAP` band + `dist_VWAP_rank_far lte 5` for board-relative
|
|
64
67
|
stretch; required `NOT [ADX14_state in ["trending","extreme"]]` veto; scalp geometry +
|
|
65
68
|
aggressive timeDecay (`VWAP` anchors daily at 00:00 UTC; `VWAP_WEEK`, `VWAP_MONTH`, `VWAP_TRADING_SESSION` and
|
|
66
|
-
the rolling `VWAP_ROLLING_1H`/`4H`/`24H` are the other anchors, each with ±1/2/3σ bands `_UB<k>`/`_LB<k>` —
|
|
67
|
-
band
|
|
69
|
+
the rolling `VWAP_ROLLING_1H`/`4H`/`24H` are the other anchors, each with ±1/2/3σ bands `_UB<k>`/`_LB<k>` — the
|
|
70
|
+
close's position against a band is `CLOSE × spread(VWAP_LB2)` rather than a hand-computed σ, and the bar's contact
|
|
71
|
+
with it is `VWAP_LB2 × levelInteraction`).
|
|
68
72
|
- **Donchian / Turtle breakout** (`close > ta.highest(high, 20)[1]`) → `dist_donchianHiPrior20 crossesAbove 0`
|
|
69
73
|
over `DONCHIAN_UPPER_PRIOR × distance` (the breakout bar; `dist_donchianHiPrior20 gt 0` holds on every
|
|
70
74
|
close of the run) + `RVOL20 gte 1.5`; turtle exits = trend preset (trail from 1R, giveback 50). Mirror with
|
|
71
|
-
`dist_donchianLoPrior20 crossesBelow 0`. The same-bar rail
|
|
72
|
-
own high, so it can never confirm a close-based break
|
|
75
|
+
`dist_donchianLoPrior20 crossesBelow 0`. The same-bar rail is refused under `distance`: it includes the
|
|
76
|
+
breakout bar's own high, so it can never confirm a close-based break. Its gap, `close_donchianHi20_spread`, is
|
|
77
|
+
never above 0 — do not AND it in. `zone is "breakout high"` reads
|
|
73
78
|
the prior-bar rail: it is the label form of the `dist_donchianHiPrior20 gt 0` state, holds on every close of
|
|
74
79
|
the run, and adds nothing to the crossing; `"breakdown low"` mirrors it.
|
|
75
80
|
**Daily-breakout variant on any anchor:** pin the rail at 1d — `dist_donchianHiPrior20_1d crossesAbove 0`
|
|
@@ -92,29 +97,71 @@ rules about the columns themselves, not about porting — they live in the skill
|
|
|
92
97
|
`DAY_OF_WEEK between 1 and 5`) is an ordinary condition; the glosses state the windows.
|
|
93
98
|
- **ICT / SMC (FVG + order blocks)** → `STRUCT_ZONES` is the native zone engine:
|
|
94
99
|
`zones_htf_support_type` (`bullish FVG`/`bullish order block`), `zones_htf_support_dist
|
|
95
|
-
between 0 1.5`, `
|
|
100
|
+
between 0 1.5`, `_age_bars gte 3`, HTF bias required via `MAalign_htf`. A killzone is a session window
|
|
96
101
|
(`TRADING_SESSION`, `UTC_HOUR`) and a sweep of a previous session's extreme is `PRIOR_<S>_HIGH_SWEPT` /
|
|
97
|
-
`_LOW_SWEPT
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
`_LOW_SWEPT`. Event *sequencing* is an entry condition's root **In order** (`op: "SEQUENCE"`,
|
|
103
|
+
`within` bars — see `## Conditions` in the skill body): sweep → displacement → return to the zone is
|
|
104
|
+
`In order within 12 [ PRIOR_ASIA_LOW_SWEPT step, the displacement step, the zone-touch step ]`, each
|
|
105
|
+
step one bar's reading. What it cannot state is still a grammar limit, not a missing metric: an exit
|
|
106
|
+
that waits on an ordering, an ordering inside another, or a step that counts its own closes — name
|
|
107
|
+
it as one.
|
|
108
|
+
- **Pivot highs / lows, HH-HL structure and break of structure** (`ta.pivothigh(left, right)` /
|
|
109
|
+
`ta.pivotlow(left, right)`) → `SWING_FRACTAL_HIGH` / `SWING_FRACTAL_LOW` are the native swing levels and
|
|
104
110
|
`SWING_FRACTAL_LABEL` the structure label (`HH`/`HL`/`LH`/`LL`/`none`) — see `## Swing structure` in
|
|
105
|
-
the skill body. Pine's tie rule holds (an equal
|
|
106
|
-
not), and each level is the stepped, non-repainting
|
|
107
|
-
pivot's right side, not plotted back on the pivot bar.
|
|
108
|
-
`dist_fractalHi crossesAbove 0` / `dist_fractalLo crossesBelow 0`; "structure is
|
|
109
|
-
`fractalLabel in ["HH","HL"]`. The pivot each latest one is compared with is native too:
|
|
111
|
+
the skill body, which states the default pair, `ta.pivothigh(2, 2)`. Pine's tie rule holds (an equal
|
|
112
|
+
extreme on the left is allowed, on the right it is not), and each level is the stepped, non-repainting
|
|
113
|
+
series — held from the bar that completes the pivot's right side, not plotted back on the pivot bar.
|
|
114
|
+
Break of structure is `dist_fractalHi crossesAbove 0` / `dist_fractalLo crossesBelow 0`; "structure is
|
|
115
|
+
bullish" is `fractalLabel in ["HH","HL"]`. The pivot each latest one is compared with is native too:
|
|
110
116
|
`PRIOR_SWING_FRACTAL_HIGH` / `PRIOR_SWING_FRACTAL_LOW` (`pFractalHi` / `pFractalLo`, Pine's
|
|
111
117
|
`ta.valuewhen(not na(ph), ph, 1)`) are price levels held while the prior pivot is in reach, so
|
|
112
118
|
`dist_pFractalHi crossesAbove 0` is a close through the swing high before the last one. A pivot's age is
|
|
113
119
|
`SWING_FRACTAL_HIGH_BARS_AGO` / `SWING_FRACTAL_LOW_BARS_AGO` (`fractalHiAgo` / `fractalLoAgo`), counted
|
|
114
|
-
from the pivot's own bar:
|
|
115
|
-
`ta.barssince(not na(ph)) + 2
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
from the pivot's own bar: `rightBars` on the bar that completes it, so it reads Pine's
|
|
121
|
+
`ta.barssince(not na(ph)) + rightBars` (`+ 2` at the default), and `fractalLoAgo lte 5` keeps a setup to
|
|
122
|
+
a fresh swing low — the deciding bar and the three after it, which at 5/5 is `fractalLoAgo_l5r5 lte 8`.
|
|
123
|
+
- **Any pivot length ports exactly — `ta.pivothigh(5, 5)` is the swing column at 5/5, not a
|
|
124
|
+
substitution.** The seven swing metrics (the two levels, the two prior pivots, the two ages and the
|
|
125
|
+
label) declare `leftBars` / `rightBars`: default 2/2, minimum 1, `bound: 'depth'`. Stage Pine's two
|
|
126
|
+
lengths on the swing column beside its transform knobs, and leave the pair off for 2/2 — an explicit
|
|
127
|
+
2/2 is the same column. This column is the distance to `ta.pivothigh(5, 5)`'s held level, with the same
|
|
128
|
+
tie rule and held step:
|
|
129
|
+
`{ "metric": "SWING_FRACTAL_HIGH", "transformId": "distance", "timeframe": { "rel": "anchor" }, "leftBars": 5, "rightBars": 5 }`.
|
|
130
|
+
Off 2/2 the header carries `_l<left>r<right>` after the code: `dist_fractalHi_l5r5`, `fractalLabel_l5r5`,
|
|
131
|
+
`fractalLoAgo_l5r5` (`fractalHi_l5r5_1h` pinned to 1h).
|
|
132
|
+
The pair reads `left + right + 1` bars to decide one pivot and must fit the readable depth; a wider pair
|
|
133
|
+
is refused with `REPORT_COLUMN_DEPTH_EXCEEDED` on `leftBars`, and each side's served `maximum` is the
|
|
134
|
+
bound (`strategy-authoring`'s knob rules). Off 2/2 the server computes the pivots over the column's own
|
|
135
|
+
bars, so two refusals follow:
|
|
136
|
+
- `rank`, `relativeTo` and the depth-bounded windows (the averages and the statistics) read the stored
|
|
137
|
+
2/2 and refuse an off-default pair — stage a pair only on a transform whose entry serves
|
|
138
|
+
`metricParametersAccepted: true`;
|
|
139
|
+
- a condition over the column admits one bar: a hold over more than one close is refused
|
|
140
|
+
(`CONDITION_HOLD_ILLEGAL`), so is an **In order** step over it (`CONDITION_SEQUENCE_WINDOW_INVALID`),
|
|
141
|
+
and every prior-bar operator (`crossesAbove`, `crossesBelow`, `increased`, `decreased`, `enters`,
|
|
142
|
+
`exits`) is refused with `CONDITION_OPERATOR_UNSUPPORTED`, leaving `lt`, `lte`, `gte`, `gt`, `between`,
|
|
143
|
+
`is` and `in`.
|
|
144
|
+
|
|
145
|
+
So at 5/5 the levels, the label, the prior pivots and the ages port as states
|
|
146
|
+
(`fractalLabel_l5r5 in ["HH","HL"]`, `fractalLoAgo_l5r5 lte 8`), and the one-bar break the default pair
|
|
147
|
+
reads as `dist_fractalHi crossesAbove 0` reads at 5/5 as the state `dist_fractalHi_l5r5 gt 0`: the close
|
|
148
|
+
stands above the last 5/5 swing high, from the break until the close falls back or the level steps to
|
|
149
|
+
the next swing. That edge-for-state reading is what the spec-lock question names; the pivot length
|
|
150
|
+
itself is the script's own and is never named as a substitution.
|
|
151
|
+
- **Swing Highs/Lows & Candle Patterns [LuxAlgo]** (length 21, the pattern read at Pine's `[21]`, the
|
|
152
|
+
pivot bar) → the swing age at the 21/21 pair pinned to 21 beside the candle pattern at offset 21:
|
|
153
|
+
`fractalLoAgo_l21r21 between 21 21` AND `pin_o21 is "lower_wick"` is the hammer at a swing low, and
|
|
154
|
+
`engulf_o21` the engulfing. The offset equals the pair's `rightBars` and changes with it. The condition
|
|
155
|
+
reads TRUE on the bar that decides the pivot, where the script draws its label back on the pivot bar;
|
|
156
|
+
the patterns are the `candlePatterns` rules, so the script's identical bullish and bearish engulfing
|
|
157
|
+
test never arises. Whole conditions: `recipes.md`, *Candle at a swing and liquidity-pool sweeps*.
|
|
158
|
+
- **Liquidity pools and their sweeps** (LuxAlgo Liquidity Swings' close retirement over SMC's equal
|
|
159
|
+
pivots) → `LIQUIDITY_POOL_ABOVE` / `LIQUIDITY_POOL_BELOW` (`poolAbove` / `poolBelow`) are native. A
|
|
160
|
+
one-candle sweep is `poolAbove_lvl is "reject_from_below"`, mirrored with `poolBelow_lvl is
|
|
161
|
+
"reject_from_above"`. A sweep over two bars — the outbreak's close retires the pool, the next close
|
|
162
|
+
comes back — is `poolAboveRecl is "true"` (`poolBelowRecl`), and the retired pool itself is
|
|
163
|
+
`poolAboveRetired` / `poolBelowRetired`, a level a retest reads with `levelInteraction`. Whole
|
|
164
|
+
conditions: `recipes.md`, *Candle at a swing and liquidity-pool sweeps*.
|
|
118
165
|
- **Chaikin Money Flow** (TradingView's built-in "Chaikin Money Flow" script, length 20; Pine has no
|
|
119
166
|
`ta.cmf`) → `CMF20` is native: each bar's volume weighted by where it closed in its range, summed over
|
|
120
167
|
20 closed bars and divided by their volume, −1 to +1. `CMF20 gt 0` is the accumulation state and
|
|
@@ -126,7 +173,8 @@ rules about the columns themselves, not about porting — they live in the skill
|
|
|
126
173
|
and signals (`MACD_LINE`/`MACD_SIGNAL`, `PPO_LINE`/`PPO_SIGNAL` — the line's zero cross is
|
|
127
174
|
`MACD_LINE × crossDetect`, and the signal-line cross is `MACD_HIST × crossDetect`, the histogram being
|
|
128
175
|
line minus signal), the 15-bar rate of change (`ROC15`), the Donchian break memory
|
|
129
|
-
(`DONCHIAN_BROKEN_HI`/`DONCHIAN_BROKEN_LO
|
|
176
|
+
(`DONCHIAN_BROKEN_HI`/`DONCHIAN_BROKEN_LO`, and as of the bar before — Pine's `brk[1]` —
|
|
177
|
+
`DONCHIAN_BROKEN_HI_PRIOR`/`DONCHIAN_BROKEN_LO_PRIOR`, the level a retest or failed-breakout clause reads), daily pivots of
|
|
130
178
|
all six Pivot Points Standard types (Traditional `PIVOT_P`/`PIVOT_R1`–`R5`/`PIVOT_S1`–`S5`, then
|
|
131
179
|
`PIVOT_FIB_*`, `PIVOT_CLASSIC_*`, `PIVOT_CAM_*`, `PIVOT_WOODIE_*`, `PIVOT_DM_*` — a level one type shares
|
|
132
180
|
with Traditional is read from the Traditional key) and the same six types on the previous ISO week,
|
|
@@ -154,6 +202,12 @@ rules about the columns themselves, not about porting — they live in the skill
|
|
|
154
202
|
- `ta.rsi(x, n)` and `ta.cci(x, n)` are `x × rsi` and `x × cci` at window `n` (`hlc3_rsi21`, `close_cci50`),
|
|
155
203
|
each null over a window whose values are all equal; the stored `RSI14`, `RSI7`, `RSI2` and `CCI20` (on HLC3)
|
|
156
204
|
are the exact source at their own length, and `EMA50 × rsi` is the RSI of the stored 50-bar average;
|
|
205
|
+
- one of those over another is a chain, the inner's length on `window` and the outer's on `chainedWindow`:
|
|
206
|
+
`ta.rsi(ta.ema(x, n), m)` is `x × ema(n) × rsi(m)` (`close_ema200_rsi14`), `ta.cci(ta.sma(x, n), m)` is
|
|
207
|
+
`x × aggregate(n) × cci(m)`, and the built-in RSI's smoothing line `ta.sma(ta.rsi(x, n), m)` is
|
|
208
|
+
`x × rsi(n) × aggregate(m)`. The outer may be any average or statistic; the chained outer's catalog entry names
|
|
209
|
+
the key it bounds (`windowParameter`) and serves `innerWindowMaximum` for the inner. Under an average or an RSI
|
|
210
|
+
the chain is the windowed composite, within a few RSI points of a full-history chart on a slow average;
|
|
157
211
|
- `ta.percentrank(x, n)` is `x × pctl` at window `n` — the `n` bars BEFORE the newest, ties at or below;
|
|
158
212
|
- `ta.highest(x, n)` / `ta.lowest(x, n)` are `x × rollingMax` / `x × rollingMin` (`high_max20`
|
|
159
213
|
is `DONCHIAN_UPPER`'s same-bar rail);
|
|
@@ -39,9 +39,15 @@ Not "what were its returns" — whether it did *the thing it was told to do*.
|
|
|
39
39
|
`signalSource`, and quote its KPIs as served — win rate, net P&L, best and worst trade, entry
|
|
40
40
|
rate, average conviction and risk/reward, durations — recomputing none. `get_agent_performance`
|
|
41
41
|
measures from the budget baseline, not over a period. A `{ profile: null }` result is
|
|
42
|
-
**UNDETERMINED** for that agent: the read serves the player's own private agents only. The
|
|
43
|
-
|
|
44
|
-
`
|
|
42
|
+
**UNDETERMINED** for that agent: the read serves the player's own private agents only. The regime,
|
|
43
|
+
hour, weekday and coin slices of the decisions made over a period are
|
|
44
|
+
`get_agent_review_slices`'s, not this read's.
|
|
45
|
+
- `get_agent_conditions` when the question is whether the mandate's conditions are doing their job: each
|
|
46
|
+
condition the agent's decisions cited over the last 90 days (the served `window`), by verdict against what
|
|
47
|
+
those decisions became — one row per strategy revision, because a revision may redefine a condition, so never
|
|
48
|
+
add two rows of one condition together. `get_agent_entry_discipline` answers what waiting for confirmation cost
|
|
49
|
+
over the same window. For every agent on one strategy, pass its `strategyId` to `get_conditions_breakdown` or
|
|
50
|
+
`get_entry_discipline_breakdown`.
|
|
45
51
|
- `get_trade_outcome_by_decision` (a trade row's `decisionId`) / `get_trade_chart` when a specific trade
|
|
46
52
|
needs explaining: the outcome carries the fills, fees, slippage, leverage, duration and exit label. A
|
|
47
53
|
measurable trade's `tradeExcursion` reads in R: `mfeR` and `maeR` (the best and worst it reached),
|
|
@@ -76,7 +82,10 @@ the platform's recorded forward marks, never from today's price.
|
|
|
76
82
|
|
|
77
83
|
- Select the decisions with `list_signal_logs`, then read each one's `get_signal_debrief` (the row's
|
|
78
84
|
`agentId`, and its `id` as `logId`). When the question is the agent-wide pattern rather than named
|
|
79
|
-
decisions, read `get_agent_decision_quality
|
|
85
|
+
decisions, read `get_agent_decision_quality`: one row per model the agent's decisions ran on under
|
|
86
|
+
`quality.rows`, the `isCurrentModel` row being the model it runs now — name a row's model beside every
|
|
87
|
+
figure quoted from it, and never pool two rows. For your account, a team or a strategy cohort, read
|
|
88
|
+
`get_decision_quality_breakdown`.
|
|
80
89
|
- **Never mark a past decision against a current price.** A market-context read, a live mark or any
|
|
81
90
|
price read now answers a different question. The debrief's marks are anchored at the decision
|
|
82
91
|
(`decisionAnchor`) and, for a closed trade, at the exit (`exitAnchor`).
|