Imaging the following highly simplified broker-client market: at each time step, a client ask the broker for quotes; the broker provides a two-way quote — a bid price and an ask price for which the broker is willing to buy and sell respectively; the client can then choose to accept or reject.
To model the client, we assume a client is either a buyer or seller (excluding hedge funds that could flip between buy and sell after seeing the quote). Each time step, only a unit number of security could be transacted. Each buyer or seller has an opinion on the true price of the security. We can use two random variables for buyer and and for seller to collectively describe the distribution of true price they think. The buyer should on average expect a lower price than the seller (), otherwise the market is not in equilibrium as the buyers will immediately buy as much as they can since the market mid is lower than the true price they think and then market will quickly reach equilibrium again. For now, assume the bid-ask spread is zero — that the broker is willing to both buy and sell at the same price . In one time step, the probability that the dealer get a buy order is , and getting a sell order is , where and is the probability of a random client being a buyer or seller respectively. An example is shown below in Fig. 1.
At the price where the blue and red cdfs intercept, it is the true mid price where
This true mid is the most efficient price that facilitates the maximum transaction. Assume a different market in which at each time step, there is a grand auction to let buyers and seller to write down orders and the prices they are willing to transact. Then matching the orders will yield this mid .
It is also advantageous for the broker to quote this true mid for his own benefit as on average, the buy and sell flows will match. Otherwise, the broker’s inventory will grow linearly with time. In this idealized model, there are two challenges for being the broker:
a) How does the broker know the true mid?
Broker is not running a grand auction which gives him a full picture on the distrubitions of and . What he can do is to make quote and then see whether it gets accepted or rejected. In theory, he can make a series random quotes based on some prior distribution he thinks and then infer out the distributions from the results of the quotes. Dashed lines in Fig. 1 are the inferred distributions by running an expectation maximization algorithm on a Logistic mixture model. They do converge to the true distributions. However, the convergence is only reached until the quotes sample large enough range and in huge numbers. To most efficiently use the data, the broker has to use an algorithm to update the quote online.
b) How to keep inventory size down?
Even if the broker knows the true mid and therefore on average the buy and sell flows cancel, the random nature of the orders make the fluctuation–or standard deviation–of the inventory size grow proportional to the square root of time. To keep inventory size under a limit, the broker has to skew the mid. For example, skew the mid below the true mid so it is more likely for a buyer to accept to get rid of a positive inventory. However, as on average the security is transacted at the true mid, the broker will lose some money due to the skew. He will have to charge some bid-ask to compensate the skew.
Optimal strategy for the broker
We can come up with an optimal strategy for the broker by breaking the problem into two parts according to the two questions above. The first problem is an online measurement problem. The second is a stochastic optimal control problem. As a first attempt, we do not try to optimize the bid-ask spread but assume the broker charge a small fixed bid-ask spread. Optimizing the bid-ask spread has to take into consideration the competition with other brokers for market share, which is not captured in this model anyway.
a) Online measurement
The true mid is not directly observable. We make the usual assumption that it follows a martingale process as
where follows a standard normal distribution and is the volatility from market moves. Given an estimate of mid price at time t-1, the expectation of mid price does not change
but the expectation of variance increases with time
At time step t, after making a quote with mid price to the client, the broker receives response from the client. Denote the response as a random variable , where -1, 0, 1 means the client will buy, do away, and sell respectively. Denote the skew as the difference between quote and true mid as . The robust relationship that the broker relies on to get an idea on the true mid is that there is a positive correlation between and , which we can approximate by a linear regression relationship
where is a random variable independent of and with mean 0, variance . Conditioned on the response at time , we have
These can be used to update our estimate for mid at time t. In practice, the parameters and be estimated from a number of recent past quotes. We get the equations to update our estimates from t-1 to t:
where denote the estimates for mean and variance of , and
is the Kalman gain. Essentially, Eq. (1) is the state-transition model and Eq. (2) is the observation model. We use a Kalman filter to update our estimate for mid price online.
b) Stochastic optimal control
To make the problem analytically solvable, we approximate the our discrete model with a continuous one.
where is the size of inventory, is a coefficient related to in Eq. (2), is a Brownian motion.
Suppose the cost function to optimize is
As the rate of accumulating inventory is linearly proportional to skew and the amount of money paid to offload the accumulated inventory is also proportional to skew, the is a probably a decent estimate of cost for skew being away from zero. The other cost on inventory is more hand-waving. It is just meant to be monotonically increasing with the magnitude of inventory.
Using Hamilton–Jacobi–Bellman equation, we get the optimal control
and the associated cost function
The results mean we simply skew the quote proportional to the size of the inventory. Under this optimal control, the cost is accumulating at a speed of .
Simulation results
We can simulate the client behavior and the broker’s strategy as described above. In this simulation, the buyer and sellers have equal population. The standard deviations for are fixed to be 2; and on average buyer expects price to be lower than that of seller by 4: . The true mid follows a Brownian motion. The broker quote, true mid and broker estimated mid are shown in Fig. 2. After an initial period (t<1e4) when the quote oscillates widely, the quote tracks the true mid price closely.
Inventory and PnL the broker makes are shown below. The inventory is usually below 10. During the time near t~8e4 when there is a stochastic trend going down, the inventory shoots to ~40, which also reflects as a drawdown in the PnL. The bid-ask spread is fixed at 0.75, at which the broker consistently makes a profit.
A zoom-in look at the quote below (Fig. 4 and 5) shows that the quote (estimated mid plus skew) actually tracks the true mid much better than the estimated mid. This is probably because in Eq. 2, is the difference between the quote and the true mid. However in our simulation, the true mid is replaced by the estimated mid. This introduces an inconsistency. The skew proportional to the inventory size somehow corrects this inconsistency.
Leave a comment