Add visual marker for profit / loss trades

This commit is contained in:
Matthias 2020-05-31 13:13:19 +02:00
parent 3d6fb799b2
commit 0e2be93a3d

View File

@ -15,6 +15,12 @@
Forcesell Forcesell
</b-button> </b-button>
</template> </template>
<template v-slot:cell(pair)="row">
<span class="mr-1" v-html="profitSymbol(row.item)"></span>
<span>
{{ row.item.pair }}
</span>
</template>
</b-table> </b-table>
</div> </div>
</div> </div>
@ -74,6 +80,10 @@ export default {
formatPercent(value) { formatPercent(value) {
return `${(value * 100).toFixed(3)}%`; return `${(value * 100).toFixed(3)}%`;
}, },
profitSymbol(item) {
// Red arrow / green circle
return item.close_profit < 0 || item.current_profit < 0 ? `&#x1F534;` : `&#x1F7E2;`;
},
forcesellHandler(item) { forcesellHandler(item) {
this.forcesell(item.trade_id) this.forcesell(item.trade_id)
.then(() => console.log('asdf')) .then(() => console.log('asdf'))
@ -81,6 +91,9 @@ export default {
}, },
handleContextMenuEvent(item, index, event) { handleContextMenuEvent(item, index, event) {
// stop browser context menu from appearing // stop browser context menu from appearing
if (!this.activeTrades) {
return;
}
event.preventDefault(); event.preventDefault();
// log the selected item to the console // log the selected item to the console
console.log(item); console.log(item);
@ -88,3 +101,6 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
</style>