From 5c6abdcabc221fe54b1ac8b7eaec6dd5040bd2e7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 25 Jul 2023 20:05:00 +0200 Subject: [PATCH] Add Max consecutive metrics --- src/components/ftbot/BacktestResultAnalysis.vue | 7 +++++++ src/types/backtest.ts | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ftbot/BacktestResultAnalysis.vue b/src/components/ftbot/BacktestResultAnalysis.vue index 8329be18..bf03502e 100644 --- a/src/components/ftbot/BacktestResultAnalysis.vue +++ b/src/components/ftbot/BacktestResultAnalysis.vue @@ -238,6 +238,13 @@ const backtestResultStats = computed(() => { metric: 'Avg. Duration Losers', value: humanizeDurationFromSeconds(props.backtestResult.loser_holding_avg_s), }, + { + metric: 'Max Consecutive Wins / Loss', + value: + props.backtestResult.max_consecutive_wins === undefined + ? 'N/A' + : `${props.backtestResult.max_consecutive_wins} / ${props.backtestResult.max_consecutive_losses}`, + }, { metric: 'Rejected entry signals', value: props.backtestResult.rejected_signals }, { metric: 'Entry/Exit timeouts', diff --git a/src/types/backtest.ts b/src/types/backtest.ts index d5da84b1..986c7198 100644 --- a/src/types/backtest.ts +++ b/src/types/backtest.ts @@ -140,7 +140,6 @@ export interface StrategyBacktestResult { canceled_entry_orders?: number; replaced_entry_orders?: number; - // Daily stats ... draw_days: number; drawdown_end: string; drawdown_end_ts: number; @@ -148,6 +147,8 @@ export interface StrategyBacktestResult { drawdown_start_ts: number; loser_holding_avg: string; loser_holding_avg_s: number; + max_consecutive_wins?: number; + max_consecutive_losses?: number; losing_days: number; max_drawdown: number; max_drawdown_account: number;