Skip to content

Commit f70cc6c

Browse files
committed
fix durations
1 parent 921fb75 commit f70cc6c

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

web/ui/src/lib/dev/common.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export interface GroupItem {
1111
profitPctSum: number;
1212
profitSum: number;
1313
costSum: number;
14-
durations: number[];
1514
sharpe: number;
1615
sortino: number;
1716
}

web/ui/src/routes/(dev)/backtest/item/+page.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
396396
winCount: number;
397397
profitSum: number;
398398
costSum: number;
399-
durations: number[];
400399
sharpe: number;
401400
sortino: number;
402401
[key: string]: any;
@@ -627,7 +626,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
627626
{ title: m.win_rate(), field: 'winCount', format: (v, g) => formatPercent(v * 100 / (g.orderNum || 1)) },
628627
{ title: m.tot_profit(), field: 'profitSum', format: v => formatNumber(v) },
629628
{ title: m.profit_rate(), field: 'profitSum', format: (v, g) => formatPercent(v * 100 / g.costSum) },
630-
{ title: m.avg_hold_time(), field: 'durations', format: (v: number[], g) => formatDuration(v.reduce((a, b) => a + b, 0) * 1000 / v.length) },
631629
{ title: m.sharpe_ratio() + '/' + m.sortino_ratio(), field: 'sharpe', format: (v, g) => `${formatNumber(v, 2)} / ${formatNumber(g.sortino, 2)}` }
632630
])}
633631
{/if}
@@ -643,7 +641,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
643641
<th>{m.win_rate()}</th>
644642
<th>{m.tot_profit()}</th>
645643
<th>{m.profit_rate()}</th>
646-
<th>{m.avg_hold_time()}</th>
647644
</tr>
648645
</thead>
649646
<tbody>
@@ -654,7 +651,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
654651
<td>{formatPercent(group.winCount * 100 / (group.orderNum || 1))}</td>
655652
<td>{formatNumber(group.profitSum)}</td>
656653
<td>{formatPercent(group.profitSum * 100 / group.costSum)}</td>
657-
<td>{formatDuration(group.durations.reduce((a: number, b: number) => a + b, 0) * 1000 / group.durations.length)}</td>
658654
</tr>
659655
{/each}
660656
</tbody>
@@ -673,7 +669,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
673669
<th>{m.win_rate()}</th>
674670
<th>{m.tot_profit()}</th>
675671
<th>{m.profit_rate()}</th>
676-
<th>{m.avg_hold_time()}</th>
677672
</tr>
678673
</thead>
679674
<tbody>
@@ -684,7 +679,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
684679
<td>{formatPercent(group.winCount * 100 / (group.orderNum || 1))}</td>
685680
<td>{formatNumber(group.profitSum)}</td>
686681
<td>{formatPercent(group.profitSum * 100 / group.costSum)}</td>
687-
<td>{formatDuration(group.durations.reduce((a: number, b: number) => a + b, 0) * 1000 / group.durations.length)}</td>
688682
</tr>
689683
{/each}
690684
</tbody>
@@ -703,7 +697,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
703697
<th>{m.win_rate()}</th>
704698
<th>{m.tot_profit()}</th>
705699
<th>{m.profit_rate()}</th>
706-
<th>{m.avg_hold_time()}</th>
707700
<th>{m.sharpe_ratio()}/{m.sortino_ratio()}</th>
708701
</tr>
709702
</thead>
@@ -715,7 +708,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
715708
<td>{formatPercent(group.winCount * 100 / (group.orderNum || 1))}</td>
716709
<td>{formatNumber(group.profitSum)}</td>
717710
<td>{formatPercent(group.profitSum * 100 / group.costSum)}</td>
718-
<td>{formatDuration(group.durations.reduce((a: number, b: number) => a + b, 0) * 1000 / group.durations.length)}</td>
719711
<td>{formatNumber(group.sharpe, 2)} / {formatNumber(group.sortino, 2)}</td>
720712
</tr>
721713
{/each}
@@ -735,7 +727,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
735727
<th>{m.win_rate()}</th>
736728
<th>{m.tot_profit()}</th>
737729
<th>{m.profit_rate()}</th>
738-
<th>{m.avg_hold_time()}</th>
739730
<th>{m.sharpe_ratio()}/{m.sortino_ratio()}</th>
740731
</tr>
741732
</thead>
@@ -747,7 +738,6 @@ ${m.holding()}: ${fmtDuration((td.exit_at - td.enter_at) / 1000)}`;
747738
<td>{formatPercent(group.winCount * 100 / (group.orderNum || 1))}</td>
748739
<td>{formatNumber(group.profitSum)}</td>
749740
<td>{formatPercent(group.profitSum * 100 / group.costSum)}</td>
750-
<td>{formatDuration(group.durations.reduce((a: number, b: number) => a + b, 0) * 1000 / group.durations.length)}</td>
751741
<td>{formatNumber(group.sharpe, 2)} / {formatNumber(group.sortino, 2)}</td>
752742
</tr>
753743
{/each}

0 commit comments

Comments
 (0)