From b17382f04fc35967b66b7776cdbf295c50f42ea2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Dec 2020 16:22:41 +0100 Subject: [PATCH] Improve backtestResult view --- src/components/ftbot/BacktestResultView.vue | 16 +++++++++++++++- src/types/backtest.ts | 6 ++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/components/ftbot/BacktestResultView.vue b/src/components/ftbot/BacktestResultView.vue index 22b35c70..2227aeac 100644 --- a/src/components/ftbot/BacktestResultView.vue +++ b/src/components/ftbot/BacktestResultView.vue @@ -60,6 +60,7 @@ export default class BacktestResultView extends Vue { return [ { metric: 'Backtesting from', value: timestampms(this.backtestResult.backtest_start_ts) }, { metric: 'Backtesting to', value: timestampms(this.backtestResult.backtest_end_ts) }, + { metric: 'Max open trades', value: this.backtestResult.max_open_trades }, { metric: 'Total trades', value: this.backtestResult.total_trades }, // { metric: 'First trade', value: this.backtestResult.backtest_fi }, // { metric: 'First trade Pair', value: this.backtestResult.backtest_best_day }, @@ -70,6 +71,19 @@ export default class BacktestResultView extends Vue { )} ${this.backtestResult.stake_currency}`, }, { metric: 'Trades per day', value: this.backtestResult.trades_per_day }, + { + metric: 'Best Pair', + value: `${this.backtestResult.best_pair.key} ${formatPercent( + this.backtestResult.best_pair.profit_mean, + )}`, + }, + { + metric: 'Worst Pair', + value: `${this.backtestResult.worst_pair.key} ${formatPercent( + this.backtestResult.worst_pair.profit_mean, + )}`, + }, + { metric: 'Best day', value: formatPercent(this.backtestResult.backtest_best_day, 2) }, { metric: 'Worst day', value: formatPercent(this.backtestResult.backtest_worst_day, 2) }, { @@ -104,7 +118,7 @@ export default class BacktestResultView extends Vue { formatter: (value) => formatPrice(value), }, { - key: 'profit_total_pct', + key: 'profit_total', label: 'Tot Profit %', formatter: (value) => formatPercent(value, 2), }, diff --git a/src/types/backtest.ts b/src/types/backtest.ts index ec811205..290481ab 100644 --- a/src/types/backtest.ts +++ b/src/types/backtest.ts @@ -5,7 +5,7 @@ export interface BacktestPayload { timerange: string; } -export interface PairResults { +export interface PairResult { draws: number; duration_avg: string; key: string; @@ -39,6 +39,8 @@ export interface SellReasonResults { export interface StrategyBacktestResult { trades: Trade[]; + best_pair: PairResult; + worst_pair: PairResult; left_open_trades: Trade[]; backtest_best_day: number; backtest_days: number; @@ -57,7 +59,7 @@ export interface StrategyBacktestResult { market_change: number; max_drawdown: number; pairlist: string[]; - results_per_pair: Array; + results_per_pair: Array; sell_reason_summary: Array; stake_amount: number; stake_currency: string;