From 0e2be93a3de2abe71ac2ab0b065d2c9224cde131 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 31 May 2020 13:13:19 +0200 Subject: [PATCH] Add visual marker for profit / loss trades --- src/components/ftbot/TradeList.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/ftbot/TradeList.vue b/src/components/ftbot/TradeList.vue index b3fa8465..979e6024 100644 --- a/src/components/ftbot/TradeList.vue +++ b/src/components/ftbot/TradeList.vue @@ -15,6 +15,12 @@ Forcesell + @@ -74,6 +80,10 @@ export default { formatPercent(value) { return `${(value * 100).toFixed(3)}%`; }, + profitSymbol(item) { + // Red arrow / green circle + return item.close_profit < 0 || item.current_profit < 0 ? `🔴` : `🟢`; + }, forcesellHandler(item) { this.forcesell(item.trade_id) .then(() => console.log('asdf')) @@ -81,6 +91,9 @@ export default { }, handleContextMenuEvent(item, index, event) { // stop browser context menu from appearing + if (!this.activeTrades) { + return; + } event.preventDefault(); // log the selected item to the console console.log(item); @@ -88,3 +101,6 @@ export default { }, }; + +