diff --git a/frontend/app/trades/page.tsx b/frontend/app/trades/page.tsx index dbae0c5..85e84b6 100644 --- a/frontend/app/trades/page.tsx +++ b/frontend/app/trades/page.tsx @@ -5,7 +5,7 @@ import { authFetch } from "@/lib/auth"; import { useAuth } from "@/lib/auth"; import Link from "next/link"; import { - AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, ReferenceLine, CartesianGrid + ComposedChart, Area, Line, XAxis, YAxis, Tooltip, ResponsiveContainer, ReferenceLine, CartesianGrid, Legend } from "recharts"; // ─── Types ─────────────────────────────────────────────────────── @@ -253,44 +253,55 @@ function FlowAnalysis({ symbol }: { symbol: Symbol }) { - {/* Delta折线图 */} + {/* Delta + 价格双Y轴图 */}
-

买卖 Delta(正=多头占优,负=空头占优)

- - +

买卖 Delta(正=多头占优,负=空头占优)+ 币价走势

+ + - + {/* 左轴:Delta */} + + {/* 右轴:价格 */} + v >= 1000 ? `$${(v/1000).toFixed(1)}k` : `$${v.toFixed(0)}`} + /> [`${Number(v).toFixed(2)}`, "Delta"]} + formatter={(v: any, name: any) => { + if (name === "price") return [`$${Number(v).toLocaleString("en-US", { minimumFractionDigits: 1, maximumFractionDigits: 1 })}`, "币价(VWAP)"]; + return [`${Number(v).toFixed(2)}`, "Delta"]; + }} contentStyle={{ background: "#fff", border: "1px solid #e2e8f0", borderRadius: 8, fontSize: 11 }} /> - - + + -
+ +
- {/* 买卖量柱状图 */} + {/* 买卖量图 */}

主动买量 vs 主动卖量

- + - + [`${Number(v).toFixed(2)}`, name === "buy" ? "主动买" : "主动卖"]} contentStyle={{ background: "#fff", border: "1px solid #e2e8f0", borderRadius: 8, fontSize: 11 }} /> - - - + + +