Fix table column formatting

This commit is contained in:
Matthias 2020-08-17 19:55:43 +02:00
parent 9e77a4cdba
commit bf1495b26c
2 changed files with 6 additions and 6 deletions

View File

@ -3,11 +3,11 @@
<ValuePair description="TradeId">{{ trade.trade_id }}</ValuePair>
<ValuePair description="Pair">{{ trade.pair }}</ValuePair>
<ValuePair description="Stoploss">
{{ formatPercent(trade.stop_loss_pct / 100) }} |
{{ formatPercent(trade.stop_loss_ratio) }} |
{{ formatPrice(trade.stop_loss) }}
</ValuePair>
<ValuePair description="Initial Stoploss">
{{ formatPercent(trade.initial_stop_loss_pct / 100) }} |
{{ formatPercent(trade.initial_stop_loss_ratio) }} |
{{ formatPrice(trade.initial_stop_loss) }}
</ValuePair>
<ValuePair description="Current stoploss dist">
@ -26,7 +26,7 @@
{{ timestampms(trade.stoploss_last_update_timestamp) }}
</ValuePair>
<ValuePair description="Current profit" v-if="trade.current_profit_abs">
{{ trade.current_profit_abs }}
{{ trade.current_profit_abs }} ({{ formatPercent(trade.current_profit) }})
</ValuePair>
</b-card>
</template>

View File

@ -72,6 +72,8 @@ export default class TradeList extends Vue {
currentPage = 1;
formatPercent = formatPercent;
get rows(): number {
return this.trades.length;
}
@ -90,7 +92,7 @@ export default class TradeList extends Vue {
},
{
key: this.activeTrades ? 'current_profit' : 'close_profit',
label: this.activeTrades ? 'Current profit' : 'Profit',
label: this.activeTrades ? 'Current profit %' : 'Profit %',
formatter: 'formatPercent',
},
{ key: 'open_date', label: 'Open date' },
@ -98,8 +100,6 @@ export default class TradeList extends Vue {
...(this.activeTrades ? [{ key: 'actions' }] : []),
];
formatPercent;
profitSymbol(item) {
// Red arrow / green circle
return item.close_profit < 0 || item.current_profit < 0 ? `&#x1F534;` : `&#x1F7E2;`;