quantbrasil backtests ranking
Mostra o ranking semanal de backtests de uma estratégia
Sintaxe
quantbrasil backtests ranking <strategy-id>Esta é uma operação de leitura. Modos de saída: json, human.
Argumentos e opções
| Nome | Tipo | Obrigatório | Descrição | Padrão |
|---|---|---|---|---|
strategy-id | Argumento | Sim | ID ou nome da estratégia | — |
--timeframe <timeframe> | Opção | Não | Timeframe do ranking; o padrão é D1 ou o mais recente | — |
--setup <setup> | Opção | Não | Escolhe um dos rankings da estratégia, como SNIPER_IFR2 | — |
--sort <field> | Opção | Não | Ordenação: pct_profit (padrão), ev, drawdown, pct_gains, num_operations, profit_factor ou score | — |
--min-operations <n> | Opção | Não | Exclui ativos com menos de N operações | — |
--top <n> | Opção | Não | Número de ativos do topo do ranking | 10 |
--json | Opção | Não | Exibe saída JSON | — |
Exemplos
quantbrasil backtests ranking long_turnaround
quantbrasil backtests ranking ifr2 --setup SNIPER_IFR2 --sort ev --min-operations 10 --top 20 --jsonSaída (--json)
Estrutura da resposta retornada com --json:
export interface BacktestRankingResponse {
ok: boolean;
strategy: { id: string; label: string; side: "long" | "short" };
batch: BacktestRankingBatchOut | null;
sort_by: BacktestRankingSort;
min_operations: number | null;
total_assets: number;
matching_assets: number;
results: BacktestRankingRowOut[];
rankings: BacktestRankingOut[];
}
export interface BacktestRankingBatchOut {
id: number;
selected_setup_id: string;
timeframe_id: string;
is_premium: boolean;
parameters: { [key: string]: JsonValue };
created_at: string;
start_date: string | null;
end_date: string | null;
status: string | null;
complete: boolean;
}
export type BacktestRankingSort =
| "pct_profit"
| "ev"
| "drawdown"
| "pct_gains"
| "num_operations"
| "profit_factor"
| "score";
export interface BacktestRankingRowOut {
position: number;
ticker: string;
num_operations: number;
pct_gains: number;
pct_profit: number;
drawdown: number;
ev: number;
profit_factor: number | null;
score: number | null;
}
export interface BacktestRankingOut {
selected_setup_id: string;
timeframe_id: string;
is_premium: boolean;
batch_created_at: string;
batch_status: string | null;
}Exemplo de resposta
{
"ok": true,
"strategy": {
"id": "long_turnaround",
"label": "Turnaround",
"side": "long"
},
"batch": {
"id": 15521,
"selected_setup_id": "CLASSIC_LONG_TURNAROUND",
"timeframe_id": "D1",
"is_premium": false,
"parameters": {
"window": 2,
"exhaustion_pct": 0.005,
"negative_sequence": 3
},
"created_at": "2026-11-14T08:55:00Z",
"start_date": "2025-11-14",
"end_date": "2026-11-15",
"status": "completed",
"complete": true
},
"sort_by": "pct_profit",
"min_operations": null,
"total_assets": 247,
"matching_assets": 247,
"results": [
{
"position": 1,
"ticker": "AURA33",
"num_operations": 12,
"pct_gains": 0.75,
"pct_profit": 0.4762,
"drawdown": 0.0634,
"ev": 0.0397,
"profit_factor": null,
"score": 81.81
},
{
"position": 2,
"ticker": "VAMO3",
"num_operations": 19,
"pct_gains": 0.6316,
"pct_profit": 0.4734,
"drawdown": 0.0801,
"ev": 0.0249,
"profit_factor": null,
"score": null
},
{
"position": 3,
"ticker": "AMOB3",
"num_operations": 15,
"pct_gains": 0.6667,
"pct_profit": 0.4082,
"drawdown": 0.0711,
"ev": 0.0272,
"profit_factor": null,
"score": 78.78
}
],
"rankings": [
{
"selected_setup_id": "CLASSIC_LONG_TURNAROUND",
"timeframe_id": "D1",
"is_premium": false,
"batch_created_at": "2026-11-14T08:55:00Z",
"batch_status": "completed"
}
]
}