@quantbrasil/cli 0.1.0-beta.13 → 0.1.0-beta.15
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 +5 -0
- package/dist/cli/client.d.ts.map +1 -1
- package/dist/cli/client.js +27 -1
- package/dist/cli/errors.d.ts +3 -0
- package/dist/cli/errors.d.ts.map +1 -1
- package/dist/cli/errors.js +8 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +16 -0
- package/dist/commands/backtests.d.ts +183 -0
- package/dist/commands/backtests.d.ts.map +1 -0
- package/dist/commands/backtests.js +525 -0
- package/dist/commands/news.d.ts +48 -0
- package/dist/commands/news.d.ts.map +1 -0
- package/dist/commands/news.js +85 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/vendor/core/capabilities/backtests.d.ts +207 -0
- package/dist/vendor/core/capabilities/backtests.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/backtests.js +239 -0
- package/dist/vendor/core/capabilities/index.d.ts +2 -0
- package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/index.js +2 -0
- package/dist/vendor/core/capabilities/news.d.ts +54 -0
- package/dist/vendor/core/capabilities/news.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/news.js +65 -0
- package/dist/vendor/core/capabilities/registry.d.ts +512 -0
- package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/registry.js +4 -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 +8 -4
- package/skills/quantbrasil/references/backtests.md +173 -0
- package/skills/quantbrasil/references/cli.md +45 -0
- package/skills/quantbrasil/references/costs.md +6 -1
- package/skills/quantbrasil/references/quality-eval-queries.json +30 -0
- package/skills/quantbrasil/references/unsupported.md +5 -0
- package/skills/quantbrasil/references/workflows.md +46 -0
package/dist/index.js
CHANGED
|
@@ -4,9 +4,11 @@ export * from "./cli/errors.js";
|
|
|
4
4
|
export * from "./cli/index.js";
|
|
5
5
|
export * from "./commands/assets.js";
|
|
6
6
|
export * from "./commands/auth.js";
|
|
7
|
+
export * from "./commands/backtests.js";
|
|
7
8
|
export * from "./commands/capabilities.js";
|
|
8
9
|
export * from "./commands/init.js";
|
|
9
10
|
export * from "./commands/market.js";
|
|
11
|
+
export * from "./commands/news.js";
|
|
10
12
|
export * from "./commands/portfolios.js";
|
|
11
13
|
export * from "./commands/rankings.js";
|
|
12
14
|
export * from "./commands/screening.js";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
export declare const backtestTimeframeValues: readonly ["M5", "M15", "M30", "H1", "H2", "H4", "D1", "W1"];
|
|
2
|
+
export declare const backtestCapabilities: readonly [{
|
|
3
|
+
readonly id: "backtests.strategies";
|
|
4
|
+
readonly kind: "read";
|
|
5
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
6
|
+
readonly description: "Lista estratégias de backtest disponíveis, com orientação de seleção, parâmetros e defaults.";
|
|
7
|
+
readonly http: {
|
|
8
|
+
readonly method: "GET";
|
|
9
|
+
readonly path: "/api/desk/tools/backtests/strategies";
|
|
10
|
+
readonly inputMode: "none";
|
|
11
|
+
readonly schemas: {
|
|
12
|
+
readonly request: null;
|
|
13
|
+
readonly response: "BacktestStrategiesResponse";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly cli: {
|
|
17
|
+
readonly group: "backtests";
|
|
18
|
+
readonly command: "strategies";
|
|
19
|
+
readonly summary: "Lista estratégias de backtest disponíveis.";
|
|
20
|
+
readonly positional: readonly [];
|
|
21
|
+
readonly options: readonly [];
|
|
22
|
+
readonly examples: readonly ["quantbrasil backtests strategies"];
|
|
23
|
+
};
|
|
24
|
+
readonly tool: {
|
|
25
|
+
readonly name: "qb_backtests_strategies";
|
|
26
|
+
readonly title: "List backtest strategies";
|
|
27
|
+
};
|
|
28
|
+
readonly outputModes: readonly ["json", "human"];
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "backtests.info";
|
|
31
|
+
readonly kind: "read";
|
|
32
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
33
|
+
readonly description: "Mostra ajuda, orientação de seleção, parâmetros aceitos, defaults e dicas de uma estratégia de backtest.";
|
|
34
|
+
readonly http: {
|
|
35
|
+
readonly method: "POST";
|
|
36
|
+
readonly path: "/api/desk/tools/backtests/strategy";
|
|
37
|
+
readonly inputMode: "json_body";
|
|
38
|
+
readonly schemas: {
|
|
39
|
+
readonly request: "BacktestStrategyRequest";
|
|
40
|
+
readonly response: "BacktestStrategyResponse";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly cli: {
|
|
44
|
+
readonly group: "backtests";
|
|
45
|
+
readonly command: "info";
|
|
46
|
+
readonly summary: "Mostra detalhes de uma estratégia de backtest.";
|
|
47
|
+
readonly positional: readonly [{
|
|
48
|
+
readonly kind: "positional";
|
|
49
|
+
readonly name: "strategy_id";
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly required: true;
|
|
52
|
+
readonly placeholder: "ESTRATEGIA";
|
|
53
|
+
readonly description: "ID da estratégia retornado por `backtests strategies`.";
|
|
54
|
+
}];
|
|
55
|
+
readonly options: readonly [];
|
|
56
|
+
readonly examples: readonly ["quantbrasil backtests info ifr2"];
|
|
57
|
+
};
|
|
58
|
+
readonly tool: {
|
|
59
|
+
readonly name: "qb_backtests_info";
|
|
60
|
+
readonly title: "Get backtest strategy info";
|
|
61
|
+
};
|
|
62
|
+
readonly outputModes: readonly ["json", "human"];
|
|
63
|
+
}, {
|
|
64
|
+
readonly id: "backtests.get";
|
|
65
|
+
readonly kind: "read";
|
|
66
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
67
|
+
readonly description: "Retorna um backtest salvo por ID, respeitando o usuário autenticado.";
|
|
68
|
+
readonly http: {
|
|
69
|
+
readonly method: "POST";
|
|
70
|
+
readonly path: "/api/desk/tools/backtests/get";
|
|
71
|
+
readonly inputMode: "json_body";
|
|
72
|
+
readonly schemas: {
|
|
73
|
+
readonly request: "BacktestGetRequest";
|
|
74
|
+
readonly response: "BacktestGetResponse";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly cli: {
|
|
78
|
+
readonly group: "backtests";
|
|
79
|
+
readonly command: "get";
|
|
80
|
+
readonly summary: "Mostra um backtest salvo por ID.";
|
|
81
|
+
readonly positional: readonly [{
|
|
82
|
+
readonly kind: "positional";
|
|
83
|
+
readonly name: "backtest_id";
|
|
84
|
+
readonly type: "integer";
|
|
85
|
+
readonly required: true;
|
|
86
|
+
readonly placeholder: "ID";
|
|
87
|
+
readonly description: "ID do backtest salvo.";
|
|
88
|
+
}];
|
|
89
|
+
readonly options: readonly [];
|
|
90
|
+
readonly examples: readonly ["quantbrasil backtests get 123"];
|
|
91
|
+
};
|
|
92
|
+
readonly tool: {
|
|
93
|
+
readonly name: "qb_backtests_get";
|
|
94
|
+
readonly title: "Get backtest";
|
|
95
|
+
};
|
|
96
|
+
readonly outputModes: readonly ["json", "human"];
|
|
97
|
+
}, {
|
|
98
|
+
readonly id: "backtests.run";
|
|
99
|
+
readonly kind: "mutation";
|
|
100
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
101
|
+
readonly description: "Executa um backtest para uma estratégia e ativo.";
|
|
102
|
+
readonly http: {
|
|
103
|
+
readonly method: "POST";
|
|
104
|
+
readonly path: "/api/desk/tools/backtests/run";
|
|
105
|
+
readonly inputMode: "json_body";
|
|
106
|
+
readonly schemas: {
|
|
107
|
+
readonly request: "BacktestRunRequest";
|
|
108
|
+
readonly response: "BacktestRunResponse";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly cli: {
|
|
112
|
+
readonly group: "backtests";
|
|
113
|
+
readonly command: "run";
|
|
114
|
+
readonly summary: "Executa um backtest individual.";
|
|
115
|
+
readonly positional: readonly [{
|
|
116
|
+
readonly kind: "positional";
|
|
117
|
+
readonly name: "strategy_id";
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
readonly required: true;
|
|
120
|
+
readonly placeholder: "ESTRATEGIA";
|
|
121
|
+
readonly description: "ID da estratégia, por exemplo ifr2.";
|
|
122
|
+
}, {
|
|
123
|
+
readonly kind: "positional";
|
|
124
|
+
readonly name: "ticker";
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly required: true;
|
|
127
|
+
readonly placeholder: "TICKER";
|
|
128
|
+
readonly description: "Ticker do ativo, por exemplo PETR4.";
|
|
129
|
+
}];
|
|
130
|
+
readonly options: readonly [{
|
|
131
|
+
readonly kind: "option";
|
|
132
|
+
readonly flag: "--timeframe";
|
|
133
|
+
readonly name: "timeframe_id";
|
|
134
|
+
readonly type: "enum";
|
|
135
|
+
readonly required: false;
|
|
136
|
+
readonly placeholder: "TIMEFRAME";
|
|
137
|
+
readonly enumValues: readonly ["M5", "M15", "M30", "H1", "H2", "H4", "D1", "W1"];
|
|
138
|
+
readonly description: "Timeframe do backtest.";
|
|
139
|
+
}, {
|
|
140
|
+
readonly kind: "option";
|
|
141
|
+
readonly flag: "--from";
|
|
142
|
+
readonly name: "start_date";
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly required: false;
|
|
145
|
+
readonly placeholder: "AAAA-MM-DD";
|
|
146
|
+
readonly description: "Data inicial em ISO.";
|
|
147
|
+
}, {
|
|
148
|
+
readonly kind: "option";
|
|
149
|
+
readonly flag: "--to";
|
|
150
|
+
readonly name: "end_date";
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
readonly required: false;
|
|
153
|
+
readonly placeholder: "AAAA-MM-DD";
|
|
154
|
+
readonly description: "Data final em ISO.";
|
|
155
|
+
}, {
|
|
156
|
+
readonly kind: "option";
|
|
157
|
+
readonly flag: "--capital";
|
|
158
|
+
readonly name: "capital";
|
|
159
|
+
readonly type: "number";
|
|
160
|
+
readonly required: false;
|
|
161
|
+
readonly placeholder: "VALOR";
|
|
162
|
+
readonly description: "Capital inicial do backtest.";
|
|
163
|
+
}, {
|
|
164
|
+
readonly kind: "option";
|
|
165
|
+
readonly flag: "--max-risk";
|
|
166
|
+
readonly name: "max_risk";
|
|
167
|
+
readonly type: "number";
|
|
168
|
+
readonly required: false;
|
|
169
|
+
readonly placeholder: "VALOR";
|
|
170
|
+
readonly description: "Risco máximo do backtest.";
|
|
171
|
+
}, {
|
|
172
|
+
readonly kind: "option";
|
|
173
|
+
readonly flag: "--contracts";
|
|
174
|
+
readonly name: "num_contracts";
|
|
175
|
+
readonly type: "integer";
|
|
176
|
+
readonly required: false;
|
|
177
|
+
readonly placeholder: "N";
|
|
178
|
+
readonly defaultValue: 5;
|
|
179
|
+
readonly description: "Número de contratos para ativos que usam contratos.";
|
|
180
|
+
}, {
|
|
181
|
+
readonly kind: "option";
|
|
182
|
+
readonly flag: "--param";
|
|
183
|
+
readonly name: "parameters";
|
|
184
|
+
readonly type: "string_array";
|
|
185
|
+
readonly required: false;
|
|
186
|
+
readonly placeholder: "CHAVE=VALOR";
|
|
187
|
+
readonly multiple: true;
|
|
188
|
+
readonly collectionFormat: "repeatable";
|
|
189
|
+
readonly description: "Parâmetro da estratégia. Pode ser repetido, por exemplo --param rsi=30.";
|
|
190
|
+
}, {
|
|
191
|
+
readonly kind: "option";
|
|
192
|
+
readonly flag: "--params-json";
|
|
193
|
+
readonly name: "parameters_json";
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
readonly required: false;
|
|
196
|
+
readonly placeholder: "JSON";
|
|
197
|
+
readonly description: "Objeto JSON com parâmetros da estratégia.";
|
|
198
|
+
}];
|
|
199
|
+
readonly examples: readonly ["quantbrasil backtests run ifr2 PETR4 --timeframe D1 --from 2025-01-01 --to 2026-01-01", "quantbrasil backtests run ifr2 PETR4 --timeframe D1 --param rsi=30 --param window=2 --json"];
|
|
200
|
+
};
|
|
201
|
+
readonly tool: {
|
|
202
|
+
readonly name: "qb_backtests_run";
|
|
203
|
+
readonly title: "Run backtest";
|
|
204
|
+
};
|
|
205
|
+
readonly outputModes: readonly ["json", "human"];
|
|
206
|
+
}];
|
|
207
|
+
//# sourceMappingURL=backtests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backtests.d.ts","sourceRoot":"","sources":["../../src/capabilities/backtests.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,6DAS1B,CAAC;AAWX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+NmB,CAAC"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
|
+
export const backtestTimeframeValues = [
|
|
3
|
+
"M5",
|
|
4
|
+
"M15",
|
|
5
|
+
"M30",
|
|
6
|
+
"H1",
|
|
7
|
+
"H2",
|
|
8
|
+
"H4",
|
|
9
|
+
"D1",
|
|
10
|
+
"W1",
|
|
11
|
+
];
|
|
12
|
+
const backtestIdPositional = {
|
|
13
|
+
kind: "positional",
|
|
14
|
+
name: "backtest_id",
|
|
15
|
+
type: "integer",
|
|
16
|
+
required: true,
|
|
17
|
+
placeholder: "ID",
|
|
18
|
+
description: "ID do backtest salvo.",
|
|
19
|
+
};
|
|
20
|
+
export const backtestCapabilities = [
|
|
21
|
+
{
|
|
22
|
+
id: "backtests.strategies",
|
|
23
|
+
kind: "read",
|
|
24
|
+
visibility: publicRuntimeVisibility,
|
|
25
|
+
description: "Lista estratégias de backtest disponíveis, com orientação de seleção, parâmetros e defaults.",
|
|
26
|
+
http: {
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: "/api/desk/tools/backtests/strategies",
|
|
29
|
+
inputMode: "none",
|
|
30
|
+
schemas: {
|
|
31
|
+
request: null,
|
|
32
|
+
response: "BacktestStrategiesResponse",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
cli: {
|
|
36
|
+
group: "backtests",
|
|
37
|
+
command: "strategies",
|
|
38
|
+
summary: "Lista estratégias de backtest disponíveis.",
|
|
39
|
+
positional: [],
|
|
40
|
+
options: [],
|
|
41
|
+
examples: ["quantbrasil backtests strategies"],
|
|
42
|
+
},
|
|
43
|
+
tool: {
|
|
44
|
+
name: "qb_backtests_strategies",
|
|
45
|
+
title: "List backtest strategies",
|
|
46
|
+
},
|
|
47
|
+
outputModes: standardOutputModes,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "backtests.info",
|
|
51
|
+
kind: "read",
|
|
52
|
+
visibility: publicRuntimeVisibility,
|
|
53
|
+
description: "Mostra ajuda, orientação de seleção, parâmetros aceitos, defaults e dicas de uma estratégia de backtest.",
|
|
54
|
+
http: {
|
|
55
|
+
method: "POST",
|
|
56
|
+
path: "/api/desk/tools/backtests/strategy",
|
|
57
|
+
inputMode: "json_body",
|
|
58
|
+
schemas: {
|
|
59
|
+
request: "BacktestStrategyRequest",
|
|
60
|
+
response: "BacktestStrategyResponse",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
cli: {
|
|
64
|
+
group: "backtests",
|
|
65
|
+
command: "info",
|
|
66
|
+
summary: "Mostra detalhes de uma estratégia de backtest.",
|
|
67
|
+
positional: [
|
|
68
|
+
{
|
|
69
|
+
kind: "positional",
|
|
70
|
+
name: "strategy_id",
|
|
71
|
+
type: "string",
|
|
72
|
+
required: true,
|
|
73
|
+
placeholder: "ESTRATEGIA",
|
|
74
|
+
description: "ID da estratégia retornado por `backtests strategies`.",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
options: [],
|
|
78
|
+
examples: ["quantbrasil backtests info ifr2"],
|
|
79
|
+
},
|
|
80
|
+
tool: {
|
|
81
|
+
name: "qb_backtests_info",
|
|
82
|
+
title: "Get backtest strategy info",
|
|
83
|
+
},
|
|
84
|
+
outputModes: standardOutputModes,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "backtests.get",
|
|
88
|
+
kind: "read",
|
|
89
|
+
visibility: publicRuntimeVisibility,
|
|
90
|
+
description: "Retorna um backtest salvo por ID, respeitando o usuário autenticado.",
|
|
91
|
+
http: {
|
|
92
|
+
method: "POST",
|
|
93
|
+
path: "/api/desk/tools/backtests/get",
|
|
94
|
+
inputMode: "json_body",
|
|
95
|
+
schemas: {
|
|
96
|
+
request: "BacktestGetRequest",
|
|
97
|
+
response: "BacktestGetResponse",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
cli: {
|
|
101
|
+
group: "backtests",
|
|
102
|
+
command: "get",
|
|
103
|
+
summary: "Mostra um backtest salvo por ID.",
|
|
104
|
+
positional: [backtestIdPositional],
|
|
105
|
+
options: [],
|
|
106
|
+
examples: ["quantbrasil backtests get 123"],
|
|
107
|
+
},
|
|
108
|
+
tool: {
|
|
109
|
+
name: "qb_backtests_get",
|
|
110
|
+
title: "Get backtest",
|
|
111
|
+
},
|
|
112
|
+
outputModes: standardOutputModes,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "backtests.run",
|
|
116
|
+
kind: "mutation",
|
|
117
|
+
visibility: publicRuntimeVisibility,
|
|
118
|
+
description: "Executa um backtest para uma estratégia e ativo.",
|
|
119
|
+
http: {
|
|
120
|
+
method: "POST",
|
|
121
|
+
path: "/api/desk/tools/backtests/run",
|
|
122
|
+
inputMode: "json_body",
|
|
123
|
+
schemas: {
|
|
124
|
+
request: "BacktestRunRequest",
|
|
125
|
+
response: "BacktestRunResponse",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
cli: {
|
|
129
|
+
group: "backtests",
|
|
130
|
+
command: "run",
|
|
131
|
+
summary: "Executa um backtest individual.",
|
|
132
|
+
positional: [
|
|
133
|
+
{
|
|
134
|
+
kind: "positional",
|
|
135
|
+
name: "strategy_id",
|
|
136
|
+
type: "string",
|
|
137
|
+
required: true,
|
|
138
|
+
placeholder: "ESTRATEGIA",
|
|
139
|
+
description: "ID da estratégia, por exemplo ifr2.",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
kind: "positional",
|
|
143
|
+
name: "ticker",
|
|
144
|
+
type: "string",
|
|
145
|
+
required: true,
|
|
146
|
+
placeholder: "TICKER",
|
|
147
|
+
description: "Ticker do ativo, por exemplo PETR4.",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
options: [
|
|
151
|
+
{
|
|
152
|
+
kind: "option",
|
|
153
|
+
flag: "--timeframe",
|
|
154
|
+
name: "timeframe_id",
|
|
155
|
+
type: "enum",
|
|
156
|
+
required: false,
|
|
157
|
+
placeholder: "TIMEFRAME",
|
|
158
|
+
enumValues: backtestTimeframeValues,
|
|
159
|
+
description: "Timeframe do backtest.",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
kind: "option",
|
|
163
|
+
flag: "--from",
|
|
164
|
+
name: "start_date",
|
|
165
|
+
type: "string",
|
|
166
|
+
required: false,
|
|
167
|
+
placeholder: "AAAA-MM-DD",
|
|
168
|
+
description: "Data inicial em ISO.",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
kind: "option",
|
|
172
|
+
flag: "--to",
|
|
173
|
+
name: "end_date",
|
|
174
|
+
type: "string",
|
|
175
|
+
required: false,
|
|
176
|
+
placeholder: "AAAA-MM-DD",
|
|
177
|
+
description: "Data final em ISO.",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
kind: "option",
|
|
181
|
+
flag: "--capital",
|
|
182
|
+
name: "capital",
|
|
183
|
+
type: "number",
|
|
184
|
+
required: false,
|
|
185
|
+
placeholder: "VALOR",
|
|
186
|
+
description: "Capital inicial do backtest.",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "option",
|
|
190
|
+
flag: "--max-risk",
|
|
191
|
+
name: "max_risk",
|
|
192
|
+
type: "number",
|
|
193
|
+
required: false,
|
|
194
|
+
placeholder: "VALOR",
|
|
195
|
+
description: "Risco máximo do backtest.",
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
kind: "option",
|
|
199
|
+
flag: "--contracts",
|
|
200
|
+
name: "num_contracts",
|
|
201
|
+
type: "integer",
|
|
202
|
+
required: false,
|
|
203
|
+
placeholder: "N",
|
|
204
|
+
defaultValue: 5,
|
|
205
|
+
description: "Número de contratos para ativos que usam contratos.",
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
kind: "option",
|
|
209
|
+
flag: "--param",
|
|
210
|
+
name: "parameters",
|
|
211
|
+
type: "string_array",
|
|
212
|
+
required: false,
|
|
213
|
+
placeholder: "CHAVE=VALOR",
|
|
214
|
+
multiple: true,
|
|
215
|
+
collectionFormat: "repeatable",
|
|
216
|
+
description: "Parâmetro da estratégia. Pode ser repetido, por exemplo --param rsi=30.",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
kind: "option",
|
|
220
|
+
flag: "--params-json",
|
|
221
|
+
name: "parameters_json",
|
|
222
|
+
type: "string",
|
|
223
|
+
required: false,
|
|
224
|
+
placeholder: "JSON",
|
|
225
|
+
description: "Objeto JSON com parâmetros da estratégia.",
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
examples: [
|
|
229
|
+
"quantbrasil backtests run ifr2 PETR4 --timeframe D1 --from 2025-01-01 --to 2026-01-01",
|
|
230
|
+
"quantbrasil backtests run ifr2 PETR4 --timeframe D1 --param rsi=30 --param window=2 --json",
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
tool: {
|
|
234
|
+
name: "qb_backtests_run",
|
|
235
|
+
title: "Run backtest",
|
|
236
|
+
},
|
|
237
|
+
outputModes: standardOutputModes,
|
|
238
|
+
},
|
|
239
|
+
];
|
|
@@ -2,6 +2,8 @@ export * from "./types.js";
|
|
|
2
2
|
export * from "./shared.js";
|
|
3
3
|
export * from "./market.js";
|
|
4
4
|
export * from "./assets.js";
|
|
5
|
+
export * from "./news.js";
|
|
6
|
+
export * from "./backtests.js";
|
|
5
7
|
export * from "./rankings.js";
|
|
6
8
|
export * from "./screening.js";
|
|
7
9
|
export * from "./portfolios.js";
|
|
@@ -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,oBAAoB,CAAC;AACnC,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,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -2,6 +2,8 @@ export * from "./types.js";
|
|
|
2
2
|
export * from "./shared.js";
|
|
3
3
|
export * from "./market.js";
|
|
4
4
|
export * from "./assets.js";
|
|
5
|
+
export * from "./news.js";
|
|
6
|
+
export * from "./backtests.js";
|
|
5
7
|
export * from "./rankings.js";
|
|
6
8
|
export * from "./screening.js";
|
|
7
9
|
export * from "./portfolios.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const newsCapabilities: readonly [{
|
|
2
|
+
readonly id: "news.asset";
|
|
3
|
+
readonly kind: "read";
|
|
4
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
5
|
+
readonly description: "Retorna notícias recentes de RSS que mencionam diretamente um ativo da QuantBrasil.";
|
|
6
|
+
readonly http: {
|
|
7
|
+
readonly method: "POST";
|
|
8
|
+
readonly path: "/api/desk/tools/news/asset";
|
|
9
|
+
readonly inputMode: "json_body";
|
|
10
|
+
readonly schemas: {
|
|
11
|
+
readonly request: "AssetNewsRequest";
|
|
12
|
+
readonly response: "AssetNewsResponse";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly cli: {
|
|
16
|
+
readonly group: "news";
|
|
17
|
+
readonly command: "asset";
|
|
18
|
+
readonly summary: "Busca notícias recentes para um ticker.";
|
|
19
|
+
readonly positional: readonly [{
|
|
20
|
+
readonly kind: "positional";
|
|
21
|
+
readonly name: "ticker";
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly required: true;
|
|
24
|
+
readonly placeholder: "TICKER";
|
|
25
|
+
readonly description: "Ticker do ativo, por exemplo PETR4 ou VALE3.";
|
|
26
|
+
}];
|
|
27
|
+
readonly options: readonly [{
|
|
28
|
+
readonly kind: "option";
|
|
29
|
+
readonly flag: "--window";
|
|
30
|
+
readonly name: "window_days";
|
|
31
|
+
readonly type: "integer";
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly placeholder: "DIAS";
|
|
34
|
+
readonly defaultValue: 30;
|
|
35
|
+
readonly description: "Janela de busca em dias.";
|
|
36
|
+
}, {
|
|
37
|
+
readonly kind: "option";
|
|
38
|
+
readonly flag: "--limit";
|
|
39
|
+
readonly name: "limit";
|
|
40
|
+
readonly type: "integer";
|
|
41
|
+
readonly required: false;
|
|
42
|
+
readonly placeholder: "N";
|
|
43
|
+
readonly defaultValue: 20;
|
|
44
|
+
readonly description: "Número máximo de notícias retornadas.";
|
|
45
|
+
}];
|
|
46
|
+
readonly examples: readonly ["quantbrasil news asset PETR4", "quantbrasil news asset PETR4 --window 7 --limit 10", "quantbrasil news asset PETR4 --json"];
|
|
47
|
+
};
|
|
48
|
+
readonly tool: {
|
|
49
|
+
readonly name: "qb_news_asset";
|
|
50
|
+
readonly title: "Buscar notícias do ativo";
|
|
51
|
+
};
|
|
52
|
+
readonly outputModes: readonly ["json", "human"];
|
|
53
|
+
}];
|
|
54
|
+
//# sourceMappingURL=news.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"news.d.ts","sourceRoot":"","sources":["../../src/capabilities/news.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEuB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
|
+
export const newsCapabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "news.asset",
|
|
5
|
+
kind: "read",
|
|
6
|
+
visibility: publicRuntimeVisibility,
|
|
7
|
+
description: "Retorna notícias recentes de RSS que mencionam diretamente um ativo da QuantBrasil.",
|
|
8
|
+
http: {
|
|
9
|
+
method: "POST",
|
|
10
|
+
path: "/api/desk/tools/news/asset",
|
|
11
|
+
inputMode: "json_body",
|
|
12
|
+
schemas: {
|
|
13
|
+
request: "AssetNewsRequest",
|
|
14
|
+
response: "AssetNewsResponse",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
cli: {
|
|
18
|
+
group: "news",
|
|
19
|
+
command: "asset",
|
|
20
|
+
summary: "Busca notícias recentes para um ticker.",
|
|
21
|
+
positional: [
|
|
22
|
+
{
|
|
23
|
+
kind: "positional",
|
|
24
|
+
name: "ticker",
|
|
25
|
+
type: "string",
|
|
26
|
+
required: true,
|
|
27
|
+
placeholder: "TICKER",
|
|
28
|
+
description: "Ticker do ativo, por exemplo PETR4 ou VALE3.",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
kind: "option",
|
|
34
|
+
flag: "--window",
|
|
35
|
+
name: "window_days",
|
|
36
|
+
type: "integer",
|
|
37
|
+
required: false,
|
|
38
|
+
placeholder: "DIAS",
|
|
39
|
+
defaultValue: 30,
|
|
40
|
+
description: "Janela de busca em dias.",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
kind: "option",
|
|
44
|
+
flag: "--limit",
|
|
45
|
+
name: "limit",
|
|
46
|
+
type: "integer",
|
|
47
|
+
required: false,
|
|
48
|
+
placeholder: "N",
|
|
49
|
+
defaultValue: 20,
|
|
50
|
+
description: "Número máximo de notícias retornadas.",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
examples: [
|
|
54
|
+
"quantbrasil news asset PETR4",
|
|
55
|
+
"quantbrasil news asset PETR4 --window 7 --limit 10",
|
|
56
|
+
"quantbrasil news asset PETR4 --json",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
tool: {
|
|
60
|
+
name: "qb_news_asset",
|
|
61
|
+
title: "Buscar notícias do ativo",
|
|
62
|
+
},
|
|
63
|
+
outputModes: standardOutputModes,
|
|
64
|
+
},
|
|
65
|
+
];
|