2020-05-17 21:41:38 +00:00
|
|
|
<template>
|
2020-08-18 06:29:40 +00:00
|
|
|
<GridLayout
|
|
|
|
class="h-100 w-100"
|
|
|
|
:row-height="50"
|
|
|
|
:layout="gridLayout"
|
2020-08-25 17:45:35 +00:00
|
|
|
:vertical-compact="false"
|
2020-12-21 18:39:55 +00:00
|
|
|
:margin="[5, 5]"
|
2021-05-28 17:07:34 +00:00
|
|
|
:is-resizable="!getLayoutLocked"
|
|
|
|
:is-draggable="!getLayoutLocked"
|
2020-08-18 06:29:40 +00:00
|
|
|
@layout-updated="layoutUpdatedEvent"
|
|
|
|
>
|
2020-08-17 05:10:33 +00:00
|
|
|
<GridItem
|
2020-08-29 14:43:50 +00:00
|
|
|
:i="gridLayoutBotControls.i"
|
|
|
|
:x="gridLayoutBotControls.x"
|
|
|
|
:y="gridLayoutBotControls.y"
|
|
|
|
:w="gridLayoutBotControls.w"
|
|
|
|
:h="gridLayoutBotControls.h"
|
2020-09-12 15:51:00 +00:00
|
|
|
drag-allow-from=".card-header"
|
2020-08-17 05:10:33 +00:00
|
|
|
>
|
2020-08-31 18:01:51 +00:00
|
|
|
<DraggableContainer header="Bot Controls">
|
2021-08-29 13:40:54 +00:00
|
|
|
<!-- <ReloadControl class="mr-3" /> -->
|
2020-08-31 18:01:51 +00:00
|
|
|
</DraggableContainer>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridItem>
|
|
|
|
<GridItem
|
2020-08-29 14:43:50 +00:00
|
|
|
:i="gridLayoutMultiPane.i"
|
|
|
|
:x="gridLayoutMultiPane.x"
|
|
|
|
:y="gridLayoutMultiPane.y"
|
|
|
|
:w="gridLayoutMultiPane.w"
|
|
|
|
:h="gridLayoutMultiPane.h"
|
2020-09-12 15:51:00 +00:00
|
|
|
drag-allow-from=".card-header"
|
2020-08-17 05:10:33 +00:00
|
|
|
>
|
2020-08-31 18:01:51 +00:00
|
|
|
<DraggableContainer header="Multi Pane">
|
2021-08-29 13:40:54 +00:00
|
|
|
<b-tabs content-class="mt-3" class="mt-1">
|
2020-11-20 06:08:24 +00:00
|
|
|
<b-tab title="Pairs combined" active>
|
2020-12-05 16:17:39 +00:00
|
|
|
<PairSummary :pairlist="whitelist" :current-locks="currentLocks" :trades="openTrades" />
|
2020-11-20 06:08:24 +00:00
|
|
|
</b-tab>
|
2021-08-30 17:57:42 +00:00
|
|
|
<b-tab title="General">
|
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
<BotControls class="mt-1 mb-2" />
|
|
|
|
</div>
|
2020-08-31 18:01:51 +00:00
|
|
|
<BotStatus />
|
|
|
|
</b-tab>
|
|
|
|
<b-tab title="Performance">
|
|
|
|
<Performance class="performance-view" />
|
|
|
|
</b-tab>
|
|
|
|
<b-tab title="Balance" lazy>
|
|
|
|
<Balance />
|
|
|
|
</b-tab>
|
|
|
|
<b-tab title="Daily Stats" lazy>
|
|
|
|
<DailyStats />
|
|
|
|
</b-tab>
|
|
|
|
|
|
|
|
<b-tab title="Pairlist" lazy>
|
|
|
|
<FTBotAPIPairList />
|
|
|
|
</b-tab>
|
2020-10-24 18:04:01 +00:00
|
|
|
<b-tab title="Pair Locks" lazy>
|
|
|
|
<PairLockList />
|
|
|
|
</b-tab>
|
2020-08-31 18:01:51 +00:00
|
|
|
</b-tabs>
|
|
|
|
</DraggableContainer>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridItem>
|
|
|
|
<GridItem
|
2020-08-29 14:43:50 +00:00
|
|
|
:i="gridLayoutOpenTrades.i"
|
|
|
|
:x="gridLayoutOpenTrades.x"
|
|
|
|
:y="gridLayoutOpenTrades.y"
|
|
|
|
:w="gridLayoutOpenTrades.w"
|
|
|
|
:h="gridLayoutOpenTrades.h"
|
2020-08-17 05:10:33 +00:00
|
|
|
drag-allow-from=".card-header"
|
|
|
|
>
|
2020-08-31 18:01:51 +00:00
|
|
|
<DraggableContainer header="Open Trades">
|
|
|
|
<TradeList
|
|
|
|
class="open-trades"
|
|
|
|
:trades="openTrades"
|
|
|
|
title="Open trades"
|
|
|
|
:active-trades="true"
|
|
|
|
empty-text="Currently no open trades."
|
|
|
|
/>
|
|
|
|
</DraggableContainer>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridItem>
|
|
|
|
<GridItem
|
2020-08-29 14:43:50 +00:00
|
|
|
:i="gridLayoutTradeHistory.i"
|
|
|
|
:x="gridLayoutTradeHistory.x"
|
|
|
|
:y="gridLayoutTradeHistory.y"
|
|
|
|
:w="gridLayoutTradeHistory.w"
|
|
|
|
:h="gridLayoutTradeHistory.h"
|
2020-08-17 05:10:33 +00:00
|
|
|
drag-allow-from=".card-header"
|
|
|
|
>
|
2020-08-31 18:01:51 +00:00
|
|
|
<DraggableContainer header="Closed Trades">
|
|
|
|
<TradeList
|
|
|
|
class="trade-history"
|
|
|
|
:trades="closedTrades"
|
|
|
|
title="Trade history"
|
|
|
|
empty-text="No closed trades so far."
|
|
|
|
/>
|
2020-09-01 05:51:03 +00:00
|
|
|
</DraggableContainer>
|
|
|
|
</GridItem>
|
|
|
|
<GridItem
|
|
|
|
v-if="detailTradeId"
|
|
|
|
:i="gridLayoutTradeDetail.i"
|
|
|
|
:x="gridLayoutTradeDetail.x"
|
|
|
|
:y="gridLayoutTradeDetail.y"
|
|
|
|
:w="gridLayoutTradeDetail.w"
|
|
|
|
:h="gridLayoutTradeDetail.h"
|
2020-09-30 13:33:07 +00:00
|
|
|
:min-h="4"
|
2020-09-01 05:51:03 +00:00
|
|
|
drag-allow-from=".card-header"
|
|
|
|
>
|
|
|
|
<DraggableContainer header="Trade Detail">
|
|
|
|
<TradeDetail :trade="tradeDetail"> </TradeDetail>
|
2020-08-31 18:01:51 +00:00
|
|
|
</DraggableContainer>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridItem>
|
|
|
|
<GridItem
|
2020-08-29 14:43:50 +00:00
|
|
|
:i="gridLayoutLogView.i"
|
|
|
|
:x="gridLayoutLogView.x"
|
|
|
|
:y="gridLayoutLogView.y"
|
|
|
|
:w="gridLayoutLogView.w"
|
|
|
|
:h="gridLayoutLogView.h"
|
2020-09-12 15:51:00 +00:00
|
|
|
drag-allow-from=".card-header"
|
2020-08-17 05:10:33 +00:00
|
|
|
>
|
2020-08-31 18:01:51 +00:00
|
|
|
<DraggableContainer header="Logs">
|
|
|
|
<LogViewer />
|
|
|
|
</DraggableContainer>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridItem>
|
2020-09-14 18:24:24 +00:00
|
|
|
<GridItem
|
|
|
|
:i="gridLayoutChartView.i"
|
|
|
|
:x="gridLayoutChartView.x"
|
|
|
|
:y="gridLayoutChartView.y"
|
|
|
|
:w="gridLayoutChartView.w"
|
|
|
|
:h="gridLayoutChartView.h"
|
2020-09-27 07:23:35 +00:00
|
|
|
:min-h="6"
|
2020-09-14 18:24:24 +00:00
|
|
|
drag-allow-from=".card-header"
|
|
|
|
>
|
|
|
|
<DraggableContainer header="Chart">
|
|
|
|
<CandleChartContainer
|
|
|
|
:available-pairs="whitelist"
|
|
|
|
:historic-view="!!false"
|
|
|
|
:timeframe="timeframe"
|
|
|
|
:trades="allTrades"
|
|
|
|
>
|
|
|
|
</CandleChartContainer>
|
|
|
|
</DraggableContainer>
|
|
|
|
</GridItem>
|
2020-08-17 05:10:33 +00:00
|
|
|
</GridLayout>
|
2020-05-17 21:41:38 +00:00
|
|
|
</template>
|
|
|
|
|
2020-06-20 15:46:08 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
2020-06-29 19:14:16 +00:00
|
|
|
import { namespace } from 'vuex-class';
|
2020-08-29 09:38:43 +00:00
|
|
|
import { GridLayout, GridItem, GridItemData } from 'vue-grid-layout';
|
2020-05-17 21:41:38 +00:00
|
|
|
|
2020-05-18 15:41:58 +00:00
|
|
|
import TradeList from '@/components/ftbot/TradeList.vue';
|
|
|
|
import Performance from '@/components/ftbot/Performance.vue';
|
|
|
|
import BotControls from '@/components/ftbot/BotControls.vue';
|
|
|
|
import BotStatus from '@/components/ftbot/BotStatus.vue';
|
|
|
|
import Balance from '@/components/ftbot/Balance.vue';
|
|
|
|
import DailyStats from '@/components/ftbot/DailyStats.vue';
|
2020-05-22 12:43:32 +00:00
|
|
|
import FTBotAPIPairList from '@/components/ftbot/FTBotAPIPairList.vue';
|
2020-10-24 18:04:01 +00:00
|
|
|
import PairLockList from '@/components/ftbot/PairLockList.vue';
|
2020-10-31 08:40:40 +00:00
|
|
|
import PairSummary from '@/components/ftbot/PairSummary.vue';
|
2020-06-04 17:56:19 +00:00
|
|
|
import TradeDetail from '@/components/ftbot/TradeDetail.vue';
|
2020-06-12 17:40:18 +00:00
|
|
|
import ReloadControl from '@/components/ftbot/ReloadControl.vue';
|
2020-08-15 15:31:56 +00:00
|
|
|
import LogViewer from '@/components/ftbot/LogViewer.vue';
|
2020-08-31 18:01:51 +00:00
|
|
|
import DraggableContainer from '@/components/layout/DraggableContainer.vue';
|
2020-09-14 18:24:24 +00:00
|
|
|
import CandleChartContainer from '@/components/charts/CandleChartContainer.vue';
|
2020-06-29 18:43:54 +00:00
|
|
|
|
2020-12-05 16:06:26 +00:00
|
|
|
import { Lock, Trade } from '@/types';
|
2020-09-14 18:26:25 +00:00
|
|
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
2020-10-06 05:59:05 +00:00
|
|
|
import { TradeLayout, findGridLayout, LayoutGetters, LayoutActions } from '@/store/modules/layout';
|
2020-06-29 18:43:54 +00:00
|
|
|
|
|
|
|
const ftbot = namespace('ftbot');
|
2020-08-18 06:29:40 +00:00
|
|
|
const layoutNs = namespace('layout');
|
2020-05-17 21:41:38 +00:00
|
|
|
|
2020-06-20 15:46:08 +00:00
|
|
|
@Component({
|
2020-05-18 18:49:30 +00:00
|
|
|
components: {
|
2020-08-29 09:38:43 +00:00
|
|
|
GridLayout,
|
|
|
|
GridItem,
|
2020-08-31 18:01:51 +00:00
|
|
|
DraggableContainer,
|
2020-05-18 18:49:30 +00:00
|
|
|
TradeList,
|
|
|
|
Performance,
|
|
|
|
BotControls,
|
|
|
|
BotStatus,
|
|
|
|
Balance,
|
|
|
|
DailyStats,
|
2020-05-22 12:43:32 +00:00
|
|
|
FTBotAPIPairList,
|
2020-10-24 18:04:01 +00:00
|
|
|
PairLockList,
|
2020-10-31 08:40:40 +00:00
|
|
|
PairSummary,
|
2020-06-04 17:56:19 +00:00
|
|
|
TradeDetail,
|
2020-06-12 17:40:18 +00:00
|
|
|
ReloadControl,
|
2020-08-15 15:31:56 +00:00
|
|
|
LogViewer,
|
2020-09-14 18:24:24 +00:00
|
|
|
CandleChartContainer,
|
2020-05-18 18:49:30 +00:00
|
|
|
},
|
2020-06-20 15:46:08 +00:00
|
|
|
})
|
2020-06-29 18:43:54 +00:00
|
|
|
export default class Trading extends Vue {
|
2021-08-28 09:39:03 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.detailTradeId]!: number;
|
2020-06-29 18:43:54 +00:00
|
|
|
|
2020-09-14 18:24:24 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.openTrades]!: Trade[];
|
2020-06-29 18:43:54 +00:00
|
|
|
|
2020-09-14 18:24:24 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.closedTrades]!: Trade[];
|
|
|
|
|
|
|
|
@ftbot.Getter [BotStoreGetters.allTrades]!: Trade[];
|
2020-06-29 18:43:54 +00:00
|
|
|
|
2020-09-14 18:26:25 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.tradeDetail]!: Trade;
|
2020-08-17 05:10:33 +00:00
|
|
|
|
2020-09-14 18:24:24 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.timeframe]!: string;
|
|
|
|
|
2020-12-05 16:06:26 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.currentLocks]!: Lock[];
|
|
|
|
|
2021-08-28 09:39:03 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.whitelist]!: string[];
|
2020-09-14 18:24:24 +00:00
|
|
|
|
2020-10-06 05:59:05 +00:00
|
|
|
@layoutNs.Getter [LayoutGetters.getTradingLayout]!: GridItemData[];
|
2020-08-18 06:29:40 +00:00
|
|
|
|
2020-10-06 05:59:05 +00:00
|
|
|
@layoutNs.Action [LayoutActions.setTradingLayout];
|
2020-08-18 06:29:40 +00:00
|
|
|
|
2021-05-28 17:07:34 +00:00
|
|
|
@layoutNs.Getter [LayoutGetters.getLayoutLocked]: boolean;
|
|
|
|
|
2020-08-18 06:29:40 +00:00
|
|
|
get gridLayout(): GridItemData[] {
|
|
|
|
return this.getTradingLayout;
|
|
|
|
}
|
|
|
|
|
2020-08-29 14:43:50 +00:00
|
|
|
get gridLayoutBotControls(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.botControls);
|
|
|
|
}
|
|
|
|
|
|
|
|
get gridLayoutMultiPane(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.multiPane);
|
|
|
|
}
|
|
|
|
|
|
|
|
get gridLayoutOpenTrades(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.openTrades);
|
|
|
|
}
|
|
|
|
|
|
|
|
get gridLayoutTradeHistory(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.tradeHistory);
|
|
|
|
}
|
|
|
|
|
2020-09-01 05:51:03 +00:00
|
|
|
get gridLayoutTradeDetail(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.tradeDetail);
|
|
|
|
}
|
|
|
|
|
2020-08-29 14:43:50 +00:00
|
|
|
get gridLayoutLogView(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.logView);
|
|
|
|
}
|
|
|
|
|
2020-09-14 18:24:24 +00:00
|
|
|
get gridLayoutChartView(): GridItemData {
|
|
|
|
return findGridLayout(this.gridLayout, TradeLayout.chartView);
|
|
|
|
}
|
|
|
|
|
2020-08-18 06:29:40 +00:00
|
|
|
layoutUpdatedEvent(newLayout) {
|
|
|
|
this.setTradingLayout(newLayout);
|
|
|
|
}
|
2020-06-29 18:43:54 +00:00
|
|
|
}
|
2020-05-17 21:41:38 +00:00
|
|
|
</script>
|
|
|
|
|
2020-08-17 05:10:33 +00:00
|
|
|
<style scoped></style>
|