Trading

Keith A. Lewis

April 25, 2024

Abstract
Buyers and sellers buy and sell

\{(\tau_j, \Gamma_j)\mid \tau_0 < \cdots < \tau_n, \Gamma_j\} is a vector space.

(\tau, G) + (\nu, H) = (\eta, K)

\eta = t if \tau = t and \nu \not= t in which case K = G.

\eta = t if \nu = t and \tau \not= t in which case K = H.

\eta = t if \tau = t and \nu = t in which case K = G + H.

Holding one share from time u to time v corresponds to the trading stragegy of buying 1 share at u and selling one share at v. Of course you exchange shares with someone other than yourself. It is customary in Mathematical Finance literature to assume there is a “market” available that provides price X_t at trading time t. It reality, things are more complicated. Anyone who has ever traded has experienced slippage. The price you see on a trading screen is not necessarily the price at which your order will be executed. The price also depends on whether you are buying or selling — the bid/ask spread. That might increase depending on the amount you want to buy or sell. It also depends on the credit worthiness of the counterparties involved.

We will ignore all that for now and pretend any amount can be bought or sold at exactly price X_t. These unrealistic assumptions can be addressed by more precise mathematical models.

The market has many instruments so we assume X_t is a vector indexed by all available market instruments. A common assumption is that a money-market instruement available for financing trading strategies. In the Black-Scholes/Merton model it has price X_t = \exp(\rho t) for some constant \rho\in\boldsymbol{R}. We don’t make that assumption.

A trading strategy is a finite number of increasing (stopping) times (\tau_j) and the corresponding number of shares to trade \Gamma_j that depend only on the information available at time \tau_j. Trades accumulate to a position {\Delta_t = \sum_{\tau_j < t} \Gamma_j}. Note the strict inequality. It takes some time for a trade to settle and become part of the position. Define \Gamma_t = \Gamma_j if t = \tau_j for some j and is zero otherwise.

Exercise. Show \Delta_t = \sum_{s<t}\Gamma_s is piecewise constant on (\tau_j, \tau_{j+1}].

Hint: The value on (\tau_j, \tau_{j+1}] is \sum_{i\le j}\Gamma_i.

In particular, \Delta_t is left-continuous and we can define the profit and loss for the strategy by the stochastic integral.

Value

The value, or mark-to-market of a position is {V_t = (\Delta_t + \Gamma_t)\cdot X_t}. Note the position \Delta_t does not contain the trade just executed, \Gamma_t. This also makes the unrealistic assumption that the entire position can be liquidated at exactly price X_t.

Mark-to-market is used for accounting and does not involve actual trading. Often the price is just a good faith estimate if the instrument is not actively traded.

Account

Trading involves entries in the trading account/blotter. Many instruments entail cash flows C_t in proportion to the amount held at time t. Stocks have dividends, bonds have coupons, futures have periodic margin adjustments and their price is always 0. The money-market account has no cash flows.

The amount that shows up at time t in the account is A_t = \Delta_t\cdot C_t - \Gamma_t\cdot X_t. You get all cash flows proportional to your existing position and pay for the trade just executed.

Profit and Loss

The profit and loss of a trading strategy over an interval (u, v] is N(u, v) = V_v - V_u + \sum_{u < t \le v} A_t.

Exchange

If Ford is trading at 8 the buyer can give the seller 8 dollers to obtain one share of Ford stock. With the above assumptions, the buyer can give 8a dollars to obtain a shares of F for any real number a\in\boldsymbol{R}, ignoring the fact stocks trade in a discrete number of shares.

A position is an amount of an instrument owned by an entity \pi = (a,i,e). A market is a set of positions1. An exchange is a time, a buyer position, and a seller position \chi = (t, \pi, \pi'). The market \{\ldots, (a,i,e),\ldots,(a',i',e')\ldots\} becomes \{\ldots, (a',i',e),\ldots,(a,i,e')\ldots\} after the exchange. Usually i is a currency and i' is some instrument. The price of the exchange is X_t = a/a'. If you exchange (16, \$) for (2, F) the price is 16/2.

If a seller quotes a price X_t then the exchange \chi = (t, (X_t a', e), (a', i', e')) is available to the buyer.

Transaction

A transaction is a collection of exchanges. Often several counterparties are involed in trading, e.g., a broker who gets paid for hooking up the buyer and seller.


  1. Actually a multiset. In practice, positions are associated with a unique position id. The position id can be used as a primary key to associate more details about the position in a table using that as a foreign key.↩︎