Improve backtest typing

This commit is contained in:
Matthias 2021-01-14 08:04:14 +01:00
parent b8b58b885c
commit 8426475ea5
2 changed files with 38 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="row">
<h2>BacktestResult for {{ strategy }}</h2>
<h2>Backtest-result for {{ strategy }}</h2>
</div>
<div class="container">
<b-card header="Metrics">

View File

@ -1,3 +1,4 @@
import { Lock } from './locks';
import { Trade } from './trades';
export interface BacktestPayload {
@ -43,16 +44,44 @@ export interface SellReasonResults {
export interface StrategyBacktestResult {
trades: Trade[];
locks: Lock[];
best_pair: PairResult;
worst_pair: PairResult;
results_per_pair: Array<PairResult>;
sell_reason_summary: Array<SellReasonResults>;
left_open_trades: Trade[];
backtest_best_day: number;
backtest_days: number;
total_trades: number;
profit_mean: number;
profit_total: number;
profit_total_abs: number;
backtest_end: string;
backtest_end_ts: number;
backtest_start: string;
backtest_start_ts: number;
backtest_days: number;
backtest_best_day: number;
backtest_worst_day: number;
trades_per_day: number;
market_change: number;
pairlist: string[];
stake_amount: number;
stake_currency: string;
max_open_trades: number;
timeframe: string;
timerange: string;
strategy_name: string;
stoploss: number;
trailing_stop: boolean;
trailing_stop_positive?: number;
trailing_stop_positive_offset?: number;
trailing_only_offset_is_reached: boolean;
minimal_roi: Record<string, number>;
use_sell_signal: boolean;
sell_profit_only: boolean;
sell_profit_offset: number;
// Daily stats ...
draw_days: number;
drawdown_end: string;
drawdown_end_ts: number;
@ -60,22 +89,15 @@ export interface StrategyBacktestResult {
drawdown_start_ts: number;
loser_holding_avg: number;
losing_days: number;
market_change: number;
max_drawdown: number;
pairlist: string[];
results_per_pair: Array<PairResult>;
sell_reason_summary: Array<SellReasonResults>;
stake_amount: number;
stake_currency: string;
max_open_trades: number;
timeframe: string;
total_trades: number;
profit_mean: number;
profit_total: number;
profit_total_abs: number;
trades_per_day: number;
winner_holding_avg: number;
winning_days: number;
/** Start time of the backtest run */
backtest_run_start_ts: number;
/** ENd time of the backtest run */
backtest_run_end_ts: number;
}
export interface BacktestResult {