mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-22 23:28:16 +00:00
feat(web): add Next.js portfolio with live MT5 dashboard
- Linear design system (dark canvas, lavender accent) - Live account stats, open positions, pending orders (30s polling) - Trade history with equity curve chart - Backtest results table - Proxy API routes — MT5_BASE_URL server-side only, never exposed to browser - Deploy on Vercel: set MT5_BASE_URL env var Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4fdc3da4ed
commit
9716fc0955
@@ -0,0 +1,42 @@
|
||||
import type { Position } from "@/lib/mt5";
|
||||
import { formatCurrency } from "@/lib/format";
|
||||
|
||||
export default function PositionsTable({ positions, currency = "USD" }: {
|
||||
positions: Position[];
|
||||
currency?: string;
|
||||
}) {
|
||||
return (
|
||||
<table className="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
{["Symbol", "Side", "Volume", "Entry", "Current", "SL", "TP", "P&L"].map(h => (
|
||||
<th key={h}>{h}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{positions.map((p) => {
|
||||
const isBuy = p.type === 0;
|
||||
return (
|
||||
<tr key={p.ticket}>
|
||||
<td className="font-mono font-medium text-ink">{p.symbol}</td>
|
||||
<td>
|
||||
<span className={`status-pill ${isBuy ? "status-bull" : "status-bear"}`}>
|
||||
{isBuy ? "BUY" : "SELL"}
|
||||
</span>
|
||||
</td>
|
||||
<td className="font-mono text-ink-md">{p.volume}</td>
|
||||
<td className="font-mono text-ink-md">{p.price_open.toFixed(2)}</td>
|
||||
<td className="font-mono text-ink-md">{p.price_current.toFixed(2)}</td>
|
||||
<td className="font-mono text-ink-sub">{p.sl > 0 ? p.sl.toFixed(2) : "—"}</td>
|
||||
<td className="font-mono text-ink-sub">{p.tp > 0 ? p.tp.toFixed(2) : "—"}</td>
|
||||
<td className={`font-mono font-semibold ${p.profit >= 0 ? "text-bull" : "text-bear"}`}>
|
||||
{formatCurrency(p.profit, currency)}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user