Adverse selection cost is the profit lost when trades execute under conditions suggesting the market will move against them. Liquidity often appears greatest precisely when execution is least profitable. section 4.2
Order size trade-off
A request to buy $3,000 may execute only $2,000 because insufficient liquidity prevents the remaining purchase. Keeping orders small misses profit opportunities; increasing them too far raises adverse selection. The best order size balances both effects. section 4.2
A stylized model represents the cost as asc = 0.001 × exp(2 × order_size), with order_size measured in thousands of dollars. The model is qualitative rather than data-derived, so it supports exploration rather than precise attribution. section 4.2
Listing 4.6 Markout profit as a function of threshold and order size
def markout_profit_2D(threshold, order_size):
cost = 1 #1
pps = 1 #2
asc = .001*np.exp(2*order_size) #3
signal = np.random.normal() #4
eps = 2*np.random.normal() #4
if (signal > threshold #5
or signal < -threshold): #6
profit = order_size*(pps*np.abs(signal) - cost + eps) - asc #7
else:
profit = 0 #8
return profit
Inspect the Python markout-profit function that combines threshold, order size, signal, execution cost, noise, and adverse selection cost. section 4.2
