Improve tooltip formatting

This commit is contained in:
Matthias 2023-10-10 07:09:18 +02:00
parent 2c6de162c9
commit 353aae5cab

View File

@ -11,7 +11,14 @@ function buildTooltipCost(trade: Trade, order: Order | BTOrder): string {
}
function buildToolTip(trade: Trade, order: Order | BTOrder, side: string): string {
return `${trade.is_short ? 'Short' : 'Long'} ${side} ${formatPercent(trade.profit_ratio)}
return `${trade.is_short ? 'Short' : 'Long'} ${side}
${formatPercent(trade.profit_ratio)} ${
trade.profit_abs
? '(' +
formatPriceCurrency(trade.profit_abs, trade.quote_currency ?? '<stake_currency>') +
')'
: ''
}
${buildTooltipCost(trade, order)}
Enter-tag: ${trade.enter_tag ?? ''}
Exit-Tag: ${trade.exit_reason ?? ''}`;