Improve backtestResult view

This commit is contained in:
Matthias 2020-12-05 16:22:41 +01:00
parent 5f2fbf3c1f
commit b17382f04f
2 changed files with 19 additions and 3 deletions

View File

@ -60,6 +60,7 @@ export default class BacktestResultView extends Vue {
return [ return [
{ metric: 'Backtesting from', value: timestampms(this.backtestResult.backtest_start_ts) }, { metric: 'Backtesting from', value: timestampms(this.backtestResult.backtest_start_ts) },
{ metric: 'Backtesting to', value: timestampms(this.backtestResult.backtest_end_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: 'Total trades', value: this.backtestResult.total_trades },
// { metric: 'First trade', value: this.backtestResult.backtest_fi }, // { metric: 'First trade', value: this.backtestResult.backtest_fi },
// { metric: 'First trade Pair', value: this.backtestResult.backtest_best_day }, // { metric: 'First trade Pair', value: this.backtestResult.backtest_best_day },
@ -70,6 +71,19 @@ export default class BacktestResultView extends Vue {
)} ${this.backtestResult.stake_currency}`, )} ${this.backtestResult.stake_currency}`,
}, },
{ metric: 'Trades per day', value: this.backtestResult.trades_per_day }, { 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: 'Best day', value: formatPercent(this.backtestResult.backtest_best_day, 2) },
{ metric: 'Worst day', value: formatPercent(this.backtestResult.backtest_worst_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), formatter: (value) => formatPrice(value),
}, },
{ {
key: 'profit_total_pct', key: 'profit_total',
label: 'Tot Profit %', label: 'Tot Profit %',
formatter: (value) => formatPercent(value, 2), formatter: (value) => formatPercent(value, 2),
}, },

View File

@ -5,7 +5,7 @@ export interface BacktestPayload {
timerange: string; timerange: string;
} }
export interface PairResults { export interface PairResult {
draws: number; draws: number;
duration_avg: string; duration_avg: string;
key: string; key: string;
@ -39,6 +39,8 @@ export interface SellReasonResults {
export interface StrategyBacktestResult { export interface StrategyBacktestResult {
trades: Trade[]; trades: Trade[];
best_pair: PairResult;
worst_pair: PairResult;
left_open_trades: Trade[]; left_open_trades: Trade[];
backtest_best_day: number; backtest_best_day: number;
backtest_days: number; backtest_days: number;
@ -57,7 +59,7 @@ export interface StrategyBacktestResult {
market_change: number; market_change: number;
max_drawdown: number; max_drawdown: number;
pairlist: string[]; pairlist: string[];
results_per_pair: Array<PairResults>; results_per_pair: Array<PairResult>;
sell_reason_summary: Array<SellReasonResults>; sell_reason_summary: Array<SellReasonResults>;
stake_amount: number; stake_amount: number;
stake_currency: string; stake_currency: string;