mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Add botname to tradeslog
This commit is contained in:
parent
8eada44433
commit
3470cb2c16
|
@ -62,7 +62,7 @@ export default class TradesLogChart extends Vue {
|
||||||
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));
|
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));
|
||||||
for (let i = 0, len = sortedTrades.length; i < len; i += 1) {
|
for (let i = 0, len = sortedTrades.length; i < len; i += 1) {
|
||||||
const trade = sortedTrades[i];
|
const trade = sortedTrades[i];
|
||||||
const entry = [i, (trade.profit_ratio * 100).toFixed(2), trade.pair];
|
const entry = [i, (trade.profit_ratio * 100).toFixed(2), trade.pair, trade.botName];
|
||||||
res.push(entry);
|
res.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ export default class TradesLogChart extends Vue {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
formatter: (params) => {
|
formatter: (params) => {
|
||||||
return `Profit %<br>${params[0].data[1]} % ${params[0].data[2]}`;
|
return `Profit %<br>${params[0].data[1]} % ${params[0].data[2]} | ${params[0].data[3]}`;
|
||||||
},
|
},
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|
|
@ -196,7 +196,7 @@ export default function createBotStore(store) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('add bot', bot);
|
console.log('add bot', bot);
|
||||||
store.registerModule(['ftbot', bot.botId], createBotSubStore(bot.botId));
|
store.registerModule(['ftbot', bot.botId], createBotSubStore(bot.botId, bot.botName));
|
||||||
dispatch(`${bot.botId}/botAdded`);
|
dispatch(`${bot.botId}/botAdded`);
|
||||||
commit('addBot', bot);
|
commit('addBot', bot);
|
||||||
},
|
},
|
||||||
|
|
|
@ -139,10 +139,9 @@ export enum BotStoreActions {
|
||||||
logout = 'logout',
|
logout = 'logout',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBotSubStore(botId: string) {
|
export function createBotSubStore(botId: string, botName: string) {
|
||||||
const userService = useUserService(botId);
|
const userService = useUserService(botId);
|
||||||
const { api } = useApi(userService, botId);
|
const { api } = useApi(userService, botId);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state,
|
state,
|
||||||
|
@ -524,6 +523,7 @@ export function createBotSubStore(botId: string) {
|
||||||
trades = trades.map((t) => ({
|
trades = trades.map((t) => ({
|
||||||
...t,
|
...t,
|
||||||
botId,
|
botId,
|
||||||
|
botName,
|
||||||
botTradeId: `${botId}__${t.trade_id}`,
|
botTradeId: `${botId}__${t.trade_id}`,
|
||||||
}));
|
}));
|
||||||
commit('updateTrades', { trades, tradesCount });
|
commit('updateTrades', { trades, tradesCount });
|
||||||
|
@ -579,6 +579,7 @@ export function createBotSubStore(botId: string) {
|
||||||
const openTrades = result.data.map((t) => ({
|
const openTrades = result.data.map((t) => ({
|
||||||
...t,
|
...t,
|
||||||
botId,
|
botId,
|
||||||
|
botName,
|
||||||
botTradeId: `${botId}__${t.trade_id}`,
|
botTradeId: `${botId}__${t.trade_id}`,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
export interface Trade {
|
export interface Trade {
|
||||||
/**
|
/**
|
||||||
* BotId - only available on "all" methods.
|
* corresponds to the UI (ftbot.1) - does NOT relate to the backend!
|
||||||
* corresponds to the UI (ftbot.1) - does NOT relate to the backend
|
|
||||||
*/
|
*/
|
||||||
botId: string;
|
botId: string;
|
||||||
|
/**
|
||||||
|
* Corresponds to the UI botID + tradeid. Does not relate to backend!
|
||||||
|
*/
|
||||||
botTradeId: string;
|
botTradeId: string;
|
||||||
|
/**
|
||||||
|
* Given bot Name (in the UI). Does not relate to backend!
|
||||||
|
*/
|
||||||
|
botName: string;
|
||||||
trade_id: number;
|
trade_id: number;
|
||||||
pair: string;
|
pair: string;
|
||||||
is_open: boolean;
|
is_open: boolean;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user