From fdf16a0e5dcb6537b733a4f479c422182c8e9232 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 14 Sep 2020 20:24:24 +0200 Subject: [PATCH] Add chartView to trading view --- src/components/charts/CandleChart.vue | 2 +- .../charts/CandleChartContainer.vue | 4 +-- src/store/modules/ftbot.ts | 8 +++++ src/store/modules/layout.ts | 8 +++-- src/views/Graphs.vue | 8 +++-- src/views/Trading.vue | 35 +++++++++++++++++-- 6 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/components/charts/CandleChart.vue b/src/components/charts/CandleChart.vue index b935ee52..b657c9bb 100644 --- a/src/components/charts/CandleChart.vue +++ b/src/components/charts/CandleChart.vue @@ -504,7 +504,7 @@ export default class CandleChart extends Vue { } .echarts { width: 100%; - min-height: 820px; + min-height: 200px; /* TODO: height calculation is not working correctly - uses min-height for now */ /* height: 600px; */ height: 100%; diff --git a/src/components/charts/CandleChartContainer.vue b/src/components/charts/CandleChartContainer.vue index 7ac1b60a..a017d3d9 100644 --- a/src/components/charts/CandleChartContainer.vue +++ b/src/components/charts/CandleChartContainer.vue @@ -1,5 +1,5 @@ @@ -127,6 +146,7 @@ import TradeDetail from '@/components/ftbot/TradeDetail.vue'; import ReloadControl from '@/components/ftbot/ReloadControl.vue'; import LogViewer from '@/components/ftbot/LogViewer.vue'; import DraggableContainer from '@/components/layout/DraggableContainer.vue'; +import CandleChartContainer from '@/components/charts/CandleChartContainer.vue'; import { Trade } from '@/types'; import { BotStoreGetters } from '@/store/modules/ftbot'; @@ -150,17 +170,24 @@ const layoutNs = namespace('layout'); TradeDetail, ReloadControl, LogViewer, + CandleChartContainer, }, }) export default class Trading extends Vue { @ftbot.State detailTradeId!: number; - @ftbot.Getter openTrades!: Trade[]; + @ftbot.Getter [BotStoreGetters.openTrades]!: Trade[]; - @ftbot.Getter closedTrades!: Trade[]; + @ftbot.Getter [BotStoreGetters.closedTrades]!: Trade[]; + + @ftbot.Getter [BotStoreGetters.allTrades]!: Trade[]; @ftbot.Getter [BotStoreGetters.tradeDetail]!: Trade; + @ftbot.Getter [BotStoreGetters.timeframe]!: string; + + @ftbot.State whitelist!: string[]; + @layoutNs.Getter getTradingLayout!: GridItemData[]; @layoutNs.Mutation setTradingLayout; @@ -193,6 +220,10 @@ export default class Trading extends Vue { return findGridLayout(this.gridLayout, TradeLayout.logView); } + get gridLayoutChartView(): GridItemData { + return findGridLayout(this.gridLayout, TradeLayout.chartView); + } + layoutUpdatedEvent(newLayout) { this.setTradingLayout(newLayout); }