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)"
>
<template v-if="!result.metadata.editing">
<div class="d-flex flex-column me-2 text-start">
<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>
<BacktestResultSelectEntry :backtest-result="result" />
<div class="d-flex">
<b-button
v-if="canUseModify"
@ -59,6 +48,7 @@
<script setup lang="ts">
import { formatPercent } from '@/shared/formatters';
import { BacktestResultInMemory, BacktestResultUpdate } from '@/types';
import BacktestResultSelectEntry from '@/components/ftbot/BacktestResultSelectEntry.vue';
defineProps({
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>