Add weekend open skip, expiry force-close, and Chinese trade labels.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { apiFetch } from "../api/client";
|
||||
import { closeReasonZh } from "../labels";
|
||||
|
||||
type Summary = {
|
||||
groups: number;
|
||||
@@ -22,6 +23,10 @@ export default function StatsPage() {
|
||||
.catch((e) => setErr(e instanceof Error ? e.message : String(e)));
|
||||
}, []);
|
||||
|
||||
const reasonEntries = s
|
||||
? Object.entries(s.close_reasons).sort((a, b) => b[1] - a[1])
|
||||
: [];
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<h2 style={{ marginTop: 0 }}>统计</h2>
|
||||
@@ -46,9 +51,17 @@ export default function StatsPage() {
|
||||
{s.total_fees.toFixed(2)} / {s.total_slip.toFixed(2)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<div className="kv" style={{ alignItems: "flex-start" }}>
|
||||
<span>平仓原因</span>
|
||||
<span className="mono">{JSON.stringify(s.close_reasons)}</span>
|
||||
<span className="mono" style={{ textAlign: "right" }}>
|
||||
{reasonEntries.length === 0
|
||||
? "—"
|
||||
: reasonEntries.map(([k, n]) => (
|
||||
<div key={k}>
|
||||
{closeReasonZh(k)} × {n}
|
||||
</div>
|
||||
))}
|
||||
</span>
|
||||
</div>
|
||||
<h3>按组盈亏</h3>
|
||||
{s.equity_curve.map((x) => (
|
||||
|
||||
Reference in New Issue
Block a user