Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

extend dashboard trades overview with trade slippage #1121

Merged
merged 2 commits into from
Jan 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion templates/dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
<th>TYPE</th>
<th>AMOUNT</th>
<th>PRICE</th>
<th>SLIPPAGE</th>
<th>DATE</th>
<th>EXECUTED DATE</th>
</tr>
Expand All @@ -195,6 +196,7 @@
<td><span class='text-success'>BUY</span></td>
<td><%= buy_order.size %> <%= asset.toUpperCase() %></td>
<td><%= buy_order.price %> <%= currency.toUpperCase() %></td>
<td></td>
<td><%= new Date(buy_order.time).toLocaleString("en-US", { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) %></td>
<td><span class='text-info'>Waiting</span></td>
</tr>
Expand All @@ -204,6 +206,7 @@
<td><span class='text-danger'>SELL</span></td>
<td><%= sell_order.size %> <%= asset.toUpperCase() %></td>
<td><%= sell_order.price %> <%= currency.toUpperCase() %></td>
<td></td>
<td><%= new Date(sell_order.time).toLocaleString("en-US", { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) %></td>
<td><span class='text-info'>Waiting</span></td>
</tr>
Expand All @@ -214,14 +217,15 @@
<td><span class='text-<% if (trade.type == "buy") { %>success<% } else { %>danger<% } %>'><%= trade.type.toUpperCase() %></td>
<td><%= trade.size %> <%= asset.toUpperCase() %></td>
<td><%= trade.price %> <%= currency.toUpperCase() %></td>
<td><%= new Intl.NumberFormat("en-US", {style: "percent", maximumSignificantDigits: 4}).format(trade.slippage) %></td>
<td><%= new Date(trade.time).toLocaleString("en-US", { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) %></td>
<td><%= new Date(trade.time + trade.execution_time).toLocaleString("en-US", { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) %></td>
</tr>
<% }); %>
<% } %>

<% if (!(typeof buy_order != "undefined" || typeof sell_order != "undefined") && !my_trades) { %>
<tr><td colspan="5" class="text-center">There is no trades at the moment</td></tr>
<tr><td colspan="6" class="text-center">There is no trades at the moment</td></tr>
<% } %>
</tbody>
</table>
Expand Down