@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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
|
+
export const cointegrationCapabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "cointegration.pair",
|
|
5
|
+
kind: "read",
|
|
6
|
+
visibility: publicRuntimeVisibility,
|
|
7
|
+
description: "Calcula cointegração para análise de Long & Short entre dois ativos: z-score, beta, p-valor, meia-vida e intervalos de confiança.",
|
|
8
|
+
http: {
|
|
9
|
+
method: "POST",
|
|
10
|
+
path: "/api/desk/tools/cointegration/pair",
|
|
11
|
+
inputMode: "json_body",
|
|
12
|
+
schemas: {
|
|
13
|
+
request: "CointegrationPairRequest",
|
|
14
|
+
response: "CointegrationPairResponse",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
cli: {
|
|
18
|
+
group: "cointegration",
|
|
19
|
+
command: "pair",
|
|
20
|
+
summary: "Calcula cointegração para análise de Long & Short.",
|
|
21
|
+
positional: [
|
|
22
|
+
{
|
|
23
|
+
kind: "positional",
|
|
24
|
+
name: "base_asset",
|
|
25
|
+
type: "string",
|
|
26
|
+
required: true,
|
|
27
|
+
placeholder: "TICKER",
|
|
28
|
+
description: "Ticker do ativo base, por exemplo PETR4.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
kind: "positional",
|
|
32
|
+
name: "comparison_asset",
|
|
33
|
+
type: "string",
|
|
34
|
+
required: true,
|
|
35
|
+
placeholder: "TICKER",
|
|
36
|
+
description: "Ticker do ativo de comparação, por exemplo VALE3.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
kind: "option",
|
|
42
|
+
flag: "--window",
|
|
43
|
+
name: "window",
|
|
44
|
+
type: "integer",
|
|
45
|
+
required: false,
|
|
46
|
+
placeholder: "N",
|
|
47
|
+
defaultValue: 250,
|
|
48
|
+
description: "Janela de candles para a regressão. Padrão 250 dias úteis.",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
examples: [
|
|
52
|
+
"quantbrasil cointegration pair PETR4 VALE3",
|
|
53
|
+
"quantbrasil cointegration pair PETR4 VALE3 --window 120",
|
|
54
|
+
"quantbrasil cointegration pair PETR4 VALE3 --json",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
tool: {
|
|
58
|
+
name: "qb_cointegration_pair",
|
|
59
|
+
title: "Calcular cointegração para Long & Short",
|
|
60
|
+
},
|
|
61
|
+
outputModes: standardOutputModes,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const rankingReturnRebalanceValues: readonly ["weekly", "monthly", "bimonthly", "quarterly", "semiannually", "annually"];
|
|
2
|
+
export declare const rankingReturnWeightingValues: readonly ["equal"];
|
|
3
|
+
export declare const rankingReturnIndexFilterValues: readonly ["NONE", "IBOV", "IBX100", "SMLL"];
|
|
1
4
|
export declare const rankingsCapabilities: readonly [{
|
|
2
5
|
readonly id: "rankings.list";
|
|
3
6
|
readonly kind: "read";
|
|
@@ -52,7 +55,7 @@ export declare const rankingsCapabilities: readonly [{
|
|
|
52
55
|
readonly required: false;
|
|
53
56
|
readonly placeholder: "SLUG";
|
|
54
57
|
readonly exclusiveGroup: "ranking_selector";
|
|
55
|
-
readonly description: "Slug de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.";
|
|
58
|
+
readonly description: "Slug de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d ou low-risk.";
|
|
56
59
|
}, {
|
|
57
60
|
readonly kind: "option";
|
|
58
61
|
readonly flag: "--id";
|
|
@@ -72,12 +75,101 @@ export declare const rankingsCapabilities: readonly [{
|
|
|
72
75
|
readonly defaultValue: 20;
|
|
73
76
|
readonly description: "Número de ativos do topo do ranking a retornar.";
|
|
74
77
|
}];
|
|
75
|
-
readonly examples: readonly ["quantbrasil rankings current --system momentum-90d --top 20", "quantbrasil rankings current --system magic-formula --top 10", "quantbrasil rankings current --id 123 --top 20"];
|
|
78
|
+
readonly examples: readonly ["quantbrasil rankings current --system momentum-90d --top 20", "quantbrasil rankings current --system magic-formula --top 10", "quantbrasil rankings current --system low-risk --top 30", "quantbrasil rankings current --id 123 --top 20"];
|
|
76
79
|
};
|
|
77
80
|
readonly tool: {
|
|
78
81
|
readonly name: "qb_rankings_current";
|
|
79
82
|
readonly title: "Consultar ranking atual";
|
|
80
83
|
};
|
|
81
84
|
readonly outputModes: readonly ["json", "human"];
|
|
85
|
+
}, {
|
|
86
|
+
readonly id: "rankings.return";
|
|
87
|
+
readonly kind: "read";
|
|
88
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
89
|
+
readonly description: "Calcula o retorno histórico de uma estratégia baseada em ranking do sistema.";
|
|
90
|
+
readonly http: {
|
|
91
|
+
readonly method: "POST";
|
|
92
|
+
readonly path: "/api/desk/tools/rankings/return";
|
|
93
|
+
readonly inputMode: "json_body";
|
|
94
|
+
readonly schemas: {
|
|
95
|
+
readonly request: "RankingReturnRequest";
|
|
96
|
+
readonly response: "RankingReturnResponse";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly cli: {
|
|
100
|
+
readonly group: "rankings";
|
|
101
|
+
readonly command: "return";
|
|
102
|
+
readonly summary: "Calcula o retorno histórico de um ranking do sistema.";
|
|
103
|
+
readonly positional: readonly [];
|
|
104
|
+
readonly options: readonly [{
|
|
105
|
+
readonly kind: "option";
|
|
106
|
+
readonly flag: "--system";
|
|
107
|
+
readonly name: "system_id";
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly required: true;
|
|
110
|
+
readonly placeholder: "SLUG";
|
|
111
|
+
readonly description: "Slug de ranking do sistema com histórico de rebalanceamento, por exemplo magic-formula ou momentum-90d.";
|
|
112
|
+
}, {
|
|
113
|
+
readonly kind: "option";
|
|
114
|
+
readonly flag: "--from";
|
|
115
|
+
readonly name: "start_date";
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly required: true;
|
|
118
|
+
readonly placeholder: "AAAA-MM-DD";
|
|
119
|
+
readonly description: "Data inicial em ISO 8601.";
|
|
120
|
+
}, {
|
|
121
|
+
readonly kind: "option";
|
|
122
|
+
readonly flag: "--to";
|
|
123
|
+
readonly name: "end_date";
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
readonly required: true;
|
|
126
|
+
readonly placeholder: "AAAA-MM-DD";
|
|
127
|
+
readonly description: "Data final em ISO 8601.";
|
|
128
|
+
}, {
|
|
129
|
+
readonly kind: "option";
|
|
130
|
+
readonly flag: "--top";
|
|
131
|
+
readonly name: "top_n";
|
|
132
|
+
readonly type: "integer";
|
|
133
|
+
readonly required: false;
|
|
134
|
+
readonly placeholder: "N";
|
|
135
|
+
readonly defaultValue: 20;
|
|
136
|
+
readonly description: "Número de ativos no ranking a cada rebalanceamento.";
|
|
137
|
+
}, {
|
|
138
|
+
readonly kind: "option";
|
|
139
|
+
readonly flag: "--rebalance";
|
|
140
|
+
readonly name: "rebalance_frequency";
|
|
141
|
+
readonly type: "enum";
|
|
142
|
+
readonly required: true;
|
|
143
|
+
readonly placeholder: "weekly|monthly|bimonthly|quarterly|semiannually|annually";
|
|
144
|
+
readonly enumValues: readonly ["weekly", "monthly", "bimonthly", "quarterly", "semiannually", "annually"];
|
|
145
|
+
readonly description: "Frequência de rebalanceamento da estratégia.";
|
|
146
|
+
}, {
|
|
147
|
+
readonly kind: "option";
|
|
148
|
+
readonly flag: "--weight";
|
|
149
|
+
readonly name: "weighting_method";
|
|
150
|
+
readonly type: "enum";
|
|
151
|
+
readonly required: false;
|
|
152
|
+
readonly placeholder: "equal";
|
|
153
|
+
readonly defaultValue: "equal";
|
|
154
|
+
readonly enumValues: readonly ["equal"];
|
|
155
|
+
readonly description: "Método de ponderação dos ativos.";
|
|
156
|
+
}, {
|
|
157
|
+
readonly kind: "option";
|
|
158
|
+
readonly flag: "--index-filter";
|
|
159
|
+
readonly name: "index_filter";
|
|
160
|
+
readonly type: "enum";
|
|
161
|
+
readonly required: false;
|
|
162
|
+
readonly placeholder: "NONE|IBOV|IBX100|SMLL";
|
|
163
|
+
readonly defaultValue: "NONE";
|
|
164
|
+
readonly enumValues: readonly ["NONE", "IBOV", "IBX100", "SMLL"];
|
|
165
|
+
readonly description: "Filtro de índice aplicado ao universo do ranking.";
|
|
166
|
+
}];
|
|
167
|
+
readonly examples: readonly ["quantbrasil rankings return --system magic-formula --from 2024-01-18 --to 2026-05-25 --top 20 --rebalance quarterly", "quantbrasil rankings return --system momentum-90d --from 2024-01-01 --to 2026-01-01 --top 10 --rebalance monthly --json"];
|
|
168
|
+
};
|
|
169
|
+
readonly tool: {
|
|
170
|
+
readonly name: "qb_rankings_return";
|
|
171
|
+
readonly title: "Calcular retorno de ranking";
|
|
172
|
+
};
|
|
173
|
+
readonly outputModes: readonly ["json", "human"];
|
|
82
174
|
}];
|
|
83
175
|
//# sourceMappingURL=rankings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rankings.d.ts","sourceRoot":"","sources":["../../src/capabilities/rankings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rankings.d.ts","sourceRoot":"","sources":["../../src/capabilities/rankings.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B,sFAO/B,CAAC;AACX,eAAO,MAAM,4BAA4B,oBAAqB,CAAC;AAC/D,eAAO,MAAM,8BAA8B,6CAKjC,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyMmB,CAAC"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
2
|
const rankingSelectorExclusiveGroup = "ranking_selector";
|
|
3
|
+
export const rankingReturnRebalanceValues = [
|
|
4
|
+
"weekly",
|
|
5
|
+
"monthly",
|
|
6
|
+
"bimonthly",
|
|
7
|
+
"quarterly",
|
|
8
|
+
"semiannually",
|
|
9
|
+
"annually",
|
|
10
|
+
];
|
|
11
|
+
export const rankingReturnWeightingValues = ["equal"];
|
|
12
|
+
export const rankingReturnIndexFilterValues = [
|
|
13
|
+
"NONE",
|
|
14
|
+
"IBOV",
|
|
15
|
+
"IBX100",
|
|
16
|
+
"SMLL",
|
|
17
|
+
];
|
|
3
18
|
export const rankingsCapabilities = [
|
|
4
19
|
{
|
|
5
20
|
id: "rankings.list",
|
|
@@ -57,7 +72,7 @@ export const rankingsCapabilities = [
|
|
|
57
72
|
required: false,
|
|
58
73
|
placeholder: "SLUG",
|
|
59
74
|
exclusiveGroup: rankingSelectorExclusiveGroup,
|
|
60
|
-
description: "Slug de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.",
|
|
75
|
+
description: "Slug de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d ou low-risk.",
|
|
61
76
|
},
|
|
62
77
|
{
|
|
63
78
|
kind: "option",
|
|
@@ -83,6 +98,7 @@ export const rankingsCapabilities = [
|
|
|
83
98
|
examples: [
|
|
84
99
|
"quantbrasil rankings current --system momentum-90d --top 20",
|
|
85
100
|
"quantbrasil rankings current --system magic-formula --top 10",
|
|
101
|
+
"quantbrasil rankings current --system low-risk --top 30",
|
|
86
102
|
"quantbrasil rankings current --id 123 --top 20",
|
|
87
103
|
],
|
|
88
104
|
},
|
|
@@ -92,4 +108,105 @@ export const rankingsCapabilities = [
|
|
|
92
108
|
},
|
|
93
109
|
outputModes: standardOutputModes,
|
|
94
110
|
},
|
|
111
|
+
{
|
|
112
|
+
id: "rankings.return",
|
|
113
|
+
kind: "read",
|
|
114
|
+
visibility: publicRuntimeVisibility,
|
|
115
|
+
description: "Calcula o retorno histórico de uma estratégia baseada em ranking do sistema.",
|
|
116
|
+
http: {
|
|
117
|
+
method: "POST",
|
|
118
|
+
path: "/api/desk/tools/rankings/return",
|
|
119
|
+
inputMode: "json_body",
|
|
120
|
+
schemas: {
|
|
121
|
+
request: "RankingReturnRequest",
|
|
122
|
+
response: "RankingReturnResponse",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
cli: {
|
|
126
|
+
group: "rankings",
|
|
127
|
+
command: "return",
|
|
128
|
+
summary: "Calcula o retorno histórico de um ranking do sistema.",
|
|
129
|
+
positional: [],
|
|
130
|
+
options: [
|
|
131
|
+
{
|
|
132
|
+
kind: "option",
|
|
133
|
+
flag: "--system",
|
|
134
|
+
name: "system_id",
|
|
135
|
+
type: "string",
|
|
136
|
+
required: true,
|
|
137
|
+
placeholder: "SLUG",
|
|
138
|
+
description: "Slug de ranking do sistema com histórico de rebalanceamento, por exemplo magic-formula ou momentum-90d.",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
kind: "option",
|
|
142
|
+
flag: "--from",
|
|
143
|
+
name: "start_date",
|
|
144
|
+
type: "string",
|
|
145
|
+
required: true,
|
|
146
|
+
placeholder: "AAAA-MM-DD",
|
|
147
|
+
description: "Data inicial em ISO 8601.",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
kind: "option",
|
|
151
|
+
flag: "--to",
|
|
152
|
+
name: "end_date",
|
|
153
|
+
type: "string",
|
|
154
|
+
required: true,
|
|
155
|
+
placeholder: "AAAA-MM-DD",
|
|
156
|
+
description: "Data final em ISO 8601.",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
kind: "option",
|
|
160
|
+
flag: "--top",
|
|
161
|
+
name: "top_n",
|
|
162
|
+
type: "integer",
|
|
163
|
+
required: false,
|
|
164
|
+
placeholder: "N",
|
|
165
|
+
defaultValue: 20,
|
|
166
|
+
description: "Número de ativos no ranking a cada rebalanceamento.",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
kind: "option",
|
|
170
|
+
flag: "--rebalance",
|
|
171
|
+
name: "rebalance_frequency",
|
|
172
|
+
type: "enum",
|
|
173
|
+
required: true,
|
|
174
|
+
placeholder: "weekly|monthly|bimonthly|quarterly|semiannually|annually",
|
|
175
|
+
enumValues: rankingReturnRebalanceValues,
|
|
176
|
+
description: "Frequência de rebalanceamento da estratégia.",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
kind: "option",
|
|
180
|
+
flag: "--weight",
|
|
181
|
+
name: "weighting_method",
|
|
182
|
+
type: "enum",
|
|
183
|
+
required: false,
|
|
184
|
+
placeholder: "equal",
|
|
185
|
+
defaultValue: "equal",
|
|
186
|
+
enumValues: rankingReturnWeightingValues,
|
|
187
|
+
description: "Método de ponderação dos ativos.",
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
kind: "option",
|
|
191
|
+
flag: "--index-filter",
|
|
192
|
+
name: "index_filter",
|
|
193
|
+
type: "enum",
|
|
194
|
+
required: false,
|
|
195
|
+
placeholder: "NONE|IBOV|IBX100|SMLL",
|
|
196
|
+
defaultValue: "NONE",
|
|
197
|
+
enumValues: rankingReturnIndexFilterValues,
|
|
198
|
+
description: "Filtro de índice aplicado ao universo do ranking.",
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
examples: [
|
|
202
|
+
"quantbrasil rankings return --system magic-formula --from 2024-01-18 --to 2026-05-25 --top 20 --rebalance quarterly",
|
|
203
|
+
"quantbrasil rankings return --system momentum-90d --from 2024-01-01 --to 2026-01-01 --top 10 --rebalance monthly --json",
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
tool: {
|
|
207
|
+
name: "qb_rankings_return",
|
|
208
|
+
title: "Calcular retorno de ranking",
|
|
209
|
+
},
|
|
210
|
+
outputModes: standardOutputModes,
|
|
211
|
+
},
|
|
95
212
|
];
|