Positions
{lastUpdated ? `Updated ${lastUpdated.toLocaleTimeString("en-IN", { timeZone: "Asia/Kolkata", hour12: false })} IST` : "Live positions from Angel One"}
{error && (
{error}
)}
{/* Summary stat cards */}
= 0 ? TrendingUp : TrendingDown}
className={summary && summary.totalPnl < 0 ? "border-rose-500/30" : "border-emerald-500/30"}
/>
0 ? `${closed.length} closed today` : undefined}
/>
{/* Open positions table */}
Open Positions ({open.length})
{loading ? (
Loading…
) : open.length === 0 ? (
No open positions
) : (
| Symbol |
Qty |
Avg |
LTP |
Unrealised |
Total P&L |
Type |
{open.map(p => (
| {p.tradingsymbol} |
0 ? "text-emerald-500" : "text-rose-500"}>
{p.netqty > 0 ? "+" : ""}{p.netqty}
|
₹{p.avg_price.toFixed(2)} |
₹{p.ltp.toFixed(2)} |
|
|
{p.instrumenttype || p.producttype}
|
))}
)}
{/* Closed today */}
{!loading && closed.length > 0 && (
Closed Today ({closed.length})
| Symbol |
Realised P&L |
Type |
{closed.map(p => (
| {p.tradingsymbol} |
|
{p.instrumenttype || p.producttype}
|
))}
)}
)
}