diff --git a/src/components/ftbot/BacktestResultChart.vue b/src/components/ftbot/BacktestResultChart.vue index c1b1a5c4..1565e14e 100644 --- a/src/components/ftbot/BacktestResultChart.vue +++ b/src/components/ftbot/BacktestResultChart.vue @@ -62,6 +62,7 @@ const navigateChartToTrade = (trade: Trade) => { style="max-height: calc(100vh - 200px)" :pairlist="backtestResult.pairlist" :trades="backtestResult.trades" + :starting-balance="backtestResult.starting_balance" sort-method="profit" :backtest-mode="true" /> diff --git a/src/components/ftbot/PairSummary.vue b/src/components/ftbot/PairSummary.vue index e38a7b14..5ea551b1 100644 --- a/src/components/ftbot/PairSummary.vue +++ b/src/components/ftbot/PairSummary.vue @@ -22,6 +22,7 @@ const props = defineProps({ trades: { required: true, type: Array as () => Trade[] }, sortMethod: { default: 'normal', type: String }, backtestMode: { required: false, default: false, type: Boolean }, + startingBalance: { required: false, type: Number, default: 0 }, }); const botStore = useBotStore(); const combinedPairList = computed(() => { @@ -46,6 +47,9 @@ const combinedPairList = computed(() => { profit += trade.profit_ratio; profitAbs += trade.profit_abs ?? 0; }); + if (props.sortMethod == 'profit' && props.startingBalance) { + profit = profitAbs / props.startingBalance; + } const tradeCount = trades.length; const trade = tradeCount ? trades[0] : undefined; if (trades.length > 0) { @@ -112,7 +116,7 @@ const combinedPairList = computed(() => { button class="d-flex justify-content-between align-items-center py-1" :active="comb.pair === botStore.activeBot.selectedPair" - :title="`${comb.pair} - ${comb.tradeCount} trades`" + :title="`${formatPriceCurrency(comb.profitAbs, botStore.activeBot.stakeCurrency, botStore.activeBot.stakeCurrencyDecimals)} - ${comb.pair} - ${comb.tradeCount} trades`" @click="botStore.activeBot.selectedPair = comb.pair" >