Improve order tooltip rendering

closes #1804
This commit is contained in:
Matthias 2024-03-22 16:54:26 +01:00
parent 3d14f24429
commit a00bdf0774

View File

@ -16,13 +16,15 @@ function buildToolTip(
side: string, side: string,
quoteCurrency: string, quoteCurrency: string,
): string { ): string {
return `${trade.is_short ? 'Short' : 'Long'} ${side} let tooltip = `${trade.is_short ? 'Short' : 'Long'} ${side}
${formatPercent(trade.profit_ratio)} ${ ${formatPercent(trade.profit_ratio)} ${
trade.profit_abs ? '(' + formatPriceCurrency(trade.profit_abs, quoteCurrency) + ')' : '' trade.profit_abs ? '(' + formatPriceCurrency(trade.profit_abs, quoteCurrency) + ')' : ''
} }
${buildTooltipCost(order, quoteCurrency)} ${buildTooltipCost(order, quoteCurrency)}
Enter-tag: ${trade.enter_tag ?? ''} Enter-tag: ${trade.enter_tag ?? ''}`;
Exit-Tag: ${trade.exit_reason ?? ''}`; tooltip += `${'ft_order_tag' in order && order.ft_order_tag && trade.enter_tag != order.ft_order_tag ? '\nOrder-Tag: ' + order.ft_order_tag : ''}`;
tooltip += `${trade.exit_reason ? '\nExit-Tag: ' + trade.exit_reason : ''}`;
return tooltip;
} }
function buildAdjustmentToolTip( function buildAdjustmentToolTip(
@ -30,9 +32,12 @@ function buildAdjustmentToolTip(
order: Order | BTOrder, order: Order | BTOrder,
quoteCurrency: string, quoteCurrency: string,
): string { ): string {
return `${trade.is_short ? 'Short' : 'Long'} adjustment let tooltip = `${trade.is_short ? 'Short' : 'Long'} adjustment
${buildTooltipCost(order, quoteCurrency)} ${buildTooltipCost(order, quoteCurrency)}
Enter-tag: ${trade.enter_tag ?? ''}`; Enter-tag: ${trade.enter_tag ?? ''}`;
tooltip += `${'ft_order_tag' in order && order.ft_order_tag ? '\nOrder-Tag: ' + order.ft_order_tag : ''}`;
return tooltip;
} }
const ADJUSTMENT_SYMBOL = const ADJUSTMENT_SYMBOL =