mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Create global "profit/loss" colors
This commit is contained in:
parent
be4a15c6fa
commit
1df87176bc
|
@ -25,6 +25,12 @@
|
||||||
:stake-currency="row.item.stakeCurrency"
|
:stake-currency="row.item.stakeCurrency"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #cell(winVsLoss)="row">
|
||||||
|
<div v-if="row.item.losses !== undefined">
|
||||||
|
<span class="text-profit">{{ row.item.wins }}</span> /
|
||||||
|
<span class="text-loss">{{ row.item.losses }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</b-table>
|
</b-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -58,20 +64,20 @@ export default class BotComparisonList extends Vue {
|
||||||
stakeCurrency: 'USDT',
|
stakeCurrency: 'USDT',
|
||||||
wins: 0,
|
wins: 0,
|
||||||
losses: 0,
|
losses: 0,
|
||||||
winVsLoss: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.entries(this.allProfit).forEach(([k, v]) => {
|
Object.entries(this.allProfit).forEach(([k, v]) => {
|
||||||
// TODO: handle one inactive bot ...
|
// TODO: handle one inactive bot ...
|
||||||
val.push({
|
val.push({
|
||||||
botId: this.allAvailableBots[k].botName,
|
botId: this.allAvailableBots[k].botName,
|
||||||
trades: `${this.allOpenTradeCount[k]} / ${this.allBotState[k]?.max_open_trades}`,
|
trades: `${this.allOpenTradeCount[k]} / ${this.allBotState[k]?.max_open_trades || 'N/A'}`,
|
||||||
profitClosed: v.profit_closed_coin,
|
profitClosed: v.profit_closed_coin,
|
||||||
profitClosedRatio: v.profit_closed_ratio_sum || 0,
|
profitClosedRatio: v.profit_closed_ratio_sum || 0,
|
||||||
stakeCurrency: this.allBotState[k]?.stake_currency || '',
|
stakeCurrency: this.allBotState[k]?.stake_currency || '',
|
||||||
profitOpenRatio: v.profit_all_ratio_sum - v.profit_closed_ratio_sum,
|
profitOpenRatio: v.profit_all_ratio_sum - v.profit_closed_ratio_sum,
|
||||||
profitOpen: v.profit_all_coin - v.profit_closed_coin,
|
profitOpen: v.profit_all_coin - v.profit_closed_coin,
|
||||||
winVsLoss: `${v.winning_trades || 'N/A'} / ${v.losing_trades || 'N/A'}`,
|
wins: v.winning_trades,
|
||||||
|
losses: v.losing_trades,
|
||||||
});
|
});
|
||||||
if (v.profit_closed_coin !== undefined) {
|
if (v.profit_closed_coin !== undefined) {
|
||||||
summary.profitClosed += v.profit_closed_coin;
|
summary.profitClosed += v.profit_closed_coin;
|
||||||
|
@ -81,7 +87,6 @@ export default class BotComparisonList extends Vue {
|
||||||
// summary.decimals = this.allBotState[k]?.stake_currency_decimals || summary.decimals;
|
// summary.decimals = this.allBotState[k]?.stake_currency_decimals || summary.decimals;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
summary.winVsLoss = `${summary.wins} / ${summary.losses}`;
|
|
||||||
val.push(summary);
|
val.push(summary);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,10 @@ export default class ProfitPill extends Vue {
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.profit-pill {
|
.profit-pill {
|
||||||
background: #ef5350;
|
background: $color-loss;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
.profit-pill-profit {
|
.profit-pill-profit {
|
||||||
background: #12bb7b;
|
background: $color-profit;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-profit {
|
||||||
|
color: $color-profit;
|
||||||
|
}
|
||||||
|
.text-loss {
|
||||||
|
color: $color-loss;
|
||||||
|
}
|
||||||
|
|
||||||
[data-theme="dark"] {
|
[data-theme="dark"] {
|
||||||
$bg-dark: #3c3c3c;
|
$bg-dark: #3c3c3c;
|
||||||
$bg-darker: darken($bg-dark, 5%);
|
$bg-darker: darken($bg-dark, 5%);
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
// variables created for the project and not overwrite of bootstrap
|
// variables created for the project and not overwrite of bootstrap
|
||||||
$fontsize-small: 0.9rem;
|
$fontsize-small: 0.9rem;
|
||||||
|
|
||||||
|
$color-profit: #12bb7b;
|
||||||
|
$color-loss: #ef5350;
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
</b-card>
|
</b-card>
|
||||||
<b-card header="Won / lost trades">
|
<b-card header="Won / lost trades">
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<span class="text-success">{{ profit.winning_trades }}</span> /
|
<span class="text-profit">{{ profit.winning_trades }}</span> /
|
||||||
<span class="text-danger">{{ profit.losing_trades }}</span>
|
<span class="text-loss">{{ profit.losing_trades }}</span>
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
</b-card>
|
</b-card>
|
||||||
<b-card header="Last trade">
|
<b-card header="Last trade">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user