@alphafox/cli 0.3.5 → 0.3.7
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/README.md +3 -0
- package/dist/catalog/omit.d.ts +3 -1
- package/dist/catalog/omit.js +9 -2
- package/dist/commands/run.js +10 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- 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 +41 -41
- package/dist/update/notify.d.ts +24 -0
- package/dist/update/notify.js +109 -0
- 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 +32 -8
- package/skills/alphafox-shared/SKILL.md +12 -4
- package/skills/auth/SKILL.md +1 -1
- 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/strategy/SKILL.md
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alphafox-strategy
|
|
3
|
-
description: Strategy definitions and
|
|
4
|
-
version: 0.3.
|
|
3
|
+
description: Strategy definitions — list types (grid, dca, copy, …) and validate config. Creating a running strategy is creating a trader; use alphafox-trading for that.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Strategy
|
|
7
|
+
# Strategy definitions
|
|
8
8
|
|
|
9
|
-
Always `--format json --no-input`. Read scopes `trading:read`;
|
|
9
|
+
Always `--format json --no-input`. Read scopes `trading:read`; validate is `trading:write`.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A **definition** is a strategy type (grid, dca, copy, …). A **trader** is one running instance of a definition. Instantiating a definition is `alphafox-trading`, not this skill.
|
|
12
|
+
|
|
13
|
+
Whenever the human names a ticker (US stock, coin, or contract), resolve it with `alphafox resolve-symbols` (`skills/market`) before writing symbols into a config you later validate or hand to create. 美股 are equity perps in `binance_perp_usdt` (`NVDA/USDT:USDT`, `assetClass=equity_perp`) — do not swap them for a crypto coin.
|
|
12
14
|
|
|
13
15
|
## Read
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
alphafox schema trading.strategy_definitions.list --format json --no-input
|
|
17
19
|
alphafox api GET /api/v1/trading/strategy-definitions --format json --no-input
|
|
20
|
+
alphafox trading strategy_definitions byId get --definitionId <id> --format json --no-input
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
Use the list to pick the definition the operator named. Copy / rebate-copy / DCA / grid are rows in this catalog, not a separate product.
|
|
24
|
+
|
|
25
|
+
## Validate config
|
|
21
26
|
|
|
22
|
-
Read `request.body` first. Do not invent
|
|
27
|
+
Read `request.body` first. Do not invent definition or config fields.
|
|
23
28
|
|
|
24
29
|
```bash
|
|
25
|
-
alphafox schema
|
|
26
|
-
alphafox
|
|
27
|
-
# large / nested bodies:
|
|
28
|
-
# alphafox chats create --config @./create-chat.json --format json --no-input
|
|
30
|
+
alphafox schema trading.strategy_definitions.byId.validate_config --format json --no-input
|
|
31
|
+
alphafox trading strategy_definitions byId validate_config --definitionId <id> --config @./strategy-config.json --format json --no-input
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Engine strategy backtest (WASM tape + persist) is `skills/engine-backtest` (`alphafox engine-backtest run`). Chat-attached `/api/v1/backtests` (`backtests.*`) is not a CLI surface — do not call it.
|
|
34
|
+
After the config validates, create the running instance with `alphafox-trading`.
|
|
34
35
|
|
|
35
36
|
## operationIds
|
|
36
37
|
|
|
37
38
|
- `trading.strategy_definitions.list`
|
|
38
|
-
- `
|
|
39
|
+
- `trading.strategy_definitions.byId.get`
|
|
40
|
+
- `trading.strategy_definitions.byId.validate_config`
|
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.7
|
|
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`
|