diff --git a/app/paper/page.js b/app/paper/page.js index ba43cc7..ab701c0 100644 --- a/app/paper/page.js +++ b/app/paper/page.js @@ -345,6 +345,14 @@ function TradeRow({ trade, isOpen }) { const isNeutral = trade.result === 'cancelled' || trade.result === 'expired'; const pnlColor = trade.pnl == null ? 'text-gray-400' : trade.pnl > 0 ? 'text-green-600' : trade.pnl < 0 ? 'text-red-600' : 'text-gray-600'; + const price = Number(trade.price); + const cost = Number(trade.cost ?? trade.size); + const hasExpected = isOpen && Number.isFinite(price) && price > 0 && price < 100 && Number.isFinite(cost) && cost > 0; + + const grossPayout = hasExpected ? (100 / price) * cost : null; + const winPnL = hasExpected ? grossPayout - cost : null; + const losePnL = hasExpected ? -cost : null; + return (