frequi_origin/src/components/ftbot/BacktestHistoryLoad.vue

44 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div>
<button
2022-10-30 13:26:23 +00:00
class="btn btn-secondary float-end"
title="Refresh"
aria-label="Refresh"
2022-04-19 05:05:34 +00:00
@click="botStore.activeBot.getBacktestHistory"
>
<i-mdi-refresh />
</button>
<p>
Load Historic results from disk. You can click on multiple results to load all of them into
freqUI.
</p>
<b-list-group v-if="botStore.activeBot.backtestHistoryList" class="ms-2">
<b-list-group-item
2022-04-19 05:05:34 +00:00
v-for="(res, idx) in botStore.activeBot.backtestHistoryList"
:key="idx"
class="d-flex justify-content-between align-items-center py-1 mb-1"
button
2022-04-19 05:05:34 +00:00
@click="botStore.activeBot.getBacktestHistoryResult(res)"
>
<strong>{{ res.strategy }}</strong>
backtested on: {{ timestampms(res.backtest_start_time * 1000) }}
<small>{{ res.filename }}</small>
</b-list-group-item>
</b-list-group>
</div>
</template>
2023-05-09 18:04:57 +00:00
<script setup lang="ts">
import { onMounted } from 'vue';
import { timestampms } from '@/shared/formatters';
2022-04-19 05:05:34 +00:00
import { useBotStore } from '@/stores/ftbotwrapper';
2023-05-09 18:04:57 +00:00
const botStore = useBotStore();
2023-05-09 18:04:57 +00:00
onMounted(() => {
botStore.activeBot.getBacktestHistory();
});
</script>
<style lang="scss" scoped></style>