@quantbrasil/cli 0.1.0-beta.6 → 0.1.0-beta.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.
Files changed (40) hide show
  1. package/README.md +41 -0
  2. package/dist/cli/index.d.ts +6 -0
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +20 -1
  5. package/dist/cli/prompt.d.ts +1 -0
  6. package/dist/cli/prompt.d.ts.map +1 -1
  7. package/dist/cli/prompt.js +17 -0
  8. package/dist/cli/skills.d.ts +9 -0
  9. package/dist/cli/skills.d.ts.map +1 -1
  10. package/dist/cli/skills.js +68 -4
  11. package/dist/commands/screening.d.ts +120 -0
  12. package/dist/commands/screening.d.ts.map +1 -0
  13. package/dist/commands/screening.js +361 -0
  14. package/dist/commands/skills.js +7 -7
  15. package/dist/commands/update.d.ts +23 -0
  16. package/dist/commands/update.d.ts.map +1 -0
  17. package/dist/commands/update.js +209 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -0
  21. package/dist/vendor/core/capabilities/index.d.ts +1 -0
  22. package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
  23. package/dist/vendor/core/capabilities/index.js +1 -0
  24. package/dist/vendor/core/capabilities/registry.d.ts +266 -0
  25. package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
  26. package/dist/vendor/core/capabilities/registry.js +2 -0
  27. package/dist/vendor/core/capabilities/screening.d.ts +136 -0
  28. package/dist/vendor/core/capabilities/screening.d.ts.map +1 -0
  29. package/dist/vendor/core/capabilities/screening.js +155 -0
  30. package/dist/vendor/core/capabilities/types.d.ts +1 -1
  31. package/dist/vendor/core/capabilities/types.d.ts.map +1 -1
  32. package/package.json +3 -3
  33. package/skills/quantbrasil/SKILL.md +16 -11
  34. package/skills/quantbrasil/references/cli.md +53 -0
  35. package/skills/quantbrasil/references/costs.md +6 -1
  36. package/skills/quantbrasil/references/portfolios.md +13 -2
  37. package/skills/quantbrasil/references/quality-eval-queries.json +127 -0
  38. package/skills/quantbrasil/references/screening.md +212 -0
  39. package/skills/quantbrasil/references/unsupported.md +2 -0
  40. package/skills/quantbrasil/references/workflows.md +24 -0
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  name: quantbrasil
3
- description: Go-to QuantBrasil market and investing skill. Use for supported asset lookup, prices, asset analysis, watchlists, holdings, and risk/return metrics through the QuantBrasil CLI.
3
+ description: Use this skill when a user asks for QuantBrasil-supported market or investing data/actions through the QuantBrasil CLI, including asset lookup, prices, asset analysis, watchlists, holdings, screening, historical return, beta, and VaR, even if they do not explicitly mention QuantBrasil.
4
4
  ---
5
5
 
6
6
  # QuantBrasil CLI
7
7
 
8
- Use this skill when the user asks for market or investing data/actions that QuantBrasil supports, including asset lookup, prices, asset analysis, watchlists, holdings, and holding metrics.
8
+ Use this skill when the user asks for market or investing data/actions that QuantBrasil supports, including asset lookup, prices, asset analysis, watchlists, holdings, screening, and holding metrics.
9
9
 
10
10
  ## Routing
11
11
 
12
12
  - Use this skill even when the user does not say "QuantBrasil" if the request fits the supported market or investing surface.
13
- - For QuantBrasil-supported market, asset, watchlist, holding, or holding metric data, use the CLI before generic web or finance search.
14
- - When the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, or saved compositions, load [`references/portfolios.md`](./references/portfolios.md) before choosing commands.
13
+ - Most end-user QuantBrasil requests are expected in pt-BR; Portuguese prompts about ativos, carteiras, cotações, screening, retorno, beta, VaR, watchlists, or Ibovespa should trigger this skill when they map to the supported CLI surface.
14
+ - For QuantBrasil-supported market, asset, screening, watchlist, holding, or holding metric data, use the CLI before generic web or finance search.
15
+ - When the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, screening universes, or saved compositions, load [`references/portfolios.md`](./references/portfolios.md) before choosing commands.
16
+ - When the request mentions IFR/RSI filters, sobrevendido, sobrecomprado, indicator screening, technical screening rules, or screening indicators, load [`references/screening.md`](./references/screening.md) before building the request JSON.
15
17
  - Use `quantbrasil` when available on PATH.
16
18
  - If `quantbrasil` is not found, report that the CLI binary is not on PATH and ask the user to install it or fix PATH.
17
19
  - Check readiness first: `quantbrasil --status`
@@ -23,16 +25,19 @@ Use this skill when the user asks for market or investing data/actions that Quan
23
25
  - richer asset analysis: `quantbrasil assets overview <ticker> --sections ...`
24
26
  - watchlist details and changes: `quantbrasil watchlists ...`
25
27
  - holding details and historical return: `quantbrasil holdings ...`
28
+ - indicator screening over saved universes: `quantbrasil screening universes|indicators|run ...`
26
29
  - holding metrics: `quantbrasil holdings historical-return|beta|var ...`
27
30
  - Use `--json` when output will be parsed by agent or script
28
31
  - Use generic web or finance search only if the CLI is unavailable, the requested data is outside the QuantBrasil-supported surface, or the user explicitly asks for an external source.
29
32
  - Do not inspect the local repo, package source, or `~/.config/quantbrasil/config.json` for normal data queries. Use CLI status/errors instead.
30
33
 
31
- ## References
34
+ ## Reference Loading
32
35
 
33
- - Portfolio, watchlist, and holding semantics: [`references/portfolios.md`](./references/portfolios.md)
34
- - CLI surface: [`references/cli.md`](./references/cli.md)
35
- - Common workflows: [`references/workflows.md`](./references/workflows.md)
36
- - Cost-aware behavior: [`references/costs.md`](./references/costs.md)
37
- - Failure handling: [`references/errors.md`](./references/errors.md)
38
- - Unsupported / not-yet-public operations: [`references/unsupported.md`](./references/unsupported.md)
36
+ - Load [`references/workflows.md`](./references/workflows.md) when the user describes an investing task but does not name an exact command, or when a task spans discovery plus a follow-up action.
37
+ - Load [`references/cli.md`](./references/cli.md) when you need exact command syntax, flags, examples, or supported `--sections` values.
38
+ - Load [`references/portfolios.md`](./references/portfolios.md) when the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, screening universes, or saved compositions.
39
+ - Load [`references/screening.md`](./references/screening.md) when the user asks for IFR/RSI filters, sobrevendido/sobrecomprado assets, indicator screening, technical filter JSON, screening indicators, or examples of `ScreenerRequest`.
40
+ - Load [`references/costs.md`](./references/costs.md) before chaining heavy reads, choosing between overview/screening/holding metrics, or answering cost-sensitive agent workflow questions.
41
+ - Load [`references/errors.md`](./references/errors.md) when a CLI command fails, auth/config is unclear, or the user asks how to fix a QuantBrasil CLI error.
42
+ - Load [`references/unsupported.md`](./references/unsupported.md) when the user asks for deletion, file export, ad-hoc ticker-list screening, unsupported commands, or a capability that may not be public yet.
43
+ - Use [`references/quality-eval-queries.json`](./references/quality-eval-queries.json) only when evaluating or tuning skill quality and trigger accuracy.
@@ -77,3 +77,56 @@ quantbrasil holdings var 182 --years 1 --confidence 95
77
77
  ```
78
78
 
79
79
  Use `--json` on any holding metric command when machine parsing needed.
80
+
81
+ ## Screening
82
+
83
+ ```bash
84
+ quantbrasil screening universes
85
+ quantbrasil screening indicators
86
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json
87
+ quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25
88
+ quantbrasil screening run --holding 182 --query-file ./screening.json --sort ticker
89
+ cat ./screening.json | quantbrasil screening run --system etfs --query-file -
90
+ ```
91
+
92
+ Rules:
93
+
94
+ - use exactly one selector: `--system`, `--watchlist`, or `--holding`
95
+ - `--system` accepts a slug from `screening universes`
96
+ - `--watchlist` and `--holding` accept numeric ids
97
+ - `--query-file` must contain the full backend `ScreenerRequest` JSON shape
98
+ - `--query-file -` reads the same JSON shape from stdin
99
+ - `--limit` and `--sort` override only top-level fields from the query JSON
100
+ - use `screening indicators` to discover supported indicator names, params, examples, timeframes, and operators
101
+
102
+ Load [`screening.md`](./screening.md) for detailed screening examples, including
103
+ IFR14, IFR2, and logical `AND` JSON payloads.
104
+
105
+ Example query JSON:
106
+
107
+ ```json
108
+ {
109
+ "query": {
110
+ "comparison": {
111
+ "left": {
112
+ "indicator": {
113
+ "name": "RSI",
114
+ "timeframe": "D1",
115
+ "offset": 0,
116
+ "params": {
117
+ "period": 14
118
+ }
119
+ }
120
+ },
121
+ "operator": "lt",
122
+ "right": {
123
+ "constant": {
124
+ "value": 30
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "limit": 50,
130
+ "sort": "ticker"
131
+ }
132
+ ```
@@ -13,14 +13,19 @@ Current guidance uses backend qualitative classes only:
13
13
  - `market assets` is lowest-cost discovery path
14
14
  - `market price` is narrow read path
15
15
  - `assets overview` is richer and should use minimal `--sections`
16
+ - `screening universes` is a discovery path for saved screening universes
17
+ - `screening indicators` is a discovery path for supported screening JSON
18
+ - `screening run` is a heavy read and should be targeted to one selected universe
16
19
  - holding metrics (`historical-return`, `beta`, `var`) are heaviest current public reads
17
20
 
18
21
  ## Agent rules
19
22
 
20
23
  - prefer narrow command that answers question
21
24
  - prefer `market price` over `assets overview` for quote-only requests
25
+ - run `screening universes` before `screening run` when the universe selector is not known
26
+ - run `screening indicators` before `screening run` when the indicator JSON is not known
22
27
  - prefer one holding metric call targeted to actual question
23
- - do not chain multiple heavy holding metric calls unless user asked for them
28
+ - do not chain multiple heavy holding metric or screening calls unless user asked for them
24
29
  - use `--json` only when structured output needed
25
30
 
26
31
  ## Safe defaults
@@ -1,8 +1,8 @@
1
1
  # Portfolio Reference
2
2
 
3
3
  Use this reference whenever the user mentions portfolios, carteiras, holdings,
4
- watchlists, target weights, positions, historical return, beta, VaR, risk, or a
5
- saved composition.
4
+ watchlists, target weights, positions, historical return, beta, VaR, risk,
5
+ screening universes, or a saved composition.
6
6
 
7
7
  ## Domain model
8
8
 
@@ -11,8 +11,14 @@ saved composition.
11
11
  is not an investable composition and does not define weights or positions.
12
12
  - `Holding` is a portfolio used as an investable composition. It can be based on
13
13
  target weights or positions.
14
+ - `System Portfolio` is a backend-managed portfolio-backed universe exposed by
15
+ slug for screening discovery and runs.
16
+ - `Screening Universe` is exactly one system portfolio, watchlist, or holding
17
+ selected for indicator screening.
14
18
  - A theoretical portfolio is a holding with target weights. Save it first, then
15
19
  run metrics on the returned holding id.
20
+ - A holding used as a screening universe contributes only its asset set; target
21
+ weights and positions do not affect indicator screening.
16
22
  - Target weights and positions are independent: target weights describe intended
17
23
  allocation, while positions describe actual ownership.
18
24
  - Position quantities are shares, units, or coin amounts. Do not pass monetary
@@ -24,6 +30,10 @@ saved composition.
24
30
  non-investable saved lists.
25
31
  - Use `quantbrasil holdings ...` for investable compositions, target weights,
26
32
  positions, historical return, beta, VaR, and risk/return checks.
33
+ - Use `quantbrasil screening universes` to discover system portfolios,
34
+ watchlists, and holdings available for screening.
35
+ - Use `quantbrasil screening run` with exactly one selector to run indicator
36
+ screening over that selected asset set.
27
37
  - Use `quantbrasil holdings list` when the user names a saved holding but does
28
38
  not provide an id.
29
39
  - Use `quantbrasil watchlists list` when the user names a saved watchlist but
@@ -36,6 +46,7 @@ Do not use these patterns:
36
46
  - `quantbrasil portfolios ...`
37
47
  - `quantbrasil analytics ...`
38
48
  - ad-hoc asset lists passed directly into metric commands
49
+ - ad-hoc asset lists passed directly into screening commands
39
50
  - running holding metrics on a watchlist
40
51
 
41
52
  ## Holdings
@@ -0,0 +1,127 @@
1
+ [
2
+ {
3
+ "query": "Qual foi o último preço da PETR4 no QuantBrasil?",
4
+ "should_trigger": true,
5
+ "expected_behavior": "Use quantbrasil market price PETR4 before generic web or finance search."
6
+ },
7
+ {
8
+ "query": "Mostra o preço e a análise técnica da VALE3.",
9
+ "should_trigger": true,
10
+ "expected_behavior": "Use assets overview with the price and technicals sections."
11
+ },
12
+ {
13
+ "query": "Quero preço, fundamentos e rankings de ITUB4.",
14
+ "should_trigger": true,
15
+ "expected_behavior": "Use assets overview with only valid sections: price,fundamentals,rankings."
16
+ },
17
+ {
18
+ "query": "Mostra valuation e resumo da PETR4 pela CLI.",
19
+ "should_trigger": true,
20
+ "expected_behavior": "Do not pass invalid sections like valuation or summary; inspect capabilities or explain the supported asset overview sections."
21
+ },
22
+ {
23
+ "query": "Crie uma watchlist chamada Dividendos e adicione PETR4 e VALE3.",
24
+ "should_trigger": true,
25
+ "expected_behavior": "Use watchlists create followed by watchlists add-assets with explicit tickers."
26
+ },
27
+ {
28
+ "query": "Atualize os pesos alvo da carteira Longo Prazo para PETR4 50 e VALE3 50.",
29
+ "should_trigger": true,
30
+ "expected_behavior": "Resolve the holding id if needed, then use holdings set-targets; do not use a generic portfolio command."
31
+ },
32
+ {
33
+ "query": "Liste minhas carteiras e calcule o retorno histórico da carteira Longo Prazo.",
34
+ "should_trigger": true,
35
+ "expected_behavior": "Use holdings list to resolve the saved holding, then holdings historical-return."
36
+ },
37
+ {
38
+ "query": "Qual é o beta da minha carteira contra o Ibovespa?",
39
+ "should_trigger": true,
40
+ "expected_behavior": "Use holdings beta for a saved holding; do not calculate beta for a watchlist."
41
+ },
42
+ {
43
+ "query": "Quais universos salvos eu posso usar no screening de indicadores?",
44
+ "should_trigger": true,
45
+ "expected_behavior": "Use screening universes and present system portfolios, watchlists, and holdings."
46
+ },
47
+ {
48
+ "query": "Quais indicadores posso usar no screening?",
49
+ "should_trigger": true,
50
+ "expected_behavior": "Use screening indicators and present supported indicator names, params, examples, timeframes, and operators."
51
+ },
52
+ {
53
+ "query": "Rode um screening de IFR na carteira do sistema Ações Mais Líquidas.",
54
+ "should_trigger": true,
55
+ "expected_behavior": "Use screening run with one explicit --system selector and a ScreenerRequest JSON payload."
56
+ },
57
+ {
58
+ "query": "A CLI retornou auth_failed quando tentei buscar PETR4.",
59
+ "should_trigger": true,
60
+ "expected_behavior": "Load error guidance; explain auth login or QUANTBRASIL_API_KEY without inspecting credential files."
61
+ },
62
+ {
63
+ "query": "A CLI disse rate_limited ao rodar várias métricas de carteira.",
64
+ "should_trigger": true,
65
+ "expected_behavior": "Load errors and costs guidance; avoid retry loops and recommend waiting or narrowing heavy calls."
66
+ },
67
+ {
68
+ "query": "Meu terminal diz quantbrasil: command not found.",
69
+ "should_trigger": true,
70
+ "expected_behavior": "Report that the CLI binary is not on PATH and ask the user to install it or fix PATH; do not inspect the repo."
71
+ },
72
+ {
73
+ "query": "Apague uma carteira salva da minha conta.",
74
+ "should_trigger": true,
75
+ "expected_behavior": "Load unsupported guidance and explain that deleting holdings is not public in the CLI."
76
+ },
77
+ {
78
+ "query": "Exporte uma resposta JSON grande para arquivo usando a CLI.",
79
+ "should_trigger": true,
80
+ "expected_behavior": "Load unsupported guidance and explain that --output file export is not public yet."
81
+ },
82
+ {
83
+ "query": "Rode um filtro com estes tickers avulsos: PETR4, VALE3 e BBAS3.",
84
+ "should_trigger": true,
85
+ "expected_behavior": "Load unsupported guidance; do not invent ad-hoc ticker-list screening."
86
+ },
87
+ {
88
+ "query": "What's the latest PETR4 price in QuantBrasil?",
89
+ "should_trigger": true,
90
+ "expected_behavior": "Use quantbrasil market price PETR4."
91
+ },
92
+ {
93
+ "query": "Show me the price and technical overview for VALE3.",
94
+ "should_trigger": true,
95
+ "expected_behavior": "Use assets overview with price and technicals sections."
96
+ },
97
+ {
98
+ "query": "Run a screen over these ad-hoc tickers: PETR4, VALE3, BBAS3.",
99
+ "should_trigger": true,
100
+ "expected_behavior": "Load unsupported guidance; do not invent ad-hoc ticker-list screening."
101
+ },
102
+ {
103
+ "query": "Implemente um novo comando na CLI dentro do repositório do QuantBrasil.",
104
+ "should_trigger": false,
105
+ "expected_behavior": "Handle as code implementation work, not as a market-data CLI usage task."
106
+ },
107
+ {
108
+ "query": "Revise este pull request procurando bugs no backend.",
109
+ "should_trigger": false,
110
+ "expected_behavior": "Handle as code review work, not as a QuantBrasil CLI data task."
111
+ },
112
+ {
113
+ "query": "Procure na web a cotação de hoje do dólar contra o real.",
114
+ "should_trigger": false,
115
+ "expected_behavior": "Use external lookup because the user explicitly requested the web and this is not a QuantBrasil-supported asset workflow."
116
+ },
117
+ {
118
+ "query": "Explique conceitualmente o que significa beta de uma carteira.",
119
+ "should_trigger": false,
120
+ "expected_behavior": "Answer conceptually; no CLI call is needed unless the user asks for a saved holding metric."
121
+ },
122
+ {
123
+ "query": "Monte uma planilha para meus gastos mensais.",
124
+ "should_trigger": false,
125
+ "expected_behavior": "Use spreadsheet/document workflow, not the QuantBrasil CLI skill."
126
+ }
127
+ ]
@@ -0,0 +1,212 @@
1
+ # Screening
2
+
3
+ Use screening for indicator filters over saved QuantBrasil universes.
4
+
5
+ ## Discovery
6
+
7
+ ```bash
8
+ quantbrasil screening universes
9
+ quantbrasil screening indicators
10
+ ```
11
+
12
+ Use `screening universes` to pick the asset set. The CLI supports only saved,
13
+ portfolio-backed universes:
14
+
15
+ - system portfolios via `--system <slug>`
16
+ - watchlists via `--watchlist <id>`
17
+ - holdings via `--holding <id>`
18
+
19
+ Do not invent ad-hoc ticker-list screening. If the user gives loose tickers,
20
+ explain that this CLI slice only screens saved universes.
21
+
22
+ Use `screening indicators` before building JSON when the indicator name,
23
+ parameters, timeframes, or comparison operators are unclear.
24
+
25
+ ## Common Portuguese mappings
26
+
27
+ - `IFR`, `IFR14`, `IFR(14)` -> `RSI` with `params.period = 14`
28
+ - `IFR2`, `IFR(2)` -> `RSI` with `params.period = 2`
29
+ - `sobrevendido` usually means low RSI, commonly `< 30` or a threshold supplied by the user
30
+ - `sobrecomprado` usually means high RSI, commonly `> 70` or a threshold supplied by the user
31
+ - `Ações Mais Líquidas` -> system universe slug `acoes-mais-liquidas` when present in `screening universes`
32
+
33
+ ## Operators
34
+
35
+ - `lt` means less than
36
+ - `lte` means less than or equal to
37
+ - `gt` means greater than
38
+ - `gte` means greater than or equal to
39
+ - `eq` means equal to
40
+ - `neq` means not equal to
41
+
42
+ ## IFR14 abaixo de 25
43
+
44
+ ```json
45
+ {
46
+ "query": {
47
+ "comparison": {
48
+ "left": {
49
+ "indicator": {
50
+ "name": "RSI",
51
+ "timeframe": "D1",
52
+ "offset": 0,
53
+ "params": {
54
+ "period": 14
55
+ }
56
+ }
57
+ },
58
+ "operator": "lt",
59
+ "right": {
60
+ "constant": {
61
+ "value": 25
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "limit": 500,
67
+ "sort": "ticker"
68
+ }
69
+ ```
70
+
71
+ Run it:
72
+
73
+ ```bash
74
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening-ifr14-lt-25.json
75
+ ```
76
+
77
+ For agent/script parsing:
78
+
79
+ ```bash
80
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening-ifr14-lt-25.json --json
81
+ ```
82
+
83
+ ## IFR14 acima de 70
84
+
85
+ ```json
86
+ {
87
+ "query": {
88
+ "comparison": {
89
+ "left": {
90
+ "indicator": {
91
+ "name": "RSI",
92
+ "timeframe": "D1",
93
+ "offset": 0,
94
+ "params": {
95
+ "period": 14
96
+ }
97
+ }
98
+ },
99
+ "operator": "gt",
100
+ "right": {
101
+ "constant": {
102
+ "value": 70
103
+ }
104
+ }
105
+ }
106
+ },
107
+ "limit": 500,
108
+ "sort": "ticker"
109
+ }
110
+ ```
111
+
112
+ ## IFR2 abaixo de 10
113
+
114
+ ```json
115
+ {
116
+ "query": {
117
+ "comparison": {
118
+ "left": {
119
+ "indicator": {
120
+ "name": "RSI",
121
+ "timeframe": "D1",
122
+ "offset": 0,
123
+ "params": {
124
+ "period": 2
125
+ }
126
+ }
127
+ },
128
+ "operator": "lt",
129
+ "right": {
130
+ "constant": {
131
+ "value": 10
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "limit": 500,
137
+ "sort": "ticker"
138
+ }
139
+ ```
140
+
141
+ ## Exemplo com AND lógico
142
+
143
+ Este exemplo filtra ativos com fechamento acima da média móvel de 20 períodos e
144
+ IFR14 abaixo de 30.
145
+
146
+ ```json
147
+ {
148
+ "query": {
149
+ "logical": {
150
+ "op": "AND",
151
+ "expressions": [
152
+ {
153
+ "comparison": {
154
+ "left": {
155
+ "indicator": {
156
+ "name": "OHLC",
157
+ "timeframe": "D1",
158
+ "offset": 0,
159
+ "params": {
160
+ "price_type": "close"
161
+ }
162
+ }
163
+ },
164
+ "operator": "gt",
165
+ "right": {
166
+ "indicator": {
167
+ "name": "RollingWindow",
168
+ "timeframe": "D1",
169
+ "offset": 0,
170
+ "params": {
171
+ "window": 20,
172
+ "method": "mean"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ },
178
+ {
179
+ "comparison": {
180
+ "left": {
181
+ "indicator": {
182
+ "name": "RSI",
183
+ "timeframe": "D1",
184
+ "offset": 0,
185
+ "params": {
186
+ "period": 14
187
+ }
188
+ }
189
+ },
190
+ "operator": "lt",
191
+ "right": {
192
+ "constant": {
193
+ "value": 30
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ]
199
+ }
200
+ },
201
+ "limit": 100,
202
+ "sort": "ticker"
203
+ }
204
+ ```
205
+
206
+ ## Stdin
207
+
208
+ Use stdin when creating the JSON dynamically:
209
+
210
+ ```bash
211
+ cat ./screening-ifr14-lt-25.json | quantbrasil screening run --system acoes-mais-liquidas --query-file -
212
+ ```
@@ -5,6 +5,7 @@ Unsupported in the public CLI:
5
5
  - `--output <file>` response export
6
6
  - deleting watchlists or holdings
7
7
  - value-based position input for traded assets
8
+ - ad-hoc ticker-list screening
8
9
 
9
10
  Not a supported pattern:
10
11
 
@@ -19,5 +20,6 @@ Use the public surface only:
19
20
  - `capabilities`
20
21
  - `market`
21
22
  - `assets`
23
+ - `screening`
22
24
  - `watchlists`
23
25
  - `holdings`
@@ -8,6 +8,7 @@
8
8
  - watchlist details or changes → `watchlists ...`
9
9
  - holding details or changes → `holdings ...`
10
10
  - holding return, beta, risk, VaR, or comparison → `holdings historical-return|beta|var`
11
+ - indicator screening over saved asset sets → `screening universes`, `screening indicators` when needed, then `screening run`
11
12
 
12
13
  ## Find supported ticker, then get price
13
14
 
@@ -75,6 +76,29 @@ quantbrasil holdings beta 93 --years 1
75
76
  quantbrasil holdings var 93 --years 1 --confidence 95
76
77
  ```
77
78
 
79
+ ## Run indicator screening
80
+
81
+ 1. Discover available universes.
82
+ 2. Discover available indicators when the filter JSON is not already known.
83
+ 3. Pick exactly one system portfolio, watchlist, or holding.
84
+ 4. Run screening with a full `ScreenerRequest` JSON file.
85
+
86
+ ```bash
87
+ quantbrasil screening universes
88
+ quantbrasil screening indicators
89
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json
90
+ quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25
91
+ quantbrasil screening run --holding 182 --query-file ./screening.json --sort ticker
92
+ ```
93
+
94
+ Rules:
95
+
96
+ - screening universes are portfolio-backed only: system portfolios, watchlists, or holdings
97
+ - a holding used as a screening universe contributes only its asset set
98
+ - do not invent ad-hoc ticker-list screening commands
99
+ - load `references/screening.md` for IFR/RSI examples and full JSON payloads
100
+ - use `--json` when the result will be parsed by an agent or script
101
+
78
102
  ## Analyze a theoretical composition
79
103
 
80
104
  Create a holding with target weights, then run holding metrics on its id.