Closed trades should show max_stake_amount - so the calculations make sense

closes freqtrade/freqtrade#10314
This commit is contained in:
Matthias 2024-08-18 10:36:35 +02:00
parent 068a91c80d
commit 7a22df726f
2 changed files with 21 additions and 10 deletions

View File

@ -19,10 +19,14 @@ defineProps({
<ValuePair description="Open date">{{ timestampms(trade.open_timestamp) }}</ValuePair>
<ValuePair v-if="trade.enter_tag" description="Entry tag">{{ trade.enter_tag }}</ValuePair>
<ValuePair description="Stake"
<ValuePair v-if="trade.is_open" description="Stake"
>{{ formatPriceCurrency(trade.stake_amount, stakeCurrency) }}
{{ trade.leverage && trade.leverage !== 1 ? `(${trade.leverage}x)` : '' }}</ValuePair
>
<ValuePair v-if="!trade.is_open" description="Total Stake"
>{{ formatPriceCurrency(trade.max_stake_amount ?? trade.stake_amount, stakeCurrency) }}
{{ trade.leverage && trade.leverage !== 1 ? `(${trade.leverage}x)` : '' }}</ValuePair
>
<ValuePair description="Amount">{{ trade.amount }}</ValuePair>
<ValuePair description="Open Rate">{{ formatPrice(trade.open_rate) }}</ValuePair>
<ValuePair v-if="trade.is_open && trade.current_rate" description="Current Rate">{{

View File

@ -36,11 +36,6 @@ const confirmExitText = ref('');
const confirmExitValue = ref<ModalReasons | null>(null);
const increasePosition = ref({ visible: false, trade: {} as Trade });
const openFields: TableField[] = [{ key: 'actions' }];
const closedFields: TableField[] = [
{ key: 'close_timestamp', label: 'Close date' },
{ key: 'exit_reason', label: 'Close Reason' },
];
function formatPriceWithDecimals(price) {
return formatPrice(price, botStore.activeBot.stakeCurrencyDecimals);
}
@ -53,14 +48,26 @@ const rows = computed(() => {
const tableFields = ref<any[]>([]);
onMounted(() => {
const openFields: TableField[] = [{ key: 'actions' }];
const closedFields: TableField[] = [
{ key: 'close_timestamp', label: 'Close date' },
{ key: 'exit_reason', label: 'Close Reason' },
];
const stakeAmountCol: TableField = props.activeTrades
? {
key: 'stake_amount',
label: 'Stake amount',
}
: {
key: 'max_stake_amount',
label: 'Total stake amount',
};
tableFields.value = [
{ key: 'trade_id', label: 'ID' },
{ key: 'pair', label: 'Pair' },
{ key: 'amount', label: 'Amount' },
{
key: 'stake_amount',
label: 'Stake amount',
},
stakeAmountCol,
{
key: 'open_rate',
label: 'Open rate',