Adjust backtesting interface to new metrics and possibilities

This commit is contained in:
Matthias 2021-02-17 20:37:30 +01:00
parent fac90a88d0
commit d2744755d2
2 changed files with 41 additions and 4 deletions

View File

@ -6,7 +6,9 @@ export interface BacktestPayload {
timerange: string;
timeframe?: string;
max_open_trades?: number;
// TODO: Should be number or unlimited
stake_amount?: number;
dry_run_wallet?: number;
enable_protections?: boolean;
}
@ -51,6 +53,8 @@ export interface StrategyBacktestResult {
sell_reason_summary: Array<SellReasonResults>;
left_open_trades: Trade[];
total_trades: number;
total_volume: number;
avg_stake_amount: number;
profit_mean: number;
profit_total: number;
profit_total_abs: number;
@ -68,6 +72,11 @@ export interface StrategyBacktestResult {
pairlist: string[];
stake_amount: number;
stake_currency: string;
/** Decimal places to use when displaying values in stake-currency */
stake_currency_decimals: number;
starting_balance: number;
final_balance: number;
max_open_trades: number;
timeframe: string;
timerange: string;
@ -92,6 +101,13 @@ export interface StrategyBacktestResult {
loser_holding_avg: number;
losing_days: number;
max_drawdown: number;
/** Absolute max drawdown */
max_drawdown_abs: number;
max_drawdown_low: number;
max_drawdown_high: number;
cusm_min: number;
csum_max: number;
winner_holding_avg: number;
winning_days: number;

View File

@ -83,7 +83,19 @@
type="number"
></b-form-input>
</b-form-group>
<b-form-group
label-cols-sm="5"
label="Starting capital:"
label-align-sm="right"
label-for="starting-capital"
>
<b-form-input
id="starting-capital"
v-model="startingCapital"
type="number"
step="0.001"
></b-form-input>
</b-form-group>
<b-form-group
label-cols-sm="5"
label="Stake amount:"
@ -270,6 +282,8 @@ export default class Backtesting extends Vue {
stakeAmount = '';
startingCapital = '';
btFormMode = 'run';
selectedPlotConfig: PlotConfig = getCustomPlotConfig(getPlotConfigName());
@ -332,11 +346,18 @@ export default class Backtesting extends Vue {
// eslint-disable-next-line @typescript-eslint/camelcase
btPayload.max_open_trades = openTradesInt;
}
const stakeAmountInt = Number(this.stakeAmount);
if (stakeAmountInt) {
const stakeAmount = Number(this.stakeAmount);
if (stakeAmount) {
// eslint-disable-next-line @typescript-eslint/camelcase
btPayload.stake_amount = stakeAmountInt;
btPayload.stake_amount = stakeAmount;
}
const startingCapital = Number(this.startingCapital);
if (startingCapital) {
// eslint-disable-next-line @typescript-eslint/camelcase
btPayload.dry_run_wallet = startingCapital;
}
if (this.selectedTimeframe) {
btPayload.timeframe = this.selectedTimeframe;
}