2022-04-12 05:18:35 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<button
|
2022-10-30 13:26:23 +00:00
|
|
|
class="btn btn-secondary float-end"
|
2022-04-12 05:18:35 +00:00
|
|
|
title="Refresh"
|
|
|
|
aria-label="Refresh"
|
2022-04-19 05:05:34 +00:00
|
|
|
@click="botStore.activeBot.getBacktestHistory"
|
2022-04-12 05:18:35 +00:00
|
|
|
>
|
2023-05-09 18:23:15 +00:00
|
|
|
<i-mdi-refresh />
|
2022-04-12 05:18:35 +00:00
|
|
|
</button>
|
|
|
|
<p>
|
|
|
|
Load Historic results from disk. You can click on multiple results to load all of them into
|
|
|
|
freqUI.
|
|
|
|
</p>
|
2022-11-18 18:48:15 +00:00
|
|
|
<b-list-group v-if="botStore.activeBot.backtestHistoryList" class="ms-2">
|
2022-04-12 05:18:35 +00:00
|
|
|
<b-list-group-item
|
2022-04-19 05:05:34 +00:00
|
|
|
v-for="(res, idx) in botStore.activeBot.backtestHistoryList"
|
2022-04-12 05:18:35 +00:00
|
|
|
: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)"
|
2022-04-12 05:18:35 +00:00
|
|
|
>
|
|
|
|
<strong>{{ res.strategy }}</strong>
|
|
|
|
backtested on: {{ timestampms(res.backtest_start_time * 1000) }}
|
|
|
|
<small>{{ res.filename }}</small>
|
2023-08-01 04:53:40 +00:00
|
|
|
<InfoBox
|
|
|
|
v-if="botStore.activeBot.botApiVersion >= 2.32"
|
|
|
|
:class="res.notes ? 'opacity-100' : 'opacity-0'"
|
|
|
|
:hint="res.notes ?? ''"
|
|
|
|
></InfoBox>
|
2023-07-25 18:51:17 +00:00
|
|
|
<b-button
|
|
|
|
v-if="botStore.activeBot.botApiVersion >= 2.31"
|
|
|
|
class="ms-1"
|
|
|
|
size="sm"
|
|
|
|
title="Delete this Result."
|
|
|
|
@click.stop="deleteBacktestResult(res)"
|
|
|
|
>
|
|
|
|
<i-mdi-delete />
|
|
|
|
</b-button>
|
2022-04-12 05:18:35 +00:00
|
|
|
</b-list-group-item>
|
|
|
|
</b-list-group>
|
|
|
|
</div>
|
2023-07-25 18:51:17 +00:00
|
|
|
<MessageBox ref="msgBox" />
|
2022-04-12 05:18:35 +00:00
|
|
|
</template>
|
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
<script setup lang="ts">
|
2023-07-25 18:51:17 +00:00
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
import MessageBox, { MsgBoxObject } from '@/components/general/MessageBox.vue';
|
2022-04-12 05:18:35 +00:00
|
|
|
import { timestampms } from '@/shared/formatters';
|
2022-04-19 05:05:34 +00:00
|
|
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
2023-07-25 18:51:17 +00:00
|
|
|
import { BacktestHistoryEntry } from '@/types';
|
2023-08-01 04:53:40 +00:00
|
|
|
import InfoBox from '../general/InfoBox.vue';
|
2022-04-12 05:18:35 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const botStore = useBotStore();
|
2023-07-25 18:51:17 +00:00
|
|
|
const msgBox = ref<typeof MessageBox>();
|
2022-04-12 05:18:35 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
onMounted(() => {
|
|
|
|
botStore.activeBot.getBacktestHistory();
|
2022-04-12 05:18:35 +00:00
|
|
|
});
|
2023-07-25 18:51:17 +00:00
|
|
|
|
|
|
|
function deleteBacktestResult(result: BacktestHistoryEntry) {
|
|
|
|
const msg: MsgBoxObject = {
|
|
|
|
title: 'Stop Bot',
|
|
|
|
message: `Delete result ${result.filename} from disk?`,
|
|
|
|
accept: () => {
|
|
|
|
botStore.activeBot.deleteBacktestHistoryResult(result);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
msgBox.value?.show(msg);
|
|
|
|
}
|
2022-04-12 05:18:35 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|