2020-05-04 18:34:59 +00:00
|
|
|
<template>
|
2020-05-06 17:38:52 +00:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-header">{{ title }}</div>
|
2020-05-08 05:14:55 +00:00
|
|
|
<div class="card-body">
|
|
|
|
<table v-if="trades" class="table table-sm table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>id</th>
|
|
|
|
<th>Pair</th>
|
|
|
|
<th>Amount</th>
|
|
|
|
<th>Stake amount</th>
|
|
|
|
<th>Open rate</th>
|
|
|
|
<th>{{ activeTrades ? 'Current rate' : 'Close rate' }}</th>
|
|
|
|
<th>{{ activeTrades ? 'Current Profit' : 'Profit' }}</th>
|
|
|
|
<th>Open date</th>
|
|
|
|
<th>Close date</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="(trade, index) in trades" :key="index">
|
|
|
|
<td>{{ trade.trade_id }}</td>
|
|
|
|
<td>{{ trade.pair }}</td>
|
|
|
|
<td>{{ trade.amount }}</td>
|
|
|
|
<td>{{ trade.stake_amount }}</td>
|
|
|
|
<td>{{ trade.open_rate }}</td>
|
|
|
|
<td>{{ activeTrades ? trade.current_rate : trade.close_rate }}</td>
|
|
|
|
<td>{{ activeTrades ? trade.current_profit : trade.close_profit.toFixed(3) }}%</td>
|
|
|
|
<td>{{ trade.open_date }}</td>
|
|
|
|
<td>{{ trade.close_date }}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2020-05-04 18:56:11 +00:00
|
|
|
</div>
|
2020-05-04 18:34:59 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'TradeList',
|
|
|
|
props: {
|
|
|
|
trades: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
2020-05-04 18:56:11 +00:00
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: 'Trades',
|
|
|
|
},
|
2020-05-06 17:38:52 +00:00
|
|
|
activeTrades: {
|
|
|
|
type: Boolean,
|
2020-05-06 19:20:33 +00:00
|
|
|
required: false,
|
2020-05-06 17:38:52 +00:00
|
|
|
default: false,
|
|
|
|
},
|
2020-05-04 18:34:59 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|