mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
Add backtest stopping support
This commit is contained in:
parent
d24cdd4fac
commit
b26a484c35
|
@ -622,7 +622,16 @@ export default {
|
|||
commit('resetBacktestHistory');
|
||||
try {
|
||||
const result = await api.delete('/backtest');
|
||||
commit('updateBacktestRunning', result.data.running);
|
||||
commit('updateBacktestRunning', result.data);
|
||||
return Promise.resolve(result.data);
|
||||
} catch (err) {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
},
|
||||
async stopBacktest({ commit }) {
|
||||
try {
|
||||
const result = await api.get('/backtest/abort');
|
||||
commit('updateBacktestRunning', result.data);
|
||||
return Promise.resolve(result.data);
|
||||
} catch (err) {
|
||||
return Promise.reject(err);
|
||||
|
|
|
@ -190,6 +190,13 @@
|
|||
>
|
||||
Load backtest result
|
||||
</b-button>
|
||||
<b-button
|
||||
variant="primary"
|
||||
class="mx-1"
|
||||
:disabled="!backtestRunning"
|
||||
@click="stopBacktest"
|
||||
>stop Backtest</b-button
|
||||
>
|
||||
<b-button
|
||||
variant="primary"
|
||||
class="mx-1"
|
||||
|
@ -363,13 +370,15 @@ export default class Backtesting extends Vue {
|
|||
|
||||
@ftbot.Action removeBacktest!: () => void;
|
||||
|
||||
@ftbot.Action stopBacktest!: () => void;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@ftbot.Mutation setBacktestResultKey!: (key: string) => void;
|
||||
|
||||
formatPercent = formatPercent;
|
||||
|
||||
get canRunBacktest() {
|
||||
return this.botState.runmode === RunModes.WEBSERVER;
|
||||
return this.botState?.runmode === RunModes.WEBSERVER;
|
||||
}
|
||||
|
||||
get hasBacktestResult() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user