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 (
@@ -362,9 +370,25 @@ function TradeRow({ trade, isOpen }) { {trade.pnl != null ? `${trade.pnl >= 0 ? '+' : ''}$${trade.pnl}` : 'open'}
+
{trade.reason}
+ + {hasExpected && ( +
+ + If win: +${winPnL.toFixed(2)} + + + If lose: ${losePnL.toFixed(2)} + + + Gross payout: ${grossPayout.toFixed(2)} + +
+ )} +
{trade.result && !isOpen && ( Result: {trade.result}