Mark-to-Market P&L Calculation

Valuing Your Trading Book Every Day

FUNDAMENTALS

Every trading desk asks one question each morning: are we making or losing money? Mark-to-market P&L answers it. It values every open trade at today's price.

This page explains mark-to-market P&L from scratch. You will see the formula, why the sign matters, worked examples and a short Python calculator. The examples use UK gas and power, but the method works for any market.

What is P&L in trading?

P&L stands for profit and loss. It is the money a trade or a desk has made or lost. Traders, risk managers and bosses all watch it daily.

P&L comes in two kinds:

  • Realized P&L is locked in. The trade is closed and the cash has moved.
  • Unrealized P&L is on paper. The trade is still open, so its value changes as prices move.

Mark-to-market P&L is the unrealized kind.

New to energy trading? The free Energy Trading Fundamentals path takes it in order, from the grid to P&L.

What does mark-to-market mean?

To "mark to market" is to value a trade at the current market price. You ignore the price you paid. You ask what the trade is worth now.

Say you bought gas at £25/MWh last week. Today it trades at £27/MWh. Your gas is worth £2/MWh more than you paid. That £2/MWh is your mark-to-market gain. If the price fell to £23/MWh, you would have a £2/MWh loss.

The mark-to-market P&L formula

MTM P&L = (Market Price - Trade Price) x Signed Quantity

Market Price is today's price for the same product and delivery month. Trade Price is the price you agreed. Signed Quantity is positive for a buy and negative for a sell.

The sign does the hard work. A buy is a plus. A sell is a minus. The formula then gets the direction right on its own:

Trade Price move Calculation P&L
Buy 100 Up £5 (+5) x (+100) +£500
Buy 100 Down £5 (-5) x (+100) -£500
Sell 100 Up £5 (+5) x (-100) -£500
Sell 100 Down £5 (-5) x (-100) +£500

A buyer (a "long" position) gains when prices rise. A seller (a "short" position) gains when prices fall. Get the sign wrong and a profit reads as a loss.

Realized vs unrealized P&L

Realized P&L Unrealized (mark-to-market) P&L
Trade is closed and settled Trade is still open
Cash has moved No cash has moved yet
Fixed for good Changes whenever prices move
Goes into the accounts Drives daily risk reports

Why report paper profits at all? Energy trades often deliver months ahead. Nobody can wait that long to learn if a position is losing. Desks have daily loss limits. Exchanges ask for more collateral (a margin call) when losses grow. Regulators want valuations too: under EMIR, many firms report the value of their derivatives every day.

Realized and unrealized P&L together: a part-closed position

Most positions are partly closed, so they carry both kinds at once. (British desks write "realised" and "unrealised". The meaning is the same.)

You buy 400 MWh of January power at £80/MWh.

A week later you sell 250 MWh of it at £84/MWh. Today the market is £83/MWh.

Realized P&L = (84 - 80) x 250 = +£1,000. This part is closed: bought at £80, sold at £84.

Unrealized P&L = (83 - 80) x 150 = +£450. The other 150 MWh is still open, valued at today's price.

Total P&L = 1,000 + 450 = +£1,450

Now the market falls to £78/MWh overnight. Only the open part moves:

Market at £83 Market at £78
Realized (250 MWh, closed) +£1,000 +£1,000
Unrealized (150 MWh, open) +£450 -£300
Total P&L +£1,450 +£700

The total fell by £750 in a day: £5 on each of the 150 MWh still open. That change is the day's P&L, the number a desk reports each morning. The £1,000 did not move, and it never will.

Three things follow from this:

  • Total P&L = realized + unrealized. A report that shows only the total hides how much of it can still be lost. Desks often call the total across all trades the net P&L.
  • Unrealized becomes realized when you close the rest with an offsetting trade, or when the contract is delivered and paid for.
  • Marking every trade gives the same total. Apply the formula to the buy and the sell separately at £83: (83 - 80) x 400 = +£1,200, and (83 - 84) x (-250) = +£250. Together, £1,450. The portfolio example below works this way.

One caution about "no cash has moved yet". On an exchange, gains and losses on open futures are paid in cash every day as margin, long before the trade is closed. Energy derivatives explained shows how.

Worked example: one trade

In November you buy 100 MWh of NBP gas for January delivery at £25/MWh.

By late December, a cold forecast lifts January gas to £27/MWh.

MTM P&L = (27 - 25) x (+100) = +£200

You are £200 up on paper. Sell 100 MWh at £27 today and the £200 becomes realized. Keep the trade open and the number keeps moving.

Now a short trade:

In October you sell 200 MWh of UK baseload power at £65/MWh.

Mild, windy weather pushes the price down to £60/MWh.

MTM P&L = (60 - 65) x (-200) = (-5) x (-200) = +£1,000

You sold high and the price fell. The two minus signs cancel, and the result is a profit.

Worked example: a hedged portfolio

Real desks hold many trades. Here are six gas trades, split into two "books". The physical book holds the gas the firm will actually deliver or receive. The hedge book holds trades that offset its price risk. Today January gas is £27/MWh and February is £26/MWh.

Trade Book Month Signed qty (MWh) Trade price Market MTM P&L
TR-001 Physical Jan +500 £25.00 £27 +£1,000
TR-002 Physical Jan -300 £26.00 £27 -£300
TR-003 Hedge Jan -150 £25.50 £27 -£225
TR-004 Physical Feb +400 £24.00 £26 +£800
TR-005 Physical Feb -320 £25.00 £26 -£320
TR-006 Hedge Feb -60 £24.50 £26 -£90
Total +£865

Split by book, the picture is clearer:

  • Physical book: +£1,180. Prices rose, and the firm is a net buyer.
  • Hedge book: -£315. The hedges are sales, so they lose when prices rise.
  • Net: +£865.

The hedge loss is not a mistake. Hedges are meant to move against the physical book. That is how they limit risk.

Why a small net P&L is often good

The hedges cover 75% of the net physical position (buys minus physical sells) in each month. So where does the £865 come from? Three places:

  • Buys matched by sells: £620. In January the firm bought 500 MWh at £25 and sold 300 MWh at £26. That locks in £1 on 300 MWh, so £300. February does the same on 320 MWh, so £320.
  • Hedges above cost: £105. The gas left over cost £25 in January and £24 in February. The hedges sold part of it 50p higher: 150 MWh in January and 60 MWh in February.
  • The unhedged part: £140. 50 MWh in January and 20 MWh in February have no hedge. Each MWh gained £2.

Only the last £140 moves with the market. The other £725 is fixed, whatever prices do next.

A well-hedged desk shows modest P&L swings. A big swing usually means a big unhedged bet, or hedges that do not match the physical trades.

Mark-to-market P&L in Python

The same calculation as code. Each trade's P&L is one line of the formula.

from collections import defaultdict

trades = [
    # (id, book, month, signed quantity in MWh, trade price in GBP/MWh)
    ("TR-001", "Physical", "Jan", +500, 25.00),
    ("TR-002", "Physical", "Jan", -300, 26.00),
    ("TR-003", "Hedge", "Jan", -150, 25.50),
    ("TR-004", "Physical", "Feb", +400, 24.00),
    ("TR-005", "Physical", "Feb", -320, 25.00),
    ("TR-006", "Hedge", "Feb", -60, 24.50),
]
market = {"Jan": 27.00, "Feb": 26.00}  # today's prices, GBP/MWh


def mtm_pnl(qty: float, trade_price: float, market_price: float) -> float:
    """Unrealized P&L of one trade: (market - trade) x signed qty."""
    return (market_price - trade_price) * qty


by_book = defaultdict(float)
for trade_id, book, month, qty, price in trades:
    by_book[book] += mtm_pnl(qty, price, market[month])

print(dict(by_book))          # {'Physical': 1180.0, 'Hedge': -315.0}
print(sum(by_book.values()))  # 865.0

A real desk may hold thousands of trades. The code stays the same. Only the data grows.

Live prices vs settlement prices

Which "market price" do you use? It depends on the question.

  • Live prices come from broker screens and exchange feeds. Traders use them to watch P&L during the day.
  • Settlement prices are the official closing prices that exchanges publish each day. They are used for the books, the daily P&L report and margin calls.

P&L can swing a lot within a day. Take a desk that bought 500 MWh at £26 and hedged by selling 400 MWh at £26.50. At 9am gas is £27 and the P&L is +£300. By 2pm gas is £25 and the P&L is +£100. Nothing was traded, yet £200 of value moved.

Many "my P&L does not match the system" arguments come down to this. One number used a 2pm live price. The other used the 5pm settlement price.

Common mistakes

  • Wrong sign. A sell entered as a positive quantity turns profits into losses.
  • Wrong delivery month. A January trade must use the January price, not February's.
  • Stale prices. Yesterday's price gives yesterday's P&L. Check when each price was last updated.
  • Mixed units. UK gas trades in pence per therm. Convert to £/MWh (multiply by 0.3412) before you mix it with MWh quantities.
  • Mixed price sources. An exchange, a broker and your own system can show three slightly different prices. Pick one source per report.

Where mark-to-market leads next

Mark-to-market P&L is the base for most of a desk's risk numbers:

  • Forward curves: one market price for each delivery month, so each trade is valued at its own month's price.
  • Value at Risk (VaR): a loss you should exceed only rarely. Say you hold 200 MWh long and unhedged. Assume that on 95% of days, gas falls by less than £2/MWh (an illustrative figure). Your one-day 95% VaR is then 200 x £2 = £400. On 19 days out of 20, you lose less than that. It is not the most you can lose. Energy trading risk management works VaR through, with limits and credit risk.
  • Scenarios: rerun the formula with shocked prices. "What if gas jumps 20%?"
  • P&L attribution: split today's P&L into what the market did to old trades and what new trades added.

Position Aggregation and Delta Exposure covers the step before this one: working out what you hold.


How This Fits the Curriculum

This guide builds directly on Position Aggregation. You must know your positions before you can value them. Together, these two guides form the foundation: what you have, and what it's worth. If you're just getting started, see the Energy Trading 101 overview first.

Spark spreads use P&L mechanics to value generation decisions. Storage arbitrage uses P&L to calculate buy-low-store-high profitability. Every topic forward assumes you can calculate and interpret MTM P&L correctly.


Prerequisites

Complete the Position Aggregation guide first. This guide assumes you understand signed quantities, position aggregation by commodity + delivery + book, and physical vs financial separation. You'll use the same 6-trade reference portfolio, now adding market prices and P&L calculations.


Mastery Tip

Track real UK gas prices (National Grid Gas NBP index) and UK power prices (Elexon BMRS day-ahead) for one week. Pick two simple imaginary trades: one long, one short. Calculate unrealized P&L each day using real market prices. Track how P&L moves when prices rise versus fall. Watch how long positions behave opposite to short positions.

The formula is simple - but the intuition ("why did my P&L go up when prices fell?") only clicks when you see real market moves affect real positions you're tracking. When you stop needing the formula and just know which direction P&L will move, you've internalized MTM mechanics.


What the full guide adds

This article covers the formula and the worked examples. The full guide goes further:

  • the whole P&L report built step by step, starting from the positions of the previous guide;
  • P&L by book across a portfolio of trades, with realised and unrealised kept apart;
  • an introduction to what a desk asks next: forward curves, Value at Risk, scenario analysis and stress testing;
  • counterparty credit risk, P&L attribution, options and currency exposure.

The full guide is in the community on Skool, with the rest of the series, and it is updated regularly as the markets change. If you want to work on a trading desk, read it to understand the subject properly. To join, start at the Energy Trading Fundamentals course page.


What You'll Learn

  • 📐 The Core Formula: MTM P&L = (Market Price - Trade Price) × Signed Quantity. Three inputs, one calculation, the base of every ETRM system's P&L.
  • 💰 Realized vs Unrealized: Locked-in profits vs paper gains. What moves cash and what moves daily risk reports.
  • ➕➖ Why Sign Matters: Long positions profit when prices rise, short positions profit when prices fall. The arithmetic handles direction automatically.
  • 📊 Interpreting P&L: Why small net P&L often signals good risk management, not poor trading. Understanding hedge-effective portfolios.
  • ⏱️ Real-Time Monitoring: Live prices for intraday P&L, settlement prices for the official books.
  • 🔮 Advanced Preview: Forward curves, VaR, scenario analysis and P&L attribution: where MTM leads next.

Desks pay £850 a day for developers who understand this.

You can now mark a book to market. The next thing a desk asks is the limit: position limits, Value at Risk, credit exposure and the risk report.

£850 is the UK contract median for energy trading developers (ITJobsWatch, 2026), and analysts and business analysts who understand the trade are hired for the same reason. The free Fundamentals path takes about a week part-time. If you have a date, an interview, a start, a go-live, say so when you join and Jordan Dimov will give you the reading order. On Premium, Jordan reviews your code and your CV.

Day rates: IT Jobs Watch, UK contracts, six months to 9 November 2026.

"Jordan's in-depth explainers on topics ranging from interconnector flows to viewing gas-fired generators through option frameworks helped me get my role as an analyst on a power and gas trading desk." Tom R.

Training a team? VIP is one invoice, with seats you can reassign. See the VIP plan

Your employer can pay by invoice. How to ask