diff --git a/src/components/ftbot/BacktestResultView.vue b/src/components/ftbot/BacktestResultView.vue index 8a203301..0b657cc0 100644 --- a/src/components/ftbot/BacktestResultView.vue +++ b/src/components/ftbot/BacktestResultView.vue @@ -87,14 +87,21 @@ const getSortedTrades = (backtestResult: StrategyBacktestResult): Trade[] => { const bestPair = computed((): string => { const trades = getSortedTrades(props.backtestResult); + if (trades.length === 0) { + return 'N/A'; + } const value = trades[trades.length - 1]; return `${value.pair} ${formatPercent(value.profit_ratio, 2)}`; }); const worstPair = computed((): string => { const trades = getSortedTrades(props.backtestResult); + if (trades.length === 0) { + return 'N/A'; + } const value = trades[0]; return `${value.pair} ${formatPercent(value.profit_ratio, 2)}`; }); + const backtestResultStats = computed(() => { // Transpose Result into readable format const shortMetrics =