# Understanding P&L and Risk

Let’s imagine you’re a commodities trader.

Every day you arrive at your desk and look at your Risk and P&L reports, telling you the value and risk of your trading positions.

Whenever something in those reports doesn’t look quite like what you were expecting you have to do some counterfactual exploration of all the various inputs to understand what’s happened.

For example, let’s assume that over the course of the day your colleagues have made the following trades:

At the end of the day, the market closes with the following prices:

Now we want to price our risk and P&L for the end of this week. Let’s extract the information we need to calculate our P&L:

For the purposes of this simple example, we’ll just use SQL to calculate the P&L. However, in the ‘real world’, we’d usually have much more complex objects (yield curves, etc.) and would use a quant pricing library.

So far so good.

On the Monday morning, after a pleasant weekend’s break, you come back into the trading floor.

At the end of this Monday trading day, the market closes with the following prices:

We now recalculate our new P&L:

Oh no!

What if we could ignore the today’s trades, and just see what our closing position on Friday would have looked like in the market at the end of today.

We have now established that today’s trades must be causing the dramatic P&L change.