Use strategy list

This commit is contained in:
Matthias 2020-08-08 20:21:47 +02:00
parent 870fd53d7b
commit 963fe902d2
2 changed files with 14 additions and 14 deletions

View File

@ -59,6 +59,7 @@ export interface StrategyBacktestResult {
stake_amount: number;
stake_currency: string;
max_open_trades: number;
timeframe: string;
total_trades: number;
trades_per_day: number;
winner_holding_avg: number;

View File

@ -2,17 +2,9 @@
<div class="container-fluid">
<h2>Backtesting</h2>
<div class="row ml-1">
<div class="col-mb-12">
<div class="row col-mb-6 mr-2">
<TimeRangeSelect v-model="timerange"></TimeRangeSelect>
</div>
<div class="col-mb-12">
<b-form-group
label="Strategy"
label-for="strategyName"
invalid-feedback="Strategy is required"
>
<b-form-input id="strategyName" v-model="strategy"></b-form-input>
</b-form-group>
<StrategyList v-model="strategy" class="col-md-2"></StrategyList>
</div>
</div>
<div class="row">
@ -55,7 +47,8 @@ import { Component, Vue, Watch } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import TimeRangeSelect from '@/components/ftbot/TimeRangeSelect.vue';
import BacktestResultView from '@/components/ftbot/BacktestResultView.vue';
import CandleChart from '@/components/charts/CandleChart.vue';
import CandleChart from '@/components/charts/CandleChartContainer.vue';
import StrategyList from '@/components/ftbot/StrategyList.vue';
import {
BacktestPayload,
@ -69,15 +62,13 @@ import { getCustomPlotConfig, getPlotConfigName } from '@/shared/storage';
const ftbot = namespace('ftbot');
@Component({
components: { BacktestResultView, TimeRangeSelect, CandleChart },
components: { BacktestResultView, TimeRangeSelect, CandleChart, StrategyList },
})
export default class Backtesting extends Vue {
pair = 'XRP/USDT';
pollInterval: number | null = null;
timeframe = '5m';
timeframems = 300000;
strategy = 'BinHV45';
@ -108,6 +99,14 @@ export default class Backtesting extends Vue {
return this.backtestResult.strategy[this.strategy] || {};
}
get timeframe(): string {
try {
return this.backtestResult.strategy[this.strategy].timeframe;
} catch (err) {
return '';
}
}
get dataset() {
return this.history[`${this.pair}__${this.timeframe}`];
}