@quantbrasil/cli 0.1.0-beta.10 → 0.1.0-beta.12
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 +2 -0
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -2
- package/dist/commands/cointegration.d.ts +52 -0
- package/dist/commands/cointegration.d.ts.map +1 -0
- package/dist/commands/cointegration.js +118 -0
- package/dist/commands/rankings.d.ts +65 -0
- package/dist/commands/rankings.d.ts.map +1 -1
- package/dist/commands/rankings.js +149 -0
- package/dist/vendor/core/capabilities/cointegration.d.ts +52 -0
- package/dist/vendor/core/capabilities/cointegration.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/cointegration.js +63 -0
- package/dist/vendor/core/capabilities/index.d.ts +1 -0
- package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/index.js +1 -0
- package/dist/vendor/core/capabilities/rankings.d.ts +94 -2
- package/dist/vendor/core/capabilities/rankings.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/rankings.js +118 -1
- package/dist/vendor/core/capabilities/registry.d.ts +282 -4
- package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/registry.js +2 -0
- package/dist/vendor/core/capabilities/types.d.ts +1 -1
- package/dist/vendor/core/capabilities/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/quantbrasil/SKILL.md +10 -7
- package/skills/quantbrasil/references/cli.md +28 -6
- package/skills/quantbrasil/references/cointegration.md +40 -0
- package/skills/quantbrasil/references/costs.md +4 -1
- package/skills/quantbrasil/references/quality-eval-queries.json +20 -0
- package/skills/quantbrasil/references/rankings.md +31 -3
- package/skills/quantbrasil/references/unsupported.md +2 -0
- package/skills/quantbrasil/references/workflows.md +30 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Rankings
|
|
2
2
|
|
|
3
3
|
Use rankings for order-first questions: Magic Formula, momentum leaders,
|
|
4
|
-
dividend-yield leaders, Momentum Double, or saved user rankings. A
|
|
5
|
-
returns an ordered asset list plus the metric used to order it.
|
|
4
|
+
dividend-yield leaders, Low Risk, Momentum Double, or saved user rankings. A
|
|
5
|
+
ranking returns an ordered asset list plus the metric used to order it.
|
|
6
|
+
Use ranking return when the question asks how a ranking-based strategy performed
|
|
7
|
+
over a historical period with rebalancing.
|
|
6
8
|
|
|
7
9
|
## Discovery
|
|
8
10
|
|
|
@@ -25,6 +27,7 @@ System ranking:
|
|
|
25
27
|
```bash
|
|
26
28
|
quantbrasil rankings current --system momentum-90d --top 20
|
|
27
29
|
quantbrasil rankings current --system magic-formula --top 10
|
|
30
|
+
quantbrasil rankings current --system low-risk --top 30
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
User ranking:
|
|
@@ -36,18 +39,43 @@ quantbrasil rankings current --id 123 --top 20
|
|
|
36
39
|
Rules:
|
|
37
40
|
|
|
38
41
|
- use exactly one selector: `--system` for system rankings or `--id` for user rankings
|
|
39
|
-
- system rankings use slugs such as `momentum-90d` or `
|
|
42
|
+
- system rankings use slugs such as `momentum-90d`, `magic-formula`, or `low-risk`
|
|
40
43
|
- user rankings use the numeric id shown under "Meus rankings"
|
|
41
44
|
- `--top` is the number of ranked assets to return
|
|
42
45
|
- use `--json` when another step needs to parse tickers, rank, score, or metric values
|
|
43
46
|
- do not use `factor:<id>` in command syntax; ranking fatorial is a saved user ranking and uses `--id <id>`
|
|
44
47
|
|
|
48
|
+
## Ranking return
|
|
49
|
+
|
|
50
|
+
Use this when the user asks how much a ranking strategy returned over time,
|
|
51
|
+
such as Magic Formula top 20 rebalanced quarterly.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
quantbrasil rankings return --system magic-formula --from 2024-01-18 --to 2026-05-25 --top 20 --rebalance quarterly
|
|
55
|
+
quantbrasil rankings return --system momentum-90d --from 2024-01-01 --to 2026-01-01 --top 10 --rebalance monthly
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Rules:
|
|
59
|
+
|
|
60
|
+
- use `rankings list` first when the system slug or return support is unclear
|
|
61
|
+
- `return` accepts `--system` only
|
|
62
|
+
- `--from` and `--to` are required explicit ISO dates
|
|
63
|
+
- do not use `--id`; saved user rankings do not support historical return in the public CLI
|
|
64
|
+
- do not use `--period`; ranking return requires explicit dates
|
|
65
|
+
- supported rebalance values are `weekly`, `monthly`, `bimonthly`, `quarterly`, `semiannually`, and `annually`
|
|
66
|
+
- supported weighting is `equal`
|
|
67
|
+
- `--index-filter` accepts `NONE`, `IBOV`, `IBX100`, or `SMLL`
|
|
68
|
+
- system rankings with return support currently include Magic Formula, Dividend Yield, Momentum, and Momentum Double
|
|
69
|
+
- Low Risk can be queried with `rankings current`, but does not support `rankings return`
|
|
70
|
+
- use `--json` when another step needs rebalance portfolios or period-level returns
|
|
71
|
+
|
|
45
72
|
## Ranking vs screening
|
|
46
73
|
|
|
47
74
|
Use rankings when the user starts from an ordered list:
|
|
48
75
|
|
|
49
76
|
- "top 20 do momentum"
|
|
50
77
|
- "top 10 Magic Formula"
|
|
78
|
+
- "top 30 Low Risk"
|
|
51
79
|
- "meu ranking de qualidade"
|
|
52
80
|
- "ativos com maior dividend yield"
|
|
53
81
|
|
|
@@ -6,6 +6,7 @@ Unsupported in the public CLI:
|
|
|
6
6
|
- deleting watchlists or holdings
|
|
7
7
|
- value-based position input for traded assets
|
|
8
8
|
- ad-hoc ticker-list screening
|
|
9
|
+
- scanning all cointegrated pairs in a universe
|
|
9
10
|
|
|
10
11
|
Not a supported pattern:
|
|
11
12
|
|
|
@@ -20,6 +21,7 @@ Use the public surface only:
|
|
|
20
21
|
- `capabilities`
|
|
21
22
|
- `market`
|
|
22
23
|
- `assets`
|
|
24
|
+
- `cointegration`
|
|
23
25
|
- `screening`
|
|
24
26
|
- `watchlists`
|
|
25
27
|
- `holdings`
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
- asset price, quote, or daily move → `market price`
|
|
6
6
|
- supported assets, tickers, or market universe → `market assets`
|
|
7
7
|
- asset performance, technicals, risk, fundamentals, or ranking → `assets overview`
|
|
8
|
-
- current ordered asset lists such as Magic Formula, momentum, or user rankings → `rankings list`, then `rankings current`
|
|
8
|
+
- current ordered asset lists such as Magic Formula, momentum, Low Risk, or user rankings → `rankings list`, then `rankings current`
|
|
9
|
+
- historical return of ranking strategies such as Magic Formula or Momentum → `rankings list`, then `rankings return`
|
|
9
10
|
- watchlist details or changes → `watchlists ...`
|
|
10
11
|
- holding details or changes → `holdings ...`
|
|
11
12
|
- holding return, beta, risk, VaR, or comparison → `holdings historical-return|beta|var`
|
|
12
13
|
- indicator screening over saved asset sets → `screening universes`, `screening indicators` when needed, then `screening run`
|
|
14
|
+
- cointegration or Long & Short between two explicit assets → `cointegration pair`
|
|
13
15
|
|
|
14
16
|
## Find supported ticker, then get price
|
|
15
17
|
|
|
@@ -66,14 +68,16 @@ Avoid asking for every section unless user clearly wants full report.
|
|
|
66
68
|
## Get current ranked assets
|
|
67
69
|
|
|
68
70
|
Use this when the user asks for an ordered list such as top Magic Formula,
|
|
69
|
-
momentum leaders, dividend-yield leaders, Momentum Double, or a saved
|
|
70
|
-
ranking.
|
|
71
|
+
momentum leaders, dividend-yield leaders, Low Risk, Momentum Double, or a saved
|
|
72
|
+
user ranking.
|
|
71
73
|
|
|
72
74
|
```bash
|
|
73
75
|
quantbrasil rankings list
|
|
74
76
|
quantbrasil rankings current --system momentum-90d --top 20
|
|
75
77
|
quantbrasil rankings current --system magic-formula --top 10
|
|
78
|
+
quantbrasil rankings current --system low-risk --top 30
|
|
76
79
|
quantbrasil rankings current --id 123 --top 20
|
|
80
|
+
quantbrasil rankings return --system magic-formula --from 2024-01-18 --to 2026-05-25 --top 20 --rebalance quarterly
|
|
77
81
|
```
|
|
78
82
|
|
|
79
83
|
Rules:
|
|
@@ -83,6 +87,9 @@ Rules:
|
|
|
83
87
|
- user rankings use their numeric id from `rankings list`
|
|
84
88
|
- use exactly one selector: `--system <slug>` or `--id <id>`
|
|
85
89
|
- do not call user rankings "factor:" in command syntax; ranking fatorial is a saved user ranking
|
|
90
|
+
- use `rankings return` for supported system rankings when the user asks historical return with rebalancing
|
|
91
|
+
- `rankings return` requires explicit `--from` and `--to` dates and does not accept user ranking ids
|
|
92
|
+
- Low Risk supports current ranking lookup, but not return simulation
|
|
86
93
|
- use `--json` if another step needs to parse tickers, ranks, or ordering metrics
|
|
87
94
|
- do not route ranking-first questions through screening unless the user asks for indicator conditions
|
|
88
95
|
|
|
@@ -123,6 +130,26 @@ Rules:
|
|
|
123
130
|
- load `references/screening.md` for IFR/RSI examples and full JSON payloads
|
|
124
131
|
- use `--json` when the result will be parsed by an agent or script
|
|
125
132
|
|
|
133
|
+
## Run pair cointegration / Long & Short
|
|
134
|
+
|
|
135
|
+
Use this when the user asks to run cointegração, cointegration, Long & Short,
|
|
136
|
+
long and short, long-short, pair trading statistics, z-score, p-value, or
|
|
137
|
+
half-life for two explicit assets.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
quantbrasil cointegration pair PETR4 VALE3
|
|
141
|
+
quantbrasil cointegration pair PETR4 VALE3 --window 120
|
|
142
|
+
quantbrasil cointegration pair PETR4 VALE3 --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Rules:
|
|
146
|
+
|
|
147
|
+
- require two explicit tickers
|
|
148
|
+
- frame Long & Short phrasing as pair analysis, not order execution or a guaranteed trade recommendation
|
|
149
|
+
- use `market assets --search` first only if a ticker is ambiguous
|
|
150
|
+
- do not invent a universe scan command for "quais pares cointegrados"; the public CLI currently supports explicit pairs
|
|
151
|
+
- use `--json` if the z-score or beta series will feed another calculation
|
|
152
|
+
|
|
126
153
|
## Analyze a theoretical composition
|
|
127
154
|
|
|
128
155
|
Create a holding with target weights, then run holding metrics on its id.
|