Remove remaining ftbot.state references

This commit is contained in:
Matthias 2021-08-28 11:43:20 +02:00
parent 1168b996da
commit a58f678757
2 changed files with 28 additions and 5 deletions

View File

@ -28,6 +28,7 @@ import {
ProfitInterface, ProfitInterface,
PairHistory, PairHistory,
LogLine, LogLine,
BacktestSteps,
} from '@/types'; } from '@/types';
import { import {
@ -76,6 +77,11 @@ export enum BotStoreGetters {
strategy = 'strategy', strategy = 'strategy',
strategyList = 'strategyList', strategyList = 'strategyList',
candleData = 'candleData', candleData = 'candleData',
backtestRunning = 'backtestRunning',
backtestStep = 'backtestStep',
backtestProgress = 'backtestProgress',
backtestHistory = 'backtestHistory',
selectedBacktestResultKey = 'selectedBacktestResultKey',
} }
export default { export default {
@ -210,6 +216,22 @@ export default {
[BotStoreGetters.history](state: FtbotStateType) { [BotStoreGetters.history](state: FtbotStateType) {
return state.history; return state.history;
}, },
[BotStoreGetters.backtestRunning](state: FtbotStateType): boolean {
return state.backtestRunning;
},
[BotStoreGetters.backtestStep](state: FtbotStateType): BacktestSteps {
return state.backtestStep;
},
[BotStoreGetters.backtestProgress](state: FtbotStateType): number {
return state.backtestProgress;
},
// TODO: type me
[BotStoreGetters.backtestHistory](state: FtbotStateType): {} {
return state.backtestHistory;
},
[BotStoreGetters.selectedBacktestResultKey](state: FtbotStateType): string {
return state.selectedBacktestResultKey;
},
}, },
mutations: { mutations: {
updateRefreshRequired(state: FtbotStateType, refreshRequired: boolean) { updateRefreshRequired(state: FtbotStateType, refreshRequired: boolean) {

View File

@ -298,6 +298,7 @@ import TimeframeSelect from '@/components/ftbot/TimeframeSelect.vue';
import { import {
BacktestPayload, BacktestPayload,
BacktestSteps,
BotState, BotState,
PairHistory, PairHistory,
PairHistoryPayload, PairHistoryPayload,
@ -351,17 +352,17 @@ export default class Backtesting extends Vue {
selectedPlotConfig: PlotConfig = getCustomPlotConfig(getPlotConfigName()); selectedPlotConfig: PlotConfig = getCustomPlotConfig(getPlotConfigName());
@ftbot.State backtestRunning!: boolean; @ftbot.Getter [BotStoreGetters.backtestRunning]!: boolean;
@ftbot.State backtestStep!: string; @ftbot.Getter [BotStoreGetters.backtestStep]!: BacktestSteps;
@ftbot.Getter [BotStoreGetters.botState]?: BotState; @ftbot.Getter [BotStoreGetters.botState]?: BotState;
@ftbot.State backtestProgress!: number; @ftbot.Getter [BotStoreGetters.backtestProgress]!: number;
@ftbot.State backtestHistory!: StrategyBacktestResult[]; @ftbot.Getter [BotStoreGetters.backtestHistory]!: StrategyBacktestResult[];
@ftbot.State selectedBacktestResultKey!: string; @ftbot.Getter [BotStoreGetters.selectedBacktestResultKey]!: string;
@ftbot.Getter [BotStoreGetters.history]!: PairHistory; @ftbot.Getter [BotStoreGetters.history]!: PairHistory;