Load from strategy should be part of plotconfig

This commit is contained in:
Matthias 2020-07-28 20:39:58 +02:00
parent c78dc26aba
commit 3a6786b39d
2 changed files with 15 additions and 2 deletions

View File

@ -60,6 +60,10 @@
Add
</b-button>
<b-button class="mx-1" variant="primary" @click="loadPlotConfig" size="sm">Load</b-button>
<b-button class="mx-1" variant="primary" @click="loadPlotConfigFromStrategy" size="sm">
Load from strategy
</b-button>
<b-button
class="mx-1"
variant="primary"
@ -121,6 +125,10 @@ export default class PlotConfigurator extends Vue {
return this.plotConfig;
}
@ftbot.Action getPlotConfig;
@ftbot.State strategyPlotConfig;
plotConfig: PlotConfig = EMPTY_PLOTCONFIG;
plotOption = 'main_plot';
@ -231,6 +239,11 @@ export default class PlotConfigurator extends Vue {
this.emitPlotConfig();
}
}
async loadPlotConfigFromStrategy() {
await this.getPlotConfig();
this.plotConfig = this.strategyPlotConfig;
}
}
</script>

View File

@ -40,7 +40,7 @@ export default {
detailTradeId: null,
candleData: {},
history: {},
plotConfig: {},
strategyPlotConfig: {},
customPlotConfig: { ...EMPTY_PLOTCONFIG },
},
getters: {
@ -105,7 +105,7 @@ export default {
state.history = { [`${pair}__${timeframe}`]: data };
},
updatePlotConfig(state, plotConfig: PlotConfig) {
state.plotConfig = plotConfig;
state.strategyPlotConfig = plotConfig;
},
saveCustomPlotConfig(state, plotConfig: PlotConfig) {
state.customPlotConfig = plotConfig;