diff --git a/src/components/charts/CandleChartContainer.vue b/src/components/charts/CandleChartContainer.vue index 882d035c..2e98afd0 100644 --- a/src/components/charts/CandleChartContainer.vue +++ b/src/components/charts/CandleChartContainer.vue @@ -144,7 +144,9 @@ const dataset = computed((): PairHistory => { return botStore.activeBot.candleData[`${pair.value}__${props.timeframe}`]?.data; }); const strategyName = computed(() => props.strategy || dataset.value?.strategy || ''); -const datasetColumns = computed(() => (dataset.value ? dataset.value.columns : [])); +const datasetColumns = computed(() => + dataset.value ? dataset.value.all_columns ?? dataset.value.columns : [], +); const hasDataset = computed(() => dataset.value && dataset.value.data.length > 0); const isLoadingDataset = computed((): boolean => { if (props.historicView) { @@ -196,6 +198,7 @@ function refresh() { botStore.activeBot.getPairCandles({ pair: pair.value, timeframe: props.timeframe, + columns: plotStore.usedColumns, }); } } diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index edd16880..27fb4be2 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -1068,7 +1068,8 @@ export function createBotSubStore(botId: string, botName: string) { // TODO: check for active bot ... if (pair === this.selectedPair) { // Reload pair candles - this.getPairCandles({ pair, timeframe }); + const plotStore = usePlotConfigStore(); + this.getPairCandles({ pair, timeframe, columns: plotStore.usedColumns }); } break; } diff --git a/src/stores/plotConfig.ts b/src/stores/plotConfig.ts index 303c2986..43dcf6dd 100644 --- a/src/stores/plotConfig.ts +++ b/src/stores/plotConfig.ts @@ -39,6 +39,18 @@ export const usePlotConfigStore = defineStore('plotConfig', { ? state.editablePlotConfig : state.customPlotConfigs[state.plotConfigName]) || deepClone(EMPTY_PLOTCONFIG), // plotConfig: (state) => state.customPlotConfig[state.plotConfigName] || { ...EMPTY_PLOTCONFIG }, + usedColumns() { + const cols: string[] = []; + for (const key in this.plotConfig.main_plot) { + cols.push(key); + } + for (const key in this.plotConfig.subplots) { + for (const subkey in this.plotConfig.subplots[key]) { + cols.push(subkey); + } + } + return cols; + }, }, actions: { saveCustomPlotConfig(name: string, plotConfig: PlotConfig) {