Extract backtestResultEntry

This commit is contained in:
Matthias 2023-10-24 20:14:46 +02:00
parent 85f137c179
commit 1d20828f83
2 changed files with 32 additions and 12 deletions

View File

@ -11,18 +11,7 @@
@click="setBacktestResult(key)" @click="setBacktestResult(key)"
> >
<template v-if="!result.metadata.editing"> <template v-if="!result.metadata.editing">
<div class="d-flex flex-column me-2 text-start"> <BacktestResultSelectEntry :backtest-result="result" />
<div class="fw-bold">
{{ result.metadata.strategyName }} - {{ result.strategy.timeframe }}
</div>
<div class="text-small">
TradeCount: {{ result.strategy.total_trades }} - Profit:
{{ formatPercent(result.strategy.profit_total) }}
</div>
<div v-if="canUseModify" class="text-small" style="white-space: pre-wrap">
{{ result.metadata.notes }}
</div>
</div>
<div class="d-flex"> <div class="d-flex">
<b-button <b-button
v-if="canUseModify" v-if="canUseModify"
@ -59,6 +48,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { formatPercent } from '@/shared/formatters'; import { formatPercent } from '@/shared/formatters';
import { BacktestResultInMemory, BacktestResultUpdate } from '@/types'; import { BacktestResultInMemory, BacktestResultUpdate } from '@/types';
import BacktestResultSelectEntry from '@/components/ftbot/BacktestResultSelectEntry.vue';
defineProps({ defineProps({
backtestHistory: { backtestHistory: {

View File

@ -0,0 +1,30 @@
<template>
<div class="d-flex flex-column me-2 text-start">
<div class="fw-bold">
{{ backtestResult.metadata.strategyName }} - {{ backtestResult.strategy.timeframe }}
</div>
<div class="text-small">
TradeCount: {{ backtestResult.strategy.total_trades }} - Profit:
{{ formatPercent(backtestResult.strategy.profit_total) }}
</div>
<div v-if="canUseModify" class="text-small" style="white-space: pre-wrap">
{{ backtestResult.metadata.notes }}
</div>
</div>
</template>
<script setup lang="ts">
import { formatPercent } from '@/shared/formatters';
import { BacktestResultInMemory } from '@/types';
defineProps({
backtestResult: {
required: true,
type: Object as () => BacktestResultInMemory,
},
selectedBacktestResultKey: { required: false, default: '', type: String },
canUseModify: { required: false, default: false, type: Boolean },
});
</script>
<style scoped></style>