mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-25 12:35:15 +00:00
fix: Update pair profit calculation in backtest-resultChart
closes freqtrade/freqtrade#10651
This commit is contained in:
parent
c971a9b7f9
commit
50678f6ce8
|
@ -62,6 +62,7 @@ const navigateChartToTrade = (trade: Trade) => {
|
||||||
style="max-height: calc(100vh - 200px)"
|
style="max-height: calc(100vh - 200px)"
|
||||||
:pairlist="backtestResult.pairlist"
|
:pairlist="backtestResult.pairlist"
|
||||||
:trades="backtestResult.trades"
|
:trades="backtestResult.trades"
|
||||||
|
:starting-balance="backtestResult.starting_balance"
|
||||||
sort-method="profit"
|
sort-method="profit"
|
||||||
:backtest-mode="true"
|
:backtest-mode="true"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -22,6 +22,7 @@ const props = defineProps({
|
||||||
trades: { required: true, type: Array as () => Trade[] },
|
trades: { required: true, type: Array as () => Trade[] },
|
||||||
sortMethod: { default: 'normal', type: String },
|
sortMethod: { default: 'normal', type: String },
|
||||||
backtestMode: { required: false, default: false, type: Boolean },
|
backtestMode: { required: false, default: false, type: Boolean },
|
||||||
|
startingBalance: { required: false, type: Number, default: 0 },
|
||||||
});
|
});
|
||||||
const botStore = useBotStore();
|
const botStore = useBotStore();
|
||||||
const combinedPairList = computed(() => {
|
const combinedPairList = computed(() => {
|
||||||
|
@ -46,6 +47,9 @@ const combinedPairList = computed(() => {
|
||||||
profit += trade.profit_ratio;
|
profit += trade.profit_ratio;
|
||||||
profitAbs += trade.profit_abs ?? 0;
|
profitAbs += trade.profit_abs ?? 0;
|
||||||
});
|
});
|
||||||
|
if (props.sortMethod == 'profit' && props.startingBalance) {
|
||||||
|
profit = profitAbs / props.startingBalance;
|
||||||
|
}
|
||||||
const tradeCount = trades.length;
|
const tradeCount = trades.length;
|
||||||
const trade = tradeCount ? trades[0] : undefined;
|
const trade = tradeCount ? trades[0] : undefined;
|
||||||
if (trades.length > 0) {
|
if (trades.length > 0) {
|
||||||
|
@ -112,7 +116,7 @@ const combinedPairList = computed(() => {
|
||||||
button
|
button
|
||||||
class="d-flex justify-content-between align-items-center py-1"
|
class="d-flex justify-content-between align-items-center py-1"
|
||||||
:active="comb.pair === botStore.activeBot.selectedPair"
|
: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"
|
@click="botStore.activeBot.selectedPair = comb.pair"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user