5 Profit & Loss

In this chapter we will consider various performance related calculations: pnl, returns, volatility.

The most basic performance measure of a particular trade is its daily profit and loss, usually shortened to PNL. In essence, daily pnl measures how much the trade increased or decreased in value on a particular day? We will also be interested in cummualative PNL - also know as trade-to-date (TTD) PNL - which measures the total amount a trade has increased or decreased in value since its inception.

In subsequent chapters, we will encounter a variety of theoretical statements regarding the pricing and hedging of options; many of these can be easily translated into empirical statements about PNL.

PNLs without context are often hard to interpret, which is where the notion of portfolio returns show their value. A portfolio return normalizes a PNL by the amount of capital required to generate it. A somewhat related concept is that of asset price returns, which measures the percentage change in the price of an asset.

Volatility is an important concept in finance - it captures the notion of variability. Volatility can refer to the PNL variability of a trading strategy, and also the price variability of a particular asset.

5.1 Stock PNL

As mentioned in the Quantitative Results chapter, after a stock has been issued, it can be traded in the secondary market. These trades occur on various exchanges, throughout the day, on most business days. The stocks that you are familiar with (GOOG, AAPL, FB) trade tens of thousands of times a day, with millions of shares transacted daily.

For a given trading day, the final trade price of a stock is referred to as the close price. A series of close prices of a stock can give information about the performace of that stock as an investement.

Daily close prices will be relevant to us for two reasons:

  1. The payoff of an equity option is determined by the close price of its underlying on the option expiration date.

  2. Close prices are used to determine the daily PNL of a stock position.

In this section we will concern ourselves with #2.

5.1.1 Intuition and Notation

When discussing PNL rigorously, the congitive heavy lifting happens in two steps: first, developing an intuition for what you are trying to convey; second, setting up the notation appropriately.

Let’s start with the intuition. Suppose we purchase a share of stock, hold it for a few days, and then sell it. Each day we would like to have a sense for how our position faired done for that day, and also in total up to that point. That is precisely what daily PNL and TTD PNL convey.

The daily PNL of our single share purchase is simply the dollar change in the price of the stock. The cummulative PNL the total amount of dollar change in the price of the stock since the purchase, which is the same as the sum of the daily PNLs.

Now let’s set up the notation.

Let \(\mathcal{S}\) be a particular stock, and let \(t_1, \ldots t_n\) be consecutive trading days. Suppose that we purchase one share of \(\mathcal{S}\) in the middle of day \(t_1\), for a purchase price of \(S^o\). Suppose further that we hold that share until day \(t_n\), at which time we sell it for \(S^c\).

We seek to define the following:

Daily: \(D_{i}\) - the daily PNL for the trade as of end-of-day \(t_i\).

TTD: \(C_{i}\) - the trade-to-date PNL for the trade as of end-of-day \(t_i\).

5.1.2 Marking to Mid

Suppose that our price data consists solely of closing prices \(S_1, \ldots\, S_n\). Recall that our initial purchase price to enter the trade was \(S^o\) and that our sale price to exit the trade was \(S^c\).

Definition 5.1 (Stock Purchase Marking to Mid) \[\begin{align*} D_{i} &= \begin{cases} S_{1} - S^{o} & i = 1 \\ S_{i} - S_{i-1} & 1 < i < n \\ S^{c} - S_{n-1} & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (S^{c} - S_{n-1}) & i = n\end{cases} \end{align*}\]

Notice that on the first day of the trade, day \(t_{1}\), the daily PNL is the difference between the close price and the purchase price. On the final day of the trade, \(t_n\), the daily PNL is the difference between the sale price and the previous close.

Exercise 5.1 Show that for \(i < n\) we have that \(C_i = S_{i} - S^o\).

Exercise 5.2 What is a simpler expression for \(C_n\)?


The fact that \(C_{i} = S_{i} - S^{o}\) can be interpreted as the following intuitive statement: the stock purchase is worth the difference between its current price and the price we paid for it.

The tacit assumption of this simple calculation is that if we unwind our position, we would do so at the mid price. For situations which involve infrequent trading of stocks, this type of analysis is perfectly fine.

However, depending on your application and the availability of the data, you may want to incorporate the fact that you would have to unwind at the bid. This is what we will do in the next section.

5.1.3 Marking to Bid

Suppose now that instead of a single end of day close price, that our data set tells us both the bid price and thd ask price at the end of the day. These will be denoted \(B_{i}\) and \(A_{i}\), respectively.

If we want to mark our stock trade to the bid, then we would need to modify the definiton of our daily and cumulative PNL as follows:

Definition 5.2 (Stock Purchase Marking to Bid) \[\begin{align*} D_{i} &= \begin{cases} B_{1} - S^{o} & i = 1 \\ B_{i} - B_{i-1} & 1 < i < n \\ S^{c} - B_{n-1} & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (S^{c} - B_{n-1}) & i = n\end{cases} \end{align*}\]

By marking to the bid, we are accounting for the fact that if we were to exit our long stock position, we would sell the stock, and we would have to sell the stock at the bid.

If you are analyzing a trading system that involves frequent opening and closing of positions, then it is important to account for bids and asks in your PNL calcuations.

5.2 Option PNL

Since options are more complex than stock, their PNL caclulations can seem more formidable. However, these PNLs operate on the exact same principles.

Let’s begin with the simplest PNL calculation for options: total PNL on expiration date.

5.2.1 Total PNL At Expiration

Suppose we trade a vanilla option \(\mathcal{O}\) at a price \(P\) on trade date \(t_{1}\), and we hold that position until expiration, which is trade date \(t_{n}\). Let \(\Pi\) be the payoff of the option. Then at the time of expiration, the total PNLs (i.e. TTD PNL) for for the long and short positions are as follows:

Definition 5.3 (Option TTD PNL at Expiration)

Long: \(\Pi - P\)

Short: \(P - \Pi\)


When you buy an option, you pay a (strictly positive) premium up front and recieve a (non-negative) payoff at expiration. Thus, your total PNL at expiration is the difference between the payoff you recieve and the premium you paid.

When you sell an option, you receive premium up front and you are obligated to make a payoff at the time of expiration. Thus, your total PNL at expiration is the difference between the upfront premium you recieved and the payoff you make at the time of expiration.

5.2.2 Intuition and Notation

The notational setup for option PNL is very similar to that of stock PNL.

Suppose we trade an option \(\mathcal{O}\) at a price \(P\) on trade date \(t_{1}\), and we hold that position until expiration, which is trade date \(t_{n}\). The letter \(i\) will serve as an index over the trade dates, so \(i = 1,\ldots,n\).

Let \(B_{i}\) and \(A_{i}\) be the end-of-day bid and ask prices of the option for trade date \(t_{i}\). Note that both \(B_{n}\) and \(A_{n}\) are equal to the option payoff, which we denote as \(\Pi\). We seek to define the following:

Daily: \(D_{i}\) - the daily PNL for the trade as of end-of-day \(t_i\).

TTD: \(C_{i}\) - the trade-to-date PNL for the trade as of end-of-day \(t_i\).

Intuitively, the daily PNL of an option trade is the dollar change in the value of the position for that day. The cummulative PNL is the total dollar change - this is the same as the sum of the daily PNLs.

Option markets have much wider spread than equity markets, so it’s important to account for bid-ask spread in most analysis of options markets. However, marking to mid can be a valid approach for certain applications, so we will present both approaches.

For both approaches we separate long and short option positions

5.2.3 Marking to Mid

Let \(M_i\) be the mid price at the end of trade date \(t_i\). Thus, \(M_i\) is the the average of \(A_i\) and \(B_i\). When marking to mid prices the PNL for the long position is as follows.

Definition 5.4 (Long Option - Marking to Mid) \[\begin{align*} D_{i} &= \begin{cases} M_11 - P & i = 1 \\ M_{i} - M_{i-1} & 1 < i < n \\ \Pi - M_{n-1} & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (\Pi - M_{n-1}) & i = n\end{cases} \end{align*}\]

The PNL definitions of the short position are simple the negatives of the definitions for the long position.

Definition 5.5 (Short Option - Marking to Mid) \[\begin{align*} D_{i} &= \begin{cases} P - M_1 & i = 1 \\ M_{i-1} - M_{i} & 1 < i < n \\ M_{n-1} - \Pi & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (M_{n-1} - \Pi) & i = n\end{cases} \end{align*}\]

Exercise 5.3 For the long position, show that for \(i < n\) we have that \(C_i = M_{i} - P\).

Exercise 5.4 For the long position, show that \(C_n = \Pi - P\).

Exercise 5.5 For the short position, show that for \(i < n\) we have that \(C_i = P - M_i\).

Exercise 5.6 For the short position, show that \(C_n = P - \Pi\).

5.2.4 Marking to Bid/Ask

For a long option position, it is appropriate to mark to bid because to unwind the position we would need to sell the options at the bid price. As for the PNL formulae, we simply replace the mid prices with the bid prices.

Definition 5.6 (Long Option - Marking to Bid) \[\begin{align*} D_{i} &= \begin{cases} B_1 - P & i = 1 \\ B_{i} - B_{i-1} & 1 < i < n \\ \Pi - B_{n-1} & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (\Pi - B_{n-1}) & i = n\end{cases} \end{align*}\]

For a short option position, we mark to the ask because unwinding the position would involve buying back the option at the ask price. So, the PNL formulae are modified by replacing the mid prices with the ask price.

Definition 5.7 (Short Option - Marking to Ask) \[\begin{align*} D_{i} &= \begin{cases} P - A_1 & i = 1 \\ A_{i-1} - A_{i} & 1 < i < n \\ A_{n-1} - \Pi & i = n\end{cases} \\[10pt] C_{i} &= \begin{cases} \sum_{k=1}^{i} D_{k} & i < n \\[10pt] \sum_{k=1}^{n-1} D_{k} + (A_{n-1} - \Pi) & i = n\end{cases} \end{align*}\]

Exercise 5.7 For the long position, show that for \(i < n\) we have that \(C_i = M_{i} - P\).

5.3 Portfolio PNL

In a professional setting, it is rare that you will calculate the PNL of a single stock trade or options trade. Rather, you will want to calculate the PNL of a portfolio of trades. Conceptually this is quite simple, as the daily PNL of a collection of trades is simply the sum of the daily PNL of the individual trades.

In the language of mathematics, portfolio pnls are linear combinations of the pnls of trades on individual shares of stocks and options. From a coding perspective, calculating a portfolio PNL from the PNLs of its constituent trades is a simple matter of grouping and aggregation.

In practice, for large numbers of trades, the only real challenge is that of missing or erroneous price data. But this complexity arise from data integrity, not from the underlying quantititative finance or programming.

5.4 Returns

Suppose you are a trader and you are analyzing your book of trades. You do you’re daily calculations and you see that your daily PNL is a loss of $10,000. A loss is never good, but how badly do you feel about this?

This is a difficult question to answer, but one critical peice of information is how big a book of trades you are managing. For example, if you are a retail trader who’s total investment size is $20,000, then a $10K loss would mean you were down 50% in one day, which should be cause for concern. On the other hand, if you are a portfolio manager of a $100 million dollar fund, then $10K is effectively zero.

So, while PNL is an important performance metric, it is often hard to interpret without first normalizing by the amount of capital required to fund the investment. This is precisely what the notion of a return is.

5.4.1 Portfolio Returns

Let \(\mathcal{P}\) be some portfolio of of trades. Suppose we are interested in analyzing the returns of this portfolio on trade days \(t_1, \ldots, t_n\). This portfolio of trades could be as simple as buy one share of stock on day \(t_1\) and then sell it on day \(t_n\). Or it could be highly complex automated trading strategy in which thousands of options and shares of stock are traded every day.

Let \(I_{0}\) be the amount of capital required to fund the investments at the outset. Let \(D_{i}\) be the daily pnl for \(\mathcal{P}\) for day \(t_{i}\). Then the daily return for the portfolio are defined as follows:

Definition 5.8 (Portfolio Return) Let \(r_{i}\) denote the daily return for portfolio \(\mathcal{P}\) on trade date \(t_{i}\). Then we have that

\[\begin{align*} r_{i} = \frac{D_i}{I_i} \end{align*}\]

where,

\[\begin{align*} I_{i} = I_{0} + \sum_{k=1}^{i} D_{k} \end{align*}\]


Said in words, \(I_i\) is simply the initial capital, plus cummulative pnl of the portfolio up until the end of trade date \(t_{i}\),


Exercise 5.8 Show that: \[\begin{align*} \frac{I_{n}}{I_{0}} = \prod_{k=0}^{n} (1 + r_{i}). \end{align*}\]

5.4.2 Stock Price Returns

Stock price returns is a related concept that we will address in this section.

Let \(\mathcal{S}\) be a stock and let \(t_{0}, \ldots ,t_{1}\) be consectutive trading days. And let \(S_i\) be the close price for trade date \(t_i\). Then stock price returns for \(\mathcal{S}\) are defined as follows.

Definition 5.9 (Stock Price Returns) Let \(t_i\) and \(t_j\) be tradind days with \(0 < i < j\). The return of stock \(\mathcal{S}\) between \(t_i\) and \(t_j\) is denoted \(r_{i,j}\) and is defined to be

\[\begin{align*} r_{i,j} = \frac{S_j - S_i}{S_i} = \frac{S_j}{S_i} - 1. \end{align*}\] When \(j = i + 1\), meaning that \(t_{i}\) and \(t_{j}\) are consecutive trading days, then this return is called the one day return and is denoted \(r_{j}\).


Exercise 5.9 Show that

\[\begin{align*} r_{0,n} = \Bigg( \prod_{k = 1}^{n} \big( 1 + r_k \big) \Bigg) - 1 \end{align*}\]

5.5 Volatility

Both portfolio returns and price returns give a sense for growth or decline of the value of an investment - the so called directional movement of the investment.

We will also be concerned with overall variability of portfolios and stock prices. One important measure of this overall variability is the volatility.

Definition 5.10 Let \(r_{1}, \ldots , r_{n}\) be returns (either portfolio or price) for consecutive trading days \(t_1, \ldots t_n\). Then the volaility of these returns is their annualized standard deviation:

\[\begin{align*} \sigma = \text{SD}((r_{1}, \ldots , r_{n})) \cdot \sqrt{252}. \end{align*}\]

The factor of \(\sqrt{252}\) arises from the market convention of annualizing the volatility, since there are 252 trading days in a year.

This calculation comes up often in option pricing, because an important factor in the price of an option is the volatility of its underlying.