Update backtesting result for exit terminology

This commit is contained in:
Matthias 2022-04-06 20:46:17 +02:00
parent 173896137b
commit 829628127b
3 changed files with 19 additions and 9 deletions

View File

@ -24,12 +24,12 @@
</b-card> </b-card>
</div> </div>
</div> </div>
<b-card header="Results per Sell-reason" class="row mt-2 w-100"> <b-card header="Results per Exit-reason" class="row mt-2 w-100">
<b-table <b-table
small small
hover hover
stacked="sm" stacked="sm"
:items="backtestResult.sell_reason_summary" :items="backtestResult.exit_reason_summary || backtestResult.sell_reason_summary"
:fields="perExitReason" :fields="perExitReason"
> >
</b-table> </b-table>
@ -230,15 +230,24 @@ export default class BacktestResultView extends Vue {
{ setting: 'ROI', value: this.backtestResult.minimal_roi }, { setting: 'ROI', value: this.backtestResult.minimal_roi },
{ {
setting: 'Use Exit Signal', setting: 'Use Exit Signal',
value: this.backtestResult.use_exit_signal || this.backtestResult.use_sell_signal, value:
this.backtestResult.use_exit_signal !== undefined
? this.backtestResult.use_exit_signal
: this.backtestResult.use_sell_signal,
}, },
{ {
setting: 'Exit profit only', setting: 'Exit profit only',
value: this.backtestResult.exit_profit_only || this.backtestResult.sell_profit_only, value:
this.backtestResult.exit_profit_only !== undefined
? this.backtestResult.exit_profit_only
: this.backtestResult.sell_profit_only,
}, },
{ {
setting: 'Exit profit offset', setting: 'Exit profit offset',
value: this.backtestResult.exit_profit_offset || this.backtestResult.sell_profit_offset, value:
this.backtestResult.exit_profit_offset !== undefined
? this.backtestResult.exit_profit_offset
: this.backtestResult.sell_profit_offset,
}, },
{ setting: 'Enable protections', value: this.backtestResult.enable_protections }, { setting: 'Enable protections', value: this.backtestResult.enable_protections },
{ {
@ -285,7 +294,7 @@ export default class BacktestResultView extends Vue {
get perExitReason() { get perExitReason() {
return [ return [
{ key: 'sell_reason', label: 'Exit Reason' }, { key: 'exit_reason', label: 'Exit Reason' },
{ key: 'trades', label: 'Buys' }, { key: 'trades', label: 'Buys' },
{ key: 'profit_mean', label: 'Avg Profit %', formatter: (value) => formatPercent(value, 2) }, { key: 'profit_mean', label: 'Avg Profit %', formatter: (value) => formatPercent(value, 2) },
{ key: 'profit_sum', label: 'Cum Profit %', formatter: (value) => formatPercent(value, 2) }, { key: 'profit_sum', label: 'Cum Profit %', formatter: (value) => formatPercent(value, 2) },

View File

@ -158,7 +158,7 @@ export default class TradeList extends Vue {
// Added to table-fields for historic trades // Added to table-fields for historic trades
closedFields: Record<string, string | Function>[] = [ closedFields: Record<string, string | Function>[] = [
{ key: 'close_timestamp', label: 'Close date' }, { key: 'close_timestamp', label: 'Close date' },
{ key: 'sell_reason', label: 'Close Reason' }, { key: 'exit_reason', label: 'Close Reason' },
]; ];
tableFields: Record<string, string | Function>[] = [ tableFields: Record<string, string | Function>[] = [

View File

@ -29,7 +29,7 @@ export interface PairResult {
wins: number; wins: number;
} }
export interface SellReasonResults { export interface ExitReasonResults {
draws: number; draws: number;
losses: number; losses: number;
profit_mean: number; profit_mean: number;
@ -51,7 +51,8 @@ export interface StrategyBacktestResult {
best_pair: PairResult; best_pair: PairResult;
worst_pair: PairResult; worst_pair: PairResult;
results_per_pair: Array<PairResult>; results_per_pair: Array<PairResult>;
sell_reason_summary: Array<SellReasonResults>; sell_reason_summary?: Array<ExitReasonResults>;
exit_reason_summary?: Array<ExitReasonResults>;
left_open_trades: Trade[]; left_open_trades: Trade[];
total_trades: number; total_trades: number;
total_volume: number; total_volume: number;