@bitget-ai/getagent-skill 0.2.1 → 0.2.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/VERSION +1 -1
- package/package.json +1 -1
- package/skills/getagent/SKILL.md +29 -1
- package/skills/getagent/examples/btc-ema-cross-demo/backtest.yaml +4 -0
- package/skills/getagent/references/api/publish.md +4 -0
- package/skills/getagent/references/backtest-engine.md +80 -151
- package/skills/getagent/references/package-schema.md +30 -8
- package/skills/getagent/references/sdk/backtest/catalog.md +15 -2
- package/skills/getagent/references/sdk/data/arxiv.md +8 -10
- package/skills/getagent/references/sdk/data/catalog.md +1 -4
- package/skills/getagent/references/sdk/data/commodity.md +25 -39
- package/skills/getagent/references/sdk/data/coverage.md +0 -3
- package/skills/getagent/references/sdk/data/crypto.md +158 -357
- package/skills/getagent/references/sdk/data/currency.md +7 -15
- package/skills/getagent/references/sdk/data/derivatives.md +35 -50
- package/skills/getagent/references/sdk/data/economy.md +175 -259
- package/skills/getagent/references/sdk/data/equity.md +257 -393
- package/skills/getagent/references/sdk/data/etf.md +40 -64
- package/skills/getagent/references/sdk/data/famafrench.md +38 -50
- package/skills/getagent/references/sdk/data/fixedincome.md +89 -139
- package/skills/getagent/references/sdk/data/imf_utils.md +0 -8
- package/skills/getagent/references/sdk/data/index.md +18 -32
- package/skills/getagent/references/sdk/data/news.md +52 -58
- package/skills/getagent/references/sdk/data/playbook-supported.md +965 -1600
- package/skills/getagent/references/sdk/data/regulators.md +23 -43
- package/skills/getagent/references/sdk/data/sentiment.md +12 -34
- package/skills/getagent/references/sdk/data/uscongress.md +13 -21
- package/skills/getagent/references/sdk/data/web_search.md +3 -7
- package/skills/getagent/references/sdk/data/wikipedia.md +12 -18
- package/skills/getagent/scripts/validate.py +127 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official GetAgent Agent Skill for trading Playbook authoring",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.2"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "getagent",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Create, validate, upload, backtest, publish, and enable GetAgent quantitative trading Playbooks.",
|
|
16
|
-
"version": "0.2.
|
|
16
|
+
"version": "0.2.2",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "GetAgent",
|
|
19
19
|
"email": "support@bitget.com"
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.2
|
package/package.json
CHANGED
package/skills/getagent/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ compatibility: >-
|
|
|
12
12
|
access to the GetAgent Playbook control-plane API for upload/run/publish.
|
|
13
13
|
metadata:
|
|
14
14
|
author: getagent
|
|
15
|
-
version: v0.2.
|
|
15
|
+
version: v0.2.2
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
# GetAgent Playbook Creator
|
|
@@ -99,6 +99,22 @@ Use the English equivalent when the user's first message is English.
|
|
|
99
99
|
- Runtime SDK: `references/sdk/runtime/catalog.md`
|
|
100
100
|
- LLM SDK: `references/sdk/llm/catalog.md`
|
|
101
101
|
|
|
102
|
+
## Backtest Output Pitfalls
|
|
103
|
+
|
|
104
|
+
Before writing `main_backtest.py`, read `references/backtest-engine.md` §Backtest
|
|
105
|
+
Output Contract. The three most common publish failures are:
|
|
106
|
+
|
|
107
|
+
1. **"缺少可发布的真实 equity curve"** — no `output/equity_curve.csv`, and the
|
|
108
|
+
JSON report is too large for the Runner to read.
|
|
109
|
+
2. **Missing real evidence** — the run did not produce a real
|
|
110
|
+
`output/equity_curve.csv` or platform-readable historical evidence. Do not
|
|
111
|
+
fabricate dense points or hand-written summaries.
|
|
112
|
+
3. **Incorrect `total_return_pct` display** — `result.raw` has engine-level
|
|
113
|
+
summary fields flattened to the top level. The backend merge uses the report
|
|
114
|
+
as BASE (`setdefault` from signal cannot override). You must overwrite
|
|
115
|
+
`raw["net_pnl"]` and `raw["total_return_pct"]` with correct absolute values
|
|
116
|
+
before writing `backtest_report.json`.
|
|
117
|
+
|
|
102
118
|
## Hard Boundaries
|
|
103
119
|
|
|
104
120
|
- Do not tell users to install or execute the private GetAgent SDK locally.
|
|
@@ -111,6 +127,18 @@ Use the English equivalent when the user's first message is English.
|
|
|
111
127
|
- Do not call trade mutation APIs directly in a signal-only branch. Emit the
|
|
112
128
|
signal successfully and let the runtime decide whether follow-trade is
|
|
113
129
|
allowed.
|
|
130
|
+
- For `backtest_support: full`, always declare a bounded
|
|
131
|
+
`backtest.yaml.execution.start` / `execution.end` window, never pass
|
|
132
|
+
`provider=...`, and ensure any
|
|
133
|
+
`data_requirements.required_bar_fields` are actually built and referenced in
|
|
134
|
+
`src/**`.
|
|
135
|
+
- Keep symbols consistent across `manifest.trading_symbols`, display text,
|
|
136
|
+
README, `backtest.yaml` instruments, data calls, and emitted signals. If the
|
|
137
|
+
submitted symbol is a typo or unavailable and you replace it with a supported
|
|
138
|
+
symbol, rename the package/title and explain the correction in README and the
|
|
139
|
+
final summary.
|
|
140
|
+
- In Nautilus strategy code, call `self.cancel_all_orders(instrument_id)` and
|
|
141
|
+
`self.close_all_positions(instrument_id)` with an explicit instrument id.
|
|
114
142
|
- Do not publish or enable without showing the endpoint and masked
|
|
115
143
|
`ACCESS-KEY` prefix and getting the user's intent for that operation.
|
|
116
144
|
|
|
@@ -55,6 +55,10 @@ stable public contract for:
|
|
|
55
55
|
- If `backtest_support = full`
|
|
56
56
|
- the current runtime must be able to execute it (`runtime_profile = deterministic`)
|
|
57
57
|
- the owner must first produce one successful historical evaluation run
|
|
58
|
+
- that run must include a real equity/NAV curve, not only aggregate metrics
|
|
59
|
+
- the curve must cover the declared replay contract: at least one point per
|
|
60
|
+
`backtest.yaml` bar interval across `execution.start` / `execution.end`, or
|
|
61
|
+
at least `lookback_bars` points when the playbook uses a lookback-only replay
|
|
58
62
|
- the Playbook should expose one official public backtest snapshot
|
|
59
63
|
- list / detail surfaces should use that snapshot, not an arbitrary recent run
|
|
60
64
|
- If `backtest_support = none`
|
|
@@ -94,8 +94,8 @@ Required sections:
|
|
|
94
94
|
- optional `config_class`
|
|
95
95
|
- optional `config`
|
|
96
96
|
- `execution`
|
|
97
|
-
-
|
|
98
|
-
-
|
|
97
|
+
- required `start`
|
|
98
|
+
- required `end`
|
|
99
99
|
|
|
100
100
|
## Execution Model
|
|
101
101
|
|
|
@@ -138,7 +138,9 @@ instrument frames into the strategy through `set_feature_frames(...)` or
|
|
|
138
138
|
| `result.sharpe_ratio` | float | Sharpe ratio |
|
|
139
139
|
| `result.max_drawdown_pct` | float | Max drawdown % |
|
|
140
140
|
| `result.win_rate` | float | Win rate fraction (0.0-1.0) |
|
|
141
|
-
| `result.total_trades` | int |
|
|
141
|
+
| `result.total_trades` | int | Filled execution count when fills are available |
|
|
142
|
+
| `result.fill_count` | int | Filled execution count |
|
|
143
|
+
| `result.position_count` | int | Nautilus position row count |
|
|
142
144
|
| `result.profit_factor` | float | Profit factor |
|
|
143
145
|
| `result.summary` | dict | Stable normalized account-level summary |
|
|
144
146
|
| `result.raw` | dict | Full Nautilus-derived output |
|
|
@@ -244,185 +246,112 @@ Inspect:
|
|
|
244
246
|
- `result.raw["reports"]["fills"]`
|
|
245
247
|
- `result.raw["reports"]["positions"]`
|
|
246
248
|
|
|
247
|
-
##
|
|
249
|
+
## Backtest Output Contract
|
|
248
250
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
When `main_backtest.py` writes output files, the platform Runner collects them
|
|
252
|
+
and merges them into the run record. Getting this wrong causes publish failures
|
|
253
|
+
("缺少可发布的真实 equity curve") or incorrect metrics display.
|
|
252
254
|
|
|
253
|
-
|
|
255
|
+
### Required Output Files
|
|
254
256
|
|
|
255
|
-
|
|
257
|
+
| File | Purpose | Size |
|
|
258
|
+
| ---- | ------- | ---- |
|
|
259
|
+
| `output/backtest_report.json` | Nautilus raw result (summary, stats, reports, config) | Keep small — omit equity curve from JSON |
|
|
260
|
+
| `output/equity_curve.csv` | Lightweight curve the Runner always reads reliably | ~100 bytes/point |
|
|
256
261
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
# Backtest Engine
|
|
262
|
+
The Runner reads **both** files. If `backtest_report.json` is too large (common
|
|
263
|
+
with 3+ month runs), `proxy.read_file()` may silently fail. The CSV is a
|
|
264
|
+
guaranteed fallback.
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- [Basic Usage](#basic-usage)
|
|
265
|
-
- [Backtest Eligibility](#backtest-eligibility)
|
|
266
|
-
- [Spec Shape](#spec-shape)
|
|
267
|
-
- [Execution Model](#execution-model)
|
|
268
|
-
- [BacktestResult](#backtestresult)
|
|
269
|
-
- [Multi-Instrument Replays](#multi-instrument-replays)
|
|
270
|
-
- [Zero-Trade Diagnostics](#zero-trade-diagnostics)
|
|
271
|
-
- [Chart Generation](#chart-generation)
|
|
266
|
+
### Equity Curve Metadata
|
|
272
267
|
|
|
273
|
-
|
|
268
|
+
The platform records actual curve metadata such as point count and the first /
|
|
269
|
+
last curve timestamp. It does not require a fixed density.
|
|
274
270
|
|
|
275
271
|
```python
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
bars = data.crypto.futures.kline(symbol="BTCUSDT", interval="1h", exchange="binance")
|
|
279
|
-
ohlcv = data.to_dataframe(bars, datetime_index="date")
|
|
280
|
-
|
|
281
|
-
result = backtest.run(
|
|
282
|
-
ohlcv_data={"BTCUSDT.BINANCE": ohlcv},
|
|
283
|
-
spec=runtime.backtest_spec,
|
|
284
|
-
)
|
|
285
|
-
chart_path = backtest.generate_chart(result)
|
|
272
|
+
expected_points = ceil((execution.end - execution.start).total_seconds() / interval_seconds)
|
|
286
273
|
```
|
|
287
274
|
|
|
288
|
-
|
|
275
|
+
That value may still appear as diagnostic metadata in older runs, but it is not
|
|
276
|
+
a publish gate. Do not fabricate forward-filled points just to make the curve
|
|
277
|
+
look dense.
|
|
289
278
|
|
|
290
|
-
|
|
279
|
+
### Metrics Merge Priority (Critical)
|
|
291
280
|
|
|
292
|
-
|
|
281
|
+
The Runner builds `metrics_output` with this merge order:
|
|
293
282
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
### Do not use the engine as public evidence when:
|
|
300
|
-
|
|
301
|
-
- open-ended LLM reasoning decides whether to trade
|
|
302
|
-
- the strategy depends on live chat, memory, or search context
|
|
303
|
-
- the decision cannot be reconstructed at the original point in time
|
|
304
|
-
|
|
305
|
-
Typical outcome:
|
|
306
|
-
|
|
307
|
-
- `backtest_support: full` -> use `backtest.run()` and publish historical metrics
|
|
308
|
-
- `backtest_support: none` -> use paper or live evidence instead
|
|
309
|
-
|
|
310
|
-
## Spec Shape
|
|
311
|
-
|
|
312
|
-
The managed engine expects an explicit Nautilus replay spec from `backtest.yaml`,
|
|
313
|
-
usually read through `runtime.backtest_spec`.
|
|
314
|
-
|
|
315
|
-
Required sections:
|
|
316
|
-
|
|
317
|
-
- `venue`
|
|
318
|
-
- `name`
|
|
319
|
-
- `account_type`
|
|
320
|
-
- `oms_type`
|
|
321
|
-
- `starting_balances`
|
|
322
|
-
- `instrument` or `instruments`
|
|
323
|
-
- `id`
|
|
324
|
-
- `kind`
|
|
325
|
-
- `raw_symbol` or `symbol`
|
|
326
|
-
- `base_currency`
|
|
327
|
-
- `quote_currency`
|
|
328
|
-
- `price_precision`
|
|
329
|
-
- `size_precision`
|
|
330
|
-
- `price_increment`
|
|
331
|
-
- `size_increment`
|
|
332
|
-
- `bar_type`
|
|
333
|
-
- perpetual instruments also need `settlement_currency`
|
|
334
|
-
- `strategy`
|
|
335
|
-
- `module`
|
|
336
|
-
- `class`
|
|
337
|
-
- optional `config_class`
|
|
338
|
-
- optional `config`
|
|
339
|
-
- `execution`
|
|
340
|
-
- optional `start`
|
|
341
|
-
- optional `end`
|
|
283
|
+
```python
|
|
284
|
+
merged_metrics = dict(backtest_report) # report is BASE
|
|
285
|
+
for key, value in signal_metrics.items():
|
|
286
|
+
merged_metrics.setdefault(key, value) # signal only fills gaps
|
|
287
|
+
```
|
|
342
288
|
|
|
343
|
-
|
|
289
|
+
**`setdefault` does not override existing keys** — even if they are `null`.
|
|
344
290
|
|
|
345
|
-
|
|
291
|
+
`result.raw` from the engine has `result.update(summary)` applied, which
|
|
292
|
+
flattens `net_pnl`, `total_return_pct`, `starting_balance` etc. to the top
|
|
293
|
+
level. These engine-level values may be `null` or denominated by
|
|
294
|
+
`venue.starting_balances` (account basis) rather than `margin_budget` (strategy
|
|
295
|
+
basis).
|
|
346
296
|
|
|
347
|
-
|
|
348
|
-
2. `backtest.run()` normalizes each DataFrame into OHLCV bars
|
|
349
|
-
3. the engine builds Nautilus venue + instrument definitions from `backtest.yaml`
|
|
350
|
-
4. `BarDataWrangler` converts DataFrames into Nautilus bars
|
|
351
|
-
5. the author's `Strategy` subclass is imported from `src/**`
|
|
352
|
-
6. Nautilus `BacktestEngine` runs the replay
|
|
353
|
-
7. the platform normalizes summary metrics and preserves the deeper reports
|
|
297
|
+
**You must override these top-level keys before writing the JSON:**
|
|
354
298
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
- `bar_type`
|
|
360
|
-
- `instrument_ids`
|
|
361
|
-
- `bar_types`
|
|
299
|
+
```python
|
|
300
|
+
# Compute correct absolute USDT values
|
|
301
|
+
net_pnl = ending_total - initial_capital
|
|
302
|
+
strategy_return_pct = net_pnl / initial_capital * 100.0
|
|
362
303
|
|
|
363
|
-
|
|
304
|
+
# Override engine values so backend merge picks up correct numbers
|
|
305
|
+
raw["net_pnl"] = round(net_pnl, 4)
|
|
306
|
+
raw["total_return_pct"] = round(strategy_return_pct, 4)
|
|
307
|
+
raw["starting_balance"] = initial_capital
|
|
364
308
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
## BacktestResult
|
|
309
|
+
# Write files
|
|
310
|
+
(out_dir / "backtest_report.json").write_text(json.dumps(raw, default=str))
|
|
311
|
+
```
|
|
370
312
|
|
|
313
|
+
Without this, the platform's `_apply_strategy_basis_metrics` will compute
|
|
314
|
+
`total_return_pct = net_pnl / margin_budget * 100` using the engine's
|
|
315
|
+
potentially wrong `net_pnl`, producing incorrect display values.
|
|
371
316
|
|
|
372
|
-
|
|
373
|
-
| ------------------------- | ----- | ---------------------------- |
|
|
374
|
-
| `result.total_return_pct` | float | Account return % using the replay starting balance |
|
|
375
|
-
| `result.sharpe_ratio` | float | Sharpe ratio |
|
|
376
|
-
| `result.max_drawdown_pct` | float | Max drawdown % |
|
|
377
|
-
| `result.win_rate` | float | Win rate fraction (0.0-1.0) |
|
|
378
|
-
| `result.total_trades` | int | Total closed position count |
|
|
379
|
-
| `result.profit_factor` | float | Profit factor |
|
|
380
|
-
| `result.summary` | dict | Stable normalized account-level summary |
|
|
381
|
-
| `result.raw` | dict | Full Nautilus-derived output |
|
|
317
|
+
### Equity Curve CSV Format
|
|
382
318
|
|
|
319
|
+
```csv
|
|
320
|
+
timestamp,value,nav
|
|
321
|
+
2026-03-01T00:00:00,1000.0,1.0
|
|
322
|
+
2026-03-01T01:00:00,1002.5,1.0025
|
|
323
|
+
...
|
|
324
|
+
```
|
|
383
325
|
|
|
384
|
-
`
|
|
326
|
+
Do **not** embed the equity curve in `backtest_report.json` (`reports.equity_curve`).
|
|
327
|
+
The Runner reads `equity_curve.csv` independently and attaches it to the report
|
|
328
|
+
via `_attach_equity_curve_to_report`. Keeping the curve out of the JSON reduces
|
|
329
|
+
file size and prevents read failures for long backtest windows.
|
|
385
330
|
|
|
386
|
-
|
|
387
|
-
- `stats`
|
|
388
|
-
- `reports`
|
|
389
|
-
- `config`
|
|
331
|
+
### Correct Execution Order
|
|
390
332
|
|
|
391
|
-
|
|
333
|
+
```
|
|
334
|
+
1. Run backtest.run()
|
|
335
|
+
2. Build an equity curve from real replay/account values
|
|
336
|
+
3. Slice to the declared [start, end] window without fabricating points
|
|
337
|
+
4. Compute net_pnl from account report
|
|
338
|
+
5. Override raw top-level metrics
|
|
339
|
+
6. Write backtest_report.json (without equity curve)
|
|
340
|
+
7. Write equity_curve.csv
|
|
341
|
+
8. runtime.emit_signal() with correct metrics
|
|
342
|
+
```
|
|
392
343
|
|
|
393
|
-
|
|
344
|
+
### `csv` Module Is Blocked
|
|
394
345
|
|
|
395
|
-
|
|
346
|
+
The sandbox blocks the `csv` stdlib module. Write CSV manually:
|
|
396
347
|
|
|
397
348
|
```python
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
spec=runtime.backtest_spec,
|
|
404
|
-
)
|
|
349
|
+
csv_lines = ["timestamp,value,nav"]
|
|
350
|
+
for point in equity_curve:
|
|
351
|
+
csv_lines.append(f"{point.get('timestamp','')},{point.get('value','')},{point.get('nav','')}")
|
|
352
|
+
(out_dir / "equity_curve.csv").write_text("\n".join(csv_lines) + "\n", encoding="utf-8")
|
|
405
353
|
```
|
|
406
354
|
|
|
407
|
-
The engine does not synthesize cross-instrument logic for you. Multi-instrument
|
|
408
|
-
behavior belongs in the author's Nautilus strategy code.
|
|
409
|
-
|
|
410
|
-
## Zero-Trade Diagnostics
|
|
411
|
-
|
|
412
|
-
If `result.total_trades == 0`, common causes are:
|
|
413
|
-
|
|
414
|
-
1. bars were filtered out by `execution.start` / `execution.end`
|
|
415
|
-
2. the strategy never subscribed to the declared `bar_type`
|
|
416
|
-
3. instrument IDs in strategy config do not match the spec
|
|
417
|
-
4. order sizing is invalid for the declared increment / lot size
|
|
418
|
-
|
|
419
|
-
Inspect:
|
|
420
|
-
|
|
421
|
-
- `result.raw["config"]`
|
|
422
|
-
- `result.raw["reports"]["orders"]`
|
|
423
|
-
- `result.raw["reports"]["fills"]`
|
|
424
|
-
- `result.raw["reports"]["positions"]`
|
|
425
|
-
|
|
426
355
|
## Chart Generation
|
|
427
356
|
|
|
428
357
|
```python
|
|
@@ -357,15 +357,37 @@ Sections:
|
|
|
357
357
|
| `venue` | mapping | Venue name, account type, OMS type, and starting balances |
|
|
358
358
|
| `instrument` or `instruments` | mapping or list[mapping] | Explicit instrument definitions and `bar_type` declarations |
|
|
359
359
|
| `strategy` | mapping | Author strategy module/class entry plus config payload |
|
|
360
|
-
| `execution` | mapping |
|
|
360
|
+
| `execution` | mapping | Required bounded replay window with `start` and `end` |
|
|
361
361
|
| `data_requirements` | mapping | Optional replay data contract such as required enriched bar columns |
|
|
362
362
|
|
|
363
363
|
|
|
364
|
+
`execution.start` and `execution.end` are required for `backtest_support: full`.
|
|
365
|
+
Use ISO dates or datetimes and choose a window that the selected DataSDK endpoint
|
|
366
|
+
actually returns bars for. If the selected replay exceeds endpoint limits, fetch
|
|
367
|
+
history in batches or shorten the declared window. Unbounded backtests and
|
|
368
|
+
windows that produce no rows are rejected because public evidence must be
|
|
369
|
+
reproducible.
|
|
370
|
+
|
|
371
|
+
Symbols are part of the package contract. Keep `manifest.trading_symbols`,
|
|
372
|
+
`display_name`, `description`, README, `backtest.yaml` instrument symbols, data
|
|
373
|
+
calls, and emitted signal symbols aligned. If a user submits a typo such as
|
|
374
|
+
`TCUSDT` and you correct it to `BTCUSDT`, the package must be renamed and the
|
|
375
|
+
README/final summary must explicitly say the submitted symbol was corrected to
|
|
376
|
+
the supported symbol. Never publish a package whose title claims one symbol
|
|
377
|
+
while its backtest uses another.
|
|
378
|
+
|
|
379
|
+
Do not put `provider` anywhere in `backtest.yaml`. The managed runtime chooses
|
|
380
|
+
the DataSDK provider for the deployment; package authors declare symbols,
|
|
381
|
+
venues, intervals, instruments, and feature requirements only.
|
|
382
|
+
|
|
364
383
|
Optional `data_requirements.required_bar_fields` lets a deterministic strategy
|
|
365
384
|
declare extra normalized bar columns it expects in addition to core OHLCV.
|
|
366
385
|
These names should use lower snake case to match the replay engine's normalized
|
|
367
386
|
DataFrame columns, for example `quote_volume`, `trade_count`, or
|
|
368
|
-
`taker_buy_volume`.
|
|
387
|
+
`taker_buy_volume`. Every field listed here must also appear in `src/**` code
|
|
388
|
+
and be created by `getagent.backtest.build_feature_frame(...)` or equivalent
|
|
389
|
+
before calling `backtest.run(...)`; otherwise validation rejects the package as a
|
|
390
|
+
custom bar fields mismatch.
|
|
369
391
|
|
|
370
392
|
Every backtest instrument must declare explicit `maker_fee` and `taker_fee`.
|
|
371
393
|
Do not rely on zero-fee defaults. High-frequency Playbooks can look profitable
|
|
@@ -376,12 +398,12 @@ contract assumption.
|
|
|
376
398
|
|
|
377
399
|
Data coverage is part of the package contract. If a strategy requires enriched
|
|
378
400
|
columns such as `quote_volume`, `taker_buy_ratio`, open interest, funding, or
|
|
379
|
-
liquidation data, author code must prove that the selected DataSDK
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
the run with a clear error.
|
|
401
|
+
liquidation data, author code must prove that the selected DataSDK endpoint,
|
|
402
|
+
symbol, and interval returns enough rows for the claimed replay window and the
|
|
403
|
+
exact fields used by the strategy. Do not pass `provider=...` to `getagent.data`
|
|
404
|
+
calls. Do not silently fill a missing decision feature with constants such as
|
|
405
|
+
`0`, `0.5`, or `False` and still claim a valid backtest. If a feature is
|
|
406
|
+
degraded, expose that in metrics/meta or fail the run with a clear error.
|
|
385
407
|
|
|
386
408
|
Large multi-symbol backtests must batch data fetches instead of issuing one
|
|
387
409
|
tight loop over every symbol and endpoint. If a Playbook scans many symbols
|
|
@@ -75,7 +75,7 @@ Parameters:
|
|
|
75
75
|
- `venue`
|
|
76
76
|
- `instrument` or `instruments`
|
|
77
77
|
- `strategy`
|
|
78
|
-
-
|
|
78
|
+
- required `execution.start` and `execution.end`
|
|
79
79
|
- optional `data_requirements.required_bar_fields`
|
|
80
80
|
|
|
81
81
|
### Generate a chart
|
|
@@ -98,6 +98,8 @@ Behavior:
|
|
|
98
98
|
- `win_rate`
|
|
99
99
|
- `profit_factor`
|
|
100
100
|
- `total_trades`
|
|
101
|
+
- `fill_count`
|
|
102
|
+
- `position_count`
|
|
101
103
|
- `summary`
|
|
102
104
|
- `raw`
|
|
103
105
|
|
|
@@ -178,8 +180,18 @@ runtime.emit_signal(
|
|
|
178
180
|
|
|
179
181
|
- Use `runtime.backtest_spec` as the default source of replay configuration
|
|
180
182
|
- Keep public backtest claims tied to deterministic strategy logic
|
|
183
|
+
- Do not pass `provider=...` to `getagent.data` calls; the managed DataSDK
|
|
184
|
+
provider is selected by the platform
|
|
185
|
+
- Declare a bounded `backtest.yaml.execution.start` / `execution.end` window,
|
|
186
|
+
and verify the selected endpoint returns bars inside that window
|
|
187
|
+
- Keep `manifest.trading_symbols`, display text, README, `backtest.yaml`
|
|
188
|
+
instruments, data calls, and emitted signal symbols aligned. If you correct a
|
|
189
|
+
typo or replace an unavailable symbol, rename the package/title and explain
|
|
190
|
+
the correction.
|
|
181
191
|
- Declare enriched replay column dependencies in
|
|
182
192
|
`backtest.yaml -> data_requirements.required_bar_fields`
|
|
193
|
+
- Every required replay field must be created and referenced in `src/**`; remove
|
|
194
|
+
the declaration if the strategy no longer reads that feature
|
|
183
195
|
- Use `prepare_frame()` / `build_feature_frame()` to standardize multi-endpoint
|
|
184
196
|
replay assembly instead of open-coded timestamp joins
|
|
185
197
|
- Expect `backtest.run()` to fail fast when declared replay columns are missing
|
|
@@ -194,7 +206,8 @@ runtime.emit_signal(
|
|
|
194
206
|
- Strategy classes may import `nautilus_trader`; Playbook code must not import
|
|
195
207
|
legacy backtest engines directly
|
|
196
208
|
- Do not use `backtest.run()` as fake evidence for `llm_bounded` strategies
|
|
197
|
-
- Treat `result.total_trades == 0` as
|
|
209
|
+
- Treat `result.total_trades == 0` as an honest no-trade outcome for the
|
|
210
|
+
selected window; do not loosen strategy thresholds just to force trades
|
|
198
211
|
- Prefer `generate_chart(result)` over writing ad hoc chart files yourself
|
|
199
212
|
- Do not emit `metrics=result.summary` directly for user-visible backtest
|
|
200
213
|
results when the strategy has a configured budget. Convert `net_pnl` to
|
|
@@ -12,7 +12,7 @@ are callable through the DataSDK wrapper.
|
|
|
12
12
|
### `arxiv.search`
|
|
13
13
|
|
|
14
14
|
```python
|
|
15
|
-
data.arxiv.search(query=None, max_results=10, page=1, sort_by='relevance', sort_order='descending', search_field='all', category=None
|
|
15
|
+
data.arxiv.search(query=None, max_results=10, page=1, sort_by='relevance', sort_order='descending', search_field='all', category=None)
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Summary: Search
|
|
@@ -22,7 +22,6 @@ Summary: Search
|
|
|
22
22
|
| Endpoint ID | `arxiv.search` |
|
|
23
23
|
| HTTP | `GET` |
|
|
24
24
|
| Path | `/inner/v1/agent-data/arxiv/search` |
|
|
25
|
-
| Default provider | `arxiv` |
|
|
26
25
|
| SDK | `supported` |
|
|
27
26
|
| Host | `supported` |
|
|
28
27
|
| Notes | - |
|
|
@@ -31,11 +30,10 @@ Summary: Search
|
|
|
31
30
|
|
|
32
31
|
| Param | Required | Type | Default | Notes |
|
|
33
32
|
|---|---|---|---|---|
|
|
34
|
-
| `query` | `no` | `string | null` | `-` | Search query string.
|
|
35
|
-
| `max_results` | `no` | `integer` | `10` | Maximum number of results.
|
|
36
|
-
| `page` | `no` | `integer` | `1` | Page number, starting at 1.
|
|
37
|
-
| `sort_by` | `no` | `string` | `relevance` | Sort by relevance, last updated date, or submitted date.
|
|
38
|
-
| `sort_order` | `no` | `string` | `descending` | Sort direction.
|
|
39
|
-
| `search_field` | `no` | `string` | `all` | Field to search: all, ti (title), au (author), abs (abstract), cat (category).
|
|
40
|
-
| `category` | `no` | `string | null` | `-` | Filter by arXiv subject category, e.g. 'cs.AI', 'q-fin.TR'.
|
|
41
|
-
| `provider` | `no` | `string` | `arxiv` | - |
|
|
33
|
+
| `query` | `no` | `string | null` | `-` | Search query string. |
|
|
34
|
+
| `max_results` | `no` | `integer` | `10` | Maximum number of results. |
|
|
35
|
+
| `page` | `no` | `integer` | `1` | Page number, starting at 1. |
|
|
36
|
+
| `sort_by` | `no` | `string` | `relevance` | Sort by relevance, last updated date, or submitted date. |
|
|
37
|
+
| `sort_order` | `no` | `string` | `descending` | Sort direction. |
|
|
38
|
+
| `search_field` | `no` | `string` | `all` | Field to search: all, ti (title), au (author), abs (abstract), cat (category). |
|
|
39
|
+
| `category` | `no` | `string | null` | `-` | Filter by arXiv subject category, e.g. 'cs.AI', 'q-fin.TR'. |
|
|
@@ -10,7 +10,7 @@ Playbook creator source tree.
|
|
|
10
10
|
1. Start with [`playbook-supported.md`](playbook-supported.md) for the full
|
|
11
11
|
Playbook-callable `getagent.data` surface.
|
|
12
12
|
2. Use the domain files below for exact signatures, defaults, enums,
|
|
13
|
-
|
|
13
|
+
and parameter details.
|
|
14
14
|
|
|
15
15
|
## Domain index
|
|
16
16
|
|
|
@@ -45,9 +45,6 @@ Playbook creator source tree.
|
|
|
45
45
|
separate sandbox allowlist.
|
|
46
46
|
- For backtests, verify the endpoint returns the fields and time axis your
|
|
47
47
|
strategy needs before declaring those fields in `backtest.yaml`.
|
|
48
|
-
- `provider` may be shown with a default even when the upstream OpenAPI
|
|
49
|
-
marks it as required. That reflects the managed `getagent.data` wrapper,
|
|
50
|
-
which auto-injects the default provider when one is defined.
|
|
51
48
|
- Time ranges use millisecond Unix-epoch `start_time` / `end_time` and the
|
|
52
49
|
canonical datetime column is `time`. The SDK still accepts the legacy
|
|
53
50
|
`start_date` / `end_date` parameters (and exposes a derived `date` field)
|