Show absolute profit

This commit is contained in:
Matthias 2021-03-08 19:39:15 +01:00
parent efa49e494d
commit e8bb7edc10
3 changed files with 18 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container"> <div class="container">
<div> <div>
<h2>Backtest-result for {{ strategy }}</h2> <h2>Backtest-result for {{ backtestResult.strategy_name }}</h2>
</div> </div>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
@ -61,8 +61,6 @@ import {
components: { TradeList }, components: { TradeList },
}) })
export default class BacktestResultView extends Vue { export default class BacktestResultView extends Vue {
@Prop({ required: true }) readonly strategy!: string;
@Prop({ required: true }) readonly backtestResult!: StrategyBacktestResult; @Prop({ required: true }) readonly backtestResult!: StrategyBacktestResult;
get hasBacktestResult() { get hasBacktestResult() {
@ -108,8 +106,20 @@ export default class BacktestResultView extends Vue {
}, },
{ metric: 'Trades per day', value: this.backtestResult.trades_per_day }, { metric: 'Trades per day', value: this.backtestResult.trades_per_day },
{ metric: 'Best day', value: formatPercent(this.backtestResult.backtest_best_day, 2) }, {
{ metric: 'Worst day', value: formatPercent(this.backtestResult.backtest_worst_day, 2) }, metric: 'Best day',
value: `${formatPercent(
this.backtestResult.backtest_best_day,
2,
)} | ${this.formatPriceStake(this.backtestResult.backtest_best_day_abs)}`,
},
{
metric: 'Worst day',
value: `${formatPercent(
this.backtestResult.backtest_worst_day,
2,
)} | ${this.formatPriceStake(this.backtestResult.backtest_worst_day_abs)}`,
},
{ {
metric: 'Win/Draw/Loss', metric: 'Win/Draw/Loss',

View File

@ -66,6 +66,8 @@ export interface StrategyBacktestResult {
backtest_days: number; backtest_days: number;
backtest_best_day: number; backtest_best_day: number;
backtest_worst_day: number; backtest_worst_day: number;
backtest_best_day_abs: number;
backtest_worst_day_abs: number;
trades_per_day: number; trades_per_day: number;
market_change: number; market_change: number;

View File

@ -170,7 +170,7 @@
:selected-backtest-result-key="selectedBacktestResultKey" :selected-backtest-result-key="selectedBacktestResultKey"
@selectionChange="setBacktestResult" @selectionChange="setBacktestResult"
/> />
<BacktestResultView :strategy="strategy" :backtest-result="selectedBacktestResult" /> <BacktestResultView :backtest-result="selectedBacktestResult" />
</div> </div>
<div <div
v-if="hasBacktestResult && btFormMode == 'visualize-summary'" v-if="hasBacktestResult && btFormMode == 'visualize-summary'"