mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Support new backtest options
This commit is contained in:
parent
d2744755d2
commit
afbaa41044
|
@ -76,6 +76,12 @@ export default class BacktestResultView extends Vue {
|
||||||
return sortedTrades;
|
return sortedTrades;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formatPriceStake(price) {
|
||||||
|
return `${formatPrice(price, this.backtestResult.stake_currency_decimals)} ${
|
||||||
|
this.backtestResult.stake_currency
|
||||||
|
}`;
|
||||||
|
}
|
||||||
|
|
||||||
get bestPair(): string {
|
get bestPair(): string {
|
||||||
const trades = this.getSortedTrades(this.backtestResult);
|
const trades = this.getSortedTrades(this.backtestResult);
|
||||||
const value = trades[trades.length - 1];
|
const value = trades[trades.length - 1];
|
||||||
|
@ -96,9 +102,9 @@ export default class BacktestResultView extends Vue {
|
||||||
// { metric: 'First trade Pair', value: this.backtestResult.backtest_best_day },
|
// { metric: 'First trade Pair', value: this.backtestResult.backtest_best_day },
|
||||||
{
|
{
|
||||||
metric: 'Total Profit',
|
metric: 'Total Profit',
|
||||||
value: `${formatPercent(this.backtestResult.profit_total)} | ${formatPrice(
|
value: `${formatPercent(this.backtestResult.profit_total)} | ${this.formatPriceStake(
|
||||||
this.backtestResult.profit_total_abs,
|
this.backtestResult.profit_total_abs,
|
||||||
)} ${this.backtestResult.stake_currency}`,
|
)}`,
|
||||||
},
|
},
|
||||||
{ metric: 'Trades per day', value: this.backtestResult.trades_per_day },
|
{ metric: 'Trades per day', value: this.backtestResult.trades_per_day },
|
||||||
|
|
||||||
|
@ -131,8 +137,14 @@ export default class BacktestResultView extends Vue {
|
||||||
value: humanizeDurationFromSeconds(this.backtestResult.loser_holding_avg),
|
value: humanizeDurationFromSeconds(this.backtestResult.loser_holding_avg),
|
||||||
},
|
},
|
||||||
{ metric: 'Max Drawdown', value: formatPercent(this.backtestResult.max_drawdown) },
|
{ metric: 'Max Drawdown', value: formatPercent(this.backtestResult.max_drawdown) },
|
||||||
|
{
|
||||||
|
metric: 'Max Drawdown ABS',
|
||||||
|
value: this.formatPriceStake(this.backtestResult.max_drawdown_abs),
|
||||||
|
},
|
||||||
{ metric: 'Drawdown start', value: this.backtestResult.drawdown_start },
|
{ metric: 'Drawdown start', value: this.backtestResult.drawdown_start },
|
||||||
{ metric: 'Drawdown end', value: this.backtestResult.drawdown_end },
|
{ metric: 'Drawdown end', value: this.backtestResult.drawdown_end },
|
||||||
|
{ metric: 'Min balance', value: this.formatPriceStake(this.backtestResult.csum_min) },
|
||||||
|
{ metric: 'Max balance', value: this.formatPriceStake(this.backtestResult.csum_max) },
|
||||||
{ metric: 'Market change', value: formatPercent(this.backtestResult.market_change) },
|
{ metric: 'Market change', value: formatPercent(this.backtestResult.market_change) },
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -177,6 +189,22 @@ export default class BacktestResultView extends Vue {
|
||||||
{ setting: 'Sell profit only', value: this.backtestResult.sell_profit_only },
|
{ setting: 'Sell profit only', value: this.backtestResult.sell_profit_only },
|
||||||
{ setting: 'Sell profit offset', value: this.backtestResult.sell_profit_offset },
|
{ setting: 'Sell profit offset', value: this.backtestResult.sell_profit_offset },
|
||||||
{ setting: 'Enable protections', value: this.backtestResult.enable_protections },
|
{ setting: 'Enable protections', value: this.backtestResult.enable_protections },
|
||||||
|
{
|
||||||
|
setting: 'Starting balance',
|
||||||
|
value: this.formatPriceStake(this.backtestResult.starting_balance),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
setting: 'Final balance',
|
||||||
|
value: this.formatPriceStake(this.backtestResult.final_balance),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
setting: 'Avg. stake amount',
|
||||||
|
value: this.formatPriceStake(this.backtestResult.avg_stake_amount),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
setting: 'Total trade volume',
|
||||||
|
value: this.formatPriceStake(this.backtestResult.total_volume),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ export interface BacktestPayload {
|
||||||
timeframe?: string;
|
timeframe?: string;
|
||||||
max_open_trades?: number;
|
max_open_trades?: number;
|
||||||
// TODO: Should be number or unlimited
|
// TODO: Should be number or unlimited
|
||||||
stake_amount?: number;
|
stake_amount?: number | string;
|
||||||
dry_run_wallet?: number;
|
dry_run_wallet?: number;
|
||||||
enable_protections?: boolean;
|
enable_protections?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ export interface StrategyBacktestResult {
|
||||||
max_drawdown_low: number;
|
max_drawdown_low: number;
|
||||||
max_drawdown_high: number;
|
max_drawdown_high: number;
|
||||||
|
|
||||||
cusm_min: number;
|
csum_min: number;
|
||||||
csum_max: number;
|
csum_max: number;
|
||||||
|
|
||||||
winner_holding_avg: number;
|
winner_holding_avg: number;
|
||||||
|
|
|
@ -102,13 +102,20 @@
|
||||||
label-align-sm="right"
|
label-align-sm="right"
|
||||||
label-for="stake-amount"
|
label-for="stake-amount"
|
||||||
>
|
>
|
||||||
|
<div class="d-flex">
|
||||||
|
<b-form-checkbox id="stake-amount-bool" v-model="stakeAmountUnlimited"
|
||||||
|
>Unlimited stake</b-form-checkbox
|
||||||
|
>
|
||||||
|
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="stake-amount"
|
id="stake-amount"
|
||||||
v-model="stakeAmount"
|
v-model="stakeAmount"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="Use strategy default"
|
placeholder="Use strategy default"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
|
:disabled="stakeAmountUnlimited"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
|
</div>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<b-form-group
|
<b-form-group
|
||||||
|
@ -120,7 +127,6 @@
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
id="enable-protections"
|
id="enable-protections"
|
||||||
v-model="enableProtections"
|
v-model="enableProtections"
|
||||||
:options="availableTimeframes"
|
|
||||||
></b-form-checkbox>
|
></b-form-checkbox>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
|
@ -280,6 +286,8 @@ export default class Backtesting extends Vue {
|
||||||
|
|
||||||
maxOpenTrades = '';
|
maxOpenTrades = '';
|
||||||
|
|
||||||
|
stakeAmountUnlimited = false;
|
||||||
|
|
||||||
stakeAmount = '';
|
stakeAmount = '';
|
||||||
|
|
||||||
startingCapital = '';
|
startingCapital = '';
|
||||||
|
@ -346,11 +354,16 @@ export default class Backtesting extends Vue {
|
||||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
btPayload.max_open_trades = openTradesInt;
|
btPayload.max_open_trades = openTradesInt;
|
||||||
}
|
}
|
||||||
|
if (this.stakeAmountUnlimited) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
|
btPayload.stake_amount = 'unlimited';
|
||||||
|
} else {
|
||||||
const stakeAmount = Number(this.stakeAmount);
|
const stakeAmount = Number(this.stakeAmount);
|
||||||
if (stakeAmount) {
|
if (stakeAmount) {
|
||||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
btPayload.stake_amount = stakeAmount;
|
btPayload.stake_amount = stakeAmount;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const startingCapital = Number(this.startingCapital);
|
const startingCapital = Number(this.startingCapital);
|
||||||
if (startingCapital) {
|
if (startingCapital) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user