Add enter tag breakdown to backtest output

This commit is contained in:
Matthias 2024-03-30 12:05:30 +01:00
parent 9b5e14c033
commit 5102e4774d

View File

@ -24,6 +24,10 @@
</b-card> </b-card>
</div> </div>
</div> </div>
<b-card header="Results per Enter tag">
<b-table small hover stacked="sm" :items="enterTagSummary" :fields="perTagReason">
</b-table>
</b-card>
<b-card header="Results per Exit-reason"> <b-card header="Results per Exit-reason">
<b-table small hover stacked="sm" :items="exitReasonSummary" :fields="perExitReason"> <b-table small hover stacked="sm" :items="exitReasonSummary" :fields="perExitReason">
</b-table> </b-table>
@ -81,6 +85,10 @@ const exitReasonSummary = computed(
props.backtestResult.sell_reason_summary) as unknown as TableItem[], props.backtestResult.sell_reason_summary) as unknown as TableItem[],
); );
const enterTagSummary = computed(
() => props.backtestResult.results_per_enter_tag as unknown as TableItem[],
);
const perPairFields = computed(() => { const perPairFields = computed(() => {
return [ return [
{ key: 'key', label: 'Pair' }, { key: 'key', label: 'Pair' },
@ -132,6 +140,31 @@ const perExitReason = computed(() => {
{ key: 'losses', label: 'Losses' }, { key: 'losses', label: 'Losses' },
]; ];
}); });
const perTagReason = computed(() => {
return [
{ key: 'key', label: 'Tag', formatter: (value) => value || 'OTHER' },
{ key: 'trades', label: 'Buys' },
{
key: 'profit_mean',
label: 'Avg Profit %',
formatter: (value) => formatPercent(value, 2),
},
{
key: 'profit_total_abs',
label: `Tot Profit ${props.backtestResult.stake_currency}`,
formatter: (value) => formatPrice(value, props.backtestResult.stake_currency_decimals),
},
{
key: 'profit_total',
label: 'Tot Profit %',
formatter: (value) => formatPercent(value, 2),
},
{ key: 'wins', label: 'Wins' },
{ key: 'draws', label: 'Draws' },
{ key: 'losses', label: 'Losses' },
];
});
const backtestResultFields: TableField[] = [ const backtestResultFields: TableField[] = [
{ key: 'metric', label: 'Metric' }, { key: 'metric', label: 'Metric' },
{ key: 'value', label: 'Value' }, { key: 'value', label: 'Value' },