@alphafox/cli 0.3.6 → 0.3.8
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/auth/refresh.d.ts +3 -0
- package/dist/auth/refresh.js +98 -12
- package/dist/catalog/omit.d.ts +3 -1
- package/dist/catalog/omit.js +9 -2
- package/dist/commands/run.js +31 -3
- package/dist/resolve-symbols/catalog.d.ts +6 -0
- package/dist/resolve-symbols/catalog.js +43 -0
- package/dist/resolve-symbols/exchanges.js +7 -4
- package/dist/resolve-symbols/match.d.ts +4 -3
- package/dist/resolve-symbols/match.js +50 -48
- package/dist/resolve-symbols/parse-args.d.ts +1 -0
- package/dist/resolve-symbols/parse-args.js +20 -3
- package/dist/resolve-symbols/run-command.js +19 -6
- package/dist/resolve-symbols/types.d.ts +14 -0
- package/dist/skills-manifest.json +42 -42
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/account/SKILL.md +1 -1
- package/skills/admin/SKILL.md +1 -1
- package/skills/alphafox/SKILL.md +11 -9
- package/skills/alphafox-shared/SKILL.md +5 -4
- package/skills/auth/SKILL.md +8 -5
- package/skills/engine-backtest/SKILL.md +5 -5
- package/skills/exchange/SKILL.md +1 -1
- package/skills/market/SKILL.md +32 -12
- package/skills/notification/SKILL.md +1 -1
- package/skills/strategy/SKILL.md +17 -15
- package/skills/trading/SKILL.md +37 -7
package/skills/trading/SKILL.md
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-trading
|
|
3
|
-
description:
|
|
4
|
-
version: 0.3.
|
|
3
|
+
description: Running strategies (traders) — create, list, start, and stop. A trader is a live or paper strategy instance (grid, dca, copy, …), not a person.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Running strategies (traders)
|
|
8
8
|
|
|
9
|
-
Always `--format json --no-input`. Read first.
|
|
9
|
+
Always `--format json --no-input`. Read first. Creates and updates need `trading:write`; start/stop also `trading:high-risk`.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A **trader** is a running strategy instance (paper or live). Creating a strategy means creating a trader. Bind it to a **strategy definition**, an exchange connector, and runtime settings.
|
|
12
|
+
|
|
13
|
+
Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skills/market`) before they are written into trader config. 美股 stay `equity_perp` contracts such as `NVDA/USDT:USDT`.
|
|
14
|
+
|
|
15
|
+
Pick the create operation from the definition the operator asked for:
|
|
16
|
+
|
|
17
|
+
| Kind | Create |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Engine definitions (grid, dca, …) | `trading.traders.create` |
|
|
20
|
+
| Hyperliquid copy | `trading.hl_copy_traders.create` |
|
|
21
|
+
| Rebate copy | `trading.rebate_copy_traders.create` |
|
|
22
|
+
|
|
23
|
+
Copy leads come from `trading.signal_sources.list` when the operator named one. Same trader lifecycle (list / start / stop) after create.
|
|
12
24
|
|
|
13
25
|
## Read
|
|
14
26
|
|
|
@@ -16,9 +28,23 @@ Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skill
|
|
|
16
28
|
alphafox api GET /api/v1/trading/traders --format json --no-input
|
|
17
29
|
```
|
|
18
30
|
|
|
19
|
-
##
|
|
31
|
+
## Create
|
|
32
|
+
|
|
33
|
+
Read `alphafox schema <operationId>` first. Body may only include documented `request.body` fields. Large / nested bodies use `--config @file`.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
alphafox schema trading.traders.create --format json --no-input
|
|
37
|
+
alphafox trading traders create --config @./create-trader.json --dry-run --format json --no-input
|
|
38
|
+
alphafox trading traders create --config @./create-trader.json --yes --format json --no-input
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`trading.traders.create` is `high-risk-write` and needs `--yes`. Copy creates follow whatever `risk` the schema reports — `--dry-run` first, then `--yes` when required.
|
|
42
|
+
|
|
43
|
+
If a required field is missing, re-read the schema and ask the operator. Do not invent ids. The CLI has no authoring-session surface; instantiate from a definition, connector, and config.
|
|
44
|
+
|
|
45
|
+
## High-risk start / stop
|
|
20
46
|
|
|
21
|
-
Read `alphafox schema trading.traders.byId.start` first. Body may only include documented fields (`reason` is optional).
|
|
47
|
+
Read `alphafox schema trading.traders.byId.start` first. Body may only include documented fields (`reason` is optional).
|
|
22
48
|
|
|
23
49
|
```bash
|
|
24
50
|
alphafox schema trading.traders.byId.start --format json --no-input
|
|
@@ -39,5 +65,9 @@ Stop: `POST /api/v1/trading/traders/{traderId}/stop` with the same `--dry-run` t
|
|
|
39
65
|
## operationIds
|
|
40
66
|
|
|
41
67
|
- `trading.traders.list`
|
|
68
|
+
- `trading.traders.create`
|
|
69
|
+
- `trading.hl_copy_traders.create`
|
|
70
|
+
- `trading.rebate_copy_traders.create`
|
|
71
|
+
- `trading.signal_sources.list`
|
|
42
72
|
- `trading.traders.byId.start`
|
|
43
73
|
- `trading.traders.byId.stop`
|