mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Enhance profit symbol
This commit is contained in:
parent
87ae547cef
commit
10adfd9394
|
@ -1,24 +1,39 @@
|
||||||
<template>
|
<template>
|
||||||
<span>{{ isProfitable ? '🔴' : '🟢' }}</span>
|
<div class="h-100 d-inline-block">
|
||||||
|
<div :class="isProfitable ? 'triangle-up' : 'triangle-down'"></div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue, Prop } from 'vue-property-decorator';
|
import { Component, Vue, Prop } from 'vue-property-decorator';
|
||||||
import { Trade } from '@/types';
|
import { Trade } from '@/types';
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
@Component({})
|
@Component({})
|
||||||
export default class ProfitSymbol extends Vue {
|
export default class ProfitSymbol extends Vue {
|
||||||
@Prop({ required: true }) trade!: Trade;
|
@Prop({ required: true }) trade!: Trade;
|
||||||
|
|
||||||
get isProfitable() {
|
get isProfitable() {
|
||||||
console.log(this.trade);
|
console.log(this.trade);
|
||||||
const res = (this.trade.close_profit ?? 1) < 0 || (this.trade.current_profit ?? 1) < 0;
|
const res = (this.trade.close_profit ?? 0) > 0 || (this.trade.current_profit ?? 0) > 0;
|
||||||
console.log(res);
|
console.log(res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.triangle-up {
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0 0.5rem 0.9rem 0.5rem;
|
||||||
|
border-color: transparent transparent #00db58 transparent;
|
||||||
|
}
|
||||||
|
.triangle-down {
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0.9rem 0.5rem 0 0.5rem;
|
||||||
|
border-color: #ff0000 transparent transparent transparent;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user