KEMBAR78
UChicago Algo Trading Lecture 3 Micro Modeling | PDF | Order (Exchange) | Stationary Process
0% found this document useful (0 votes)
8 views69 pages

UChicago Algo Trading Lecture 3 Micro Modeling

The document discusses key concepts in algorithmic trading, focusing on market and limit orders, as well as the mechanics of order-driven markets. It defines important terms such as best bid, best offer, and bid/ask spread, and explains how market orders execute at the best available price while limit orders set conditions for execution. Additionally, it outlines the rule-based order-matching systems that prioritize orders based on price and time to facilitate trades.

Uploaded by

Burhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views69 pages

UChicago Algo Trading Lecture 3 Micro Modeling

The document discusses key concepts in algorithmic trading, focusing on market and limit orders, as well as the mechanics of order-driven markets. It defines important terms such as best bid, best offer, and bid/ask spread, and explains how market orders execute at the best available price while limit orders set conditions for execution. Additionally, it outlines the rule-based order-matching systems that prioritize orders based on price and time to facilitate trades.

Uploaded by

Burhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Microstructure: Orders

& Execution

UChicago Algorithmic Trading


The Bid & Ask
Some Important Terms

> Best bid: the ?(highest/lowest)? bid price in a market.

2
The Bid & Ask
Some Important Terms

> Best bid: the highest bid price in a market.


– Best offer: the lowest offer price(or, equivalently, the best ask).

3
The Bid & Ask
Some Important Terms

> Best bid: the highest bid price in a market.


– Best offer: the lowest offer price(or, equivalently, the best ask).

> BBO: The Best Bid and Best Offer in a market. Also called the market quotation.

> Bid/ask spread: the difference between the best ask and the best bid.
– Traders sometimes call it the inside spread because the space between the highest bid price and the lowest ask
price is inside the market.

4
Market Orders

Algorithmic Trading
Market Orders
A market order is an instruction to trade at the best price currently available in the market. Market order
traders pay the bid/ask spread.

> Suppose that at 9:00am the only


information available to us about the value
of the bond is that a trader is willing to buy
it for 72 and another trader (perhaps the
same trader) is willing to sell it at 73.

> With no further information, our best


estimate of value is

6
Market Orders
A market order is an instruction to trade at the best price currently available in the market. Market order
traders pay the bid/ask spread.

> Suppose that at 9:00am the only


information available to us about the value
of the bond is that a trader is willing to buy
it for 72 and another trader (perhaps the
same trader) is willing to sell it at 73.

> With no further information, our best


estimate of value is the average of these
two prices, or 72.5.

> If we want to buy and the market quotation


is 72 at 73, we must pay:

7
Market Orders
A market order is an instruction to trade at the best price currently available in the market. Market order
traders pay the bid/ask spread.

> Suppose that at 9:00am the only


information available to us about the value
of the bond is that a trader is willing to buy
it for 72 and another trader (perhaps the
same trader) is willing to sell it at 73.

> With no further information, our best


estimate of value is the average of these
two prices, or 72.5.

> If we want to buy and the market quotation


is 72 at 73, we must pay: 73
> Using this estimate of value, we can see that
We paid 73 for a bond worth 72.5. The
difference of 0.5—which is half the
bid/ask spread—is what we paid for
liquidity.

8
Market Orders
A market order is an instruction to trade at the best price currently available in the market. Market order
traders pay the bid/ask spread.

> Suppose that at 9:00am the only


information available to us about the value
of the bond is that a trader is willing to buy
it for 72 and another trader (perhaps the
same trader) is willing to sell it at 73.

> With no further information, our best


estimate of value is the average of these
two prices, or 72.5.

> If we want to buy and the market quotation


is 72 at 73, we must pay: 73
> Using this estimate of value, we can see that
We paid 73 for a bond worth 72.5. The
difference of 0.5—which is half the
bid/ask spread—is what we paid for
liquidity.

> When we sell it later, we also paid half the spread for liquidity because we received only 75 for a 9
bond worth ____
Market Orders
A market order is an instruction to trade at the best price currently available in the market. Market order
traders pay the bid/ask spread.

> Suppose that at 9:00am the only


information available to us about the value
of the bond is that a trader is willing to buy
it for 72 and another trader (perhaps the
same trader) is willing to sell it at 73.

> With no further information, our best


estimate of value is the average of these
two prices, or 72.5.

> If we want to buy and the market quotation


is 72 at 73, we must pay: 73
> Using this estimate of value, we can see that
We paid 73 for a bond worth 72.5. The
difference of 0.5—which is half the
bid/ask spread—is what we paid for
liquidity.

> When we sell it later, we also paid half the spread for liquidity because we received only 75 for a 10
bond worth 75.5.
Limit Orders

Algorithmic Trading
Limit Orders
In contrast to Market Orders, limit orders have conditions that (usually) prevent their immediate execution.

Limit Price Placement


> A limit order is an instruction to trade at the best price available, if the price is better or equal
than the limit price specified by the trader.

12
Limit Orders
In contrast to Market Orders, limit orders have conditions that (usually) prevent their immediate execution.

Limit Price Placement


> A limit order is an instruction to trade at the best price available, if the price is better or equal
than the limit price specified by the trader.

> Example of placing


st
a limit order to buy: You email your friends (the market place) that you are
willing to buy a 1 edition Charizard only if the price is $10,000 or cheaper.

13
Limit Orders
In contrast to Market Orders, limit orders have conditions that (usually) prevent their immediate execution.

Limit Price Placement


> A limit order is an instruction to trade at the best price available, if the price is better or equal
than the limit price specified by the trader.

> Example of placing


st
a limit order to buy: You email your friends (the market place) that you are
willing to buy a 1 edition Charizard only if the price is $10,000 or cheaper.

> Thus for limit orders to buy, the execution price must be at or ?(above/below)? the limit price.

14
Limit Orders
In contrast to Market Orders, limit orders have conditions that (usually) prevent their immediate execution.

Limit Price Placement


> A limit order is an instruction to trade at the best price available, if the price is better or equal
than the limit price specified by the trader.

> Example of placing


st
a limit order to buy: You email your friends (the market place) that you are
willing to buy a 1 edition Charizard only if the price is $10,000 or cheaper.

> Thus for limit orders to buy, the execution price must be at or below the limit price.

15
Order-driven Markets

Algorithmic Trading
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to process price and quantity information from the orders that
traders submit, in order to arrange trades.

Order Precedence Rules

17
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to process price and quantity information from the orders that
traders submit, in order to arrange trades.

Order Precedence Rules


> Price priority(Primary order precedence rule):
– Buy orders that bid the highest prices and sell
orders that offer the lowest prices rank highest
on their respective sides.

18
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to process price and quantity information from the orders that
traders submit, in order to arrange trades.

Order Precedence Rules


> Price priority(Primary order precedence rule):
– Buy orders that bid the highest prices and sell
orders that offer the lowest prices rank highest
on their respective sides.
– Market orders always rank highest because the
prices at which they may trade are not limited.

> Time precedence:


– Gives orders precedence according to time of
submission.

Footnotes:
Pure price-time precedence systems: Systems that Display precedence: Gives displayed orders
rank orders based only on price priority and precedence over undisclosed orders at the
strict time precedence. same price.
19
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to arrange trades from the orders that traders submit to them. All orders specify the maximum
quantities that traders will accept. Rule-based order-matching systems process this price and quantity information to arrange their trades. Almost all rule-
based systems now use electronic trading systems to process their orders.

The Matching Procedure


> Order matching proceeds after the market ranks its orders.

> In a continuous market, it happens whenever a new order arrives.

20
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to arrange trades from the orders that traders submit to them. All orders specify the maximum
quantities that traders will accept. Rule-based order-matching systems process this price and quantity information to arrange their trades. Almost all rule-
based systems now use electronic trading systems to process their orders.

The Matching Procedure

> Step 1:
– The market matches the highest-ranking buy and sell orders to each other. If the buyer
will pay at least as much as the seller demands, the match will result in a ____

21
Rule-Based Order-Matching Systems
Rule-based order-matching systems use trading rules to arrange trades from the orders that traders submit to them. All orders specify the maximum
quantities that traders will accept. Rule-based order-matching systems process this price and quantity information to arrange their trades. Almost all rule-
based systems now use electronic trading systems to process their orders.

The Matching Procedure

> Step 1:
– The market matches the highest-ranking buy and sell orders to each other. If the buyer
will pay at least as much as the seller demands, the match will result in a trade. If
one order is smaller than the other, the smaller order will fill completely.
> Step 2:
– The market then will match the remainder of the larger order with the next highest-
ranking order on the opposite side of the market.
– The market then will match the next highest- ranking buy and sell orders.
> Step 3:
– This process continues until the market arranges all possible trades.
– Since the market processes orders ranked by decreasing price priority, the last match
that results in a trade often involves two orders that bid and offer the same price.
> Ending:
– The next match does not result in a trade because the buyer's bid price is below the
seller's offer price.
22
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time
market auction that calls at 10:30. The following orders are
submitted, before the auction happens:

Order Book

BUYERS SELLERS

ORDER
TRADER SIZE SIZE TRADER
PRICE

Bif 4 Market
buy

20.2 5 Stu

Bob 2 20.1 2 Sam

Bea 3 20.0

Ben 2 20.0

20.0 6 Sue

Bud 7 19.8 1 Sol


23
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time > Best Orders First: Who has the best sell price and who
market auction that calls at 10:30. The following orders are has the best buy price, and thusly are matched first in this
submitted, before the auction happens: case? (and in general, have the highest relative likelihood
of getting matched vs all other orders).

Order Book

BUYERS SELLERS

ORDER
TRADER SIZE SIZE TRADER
PRICE

Bif 4 Market
buy

20.2 5 Stu

Bob 2 20.1 2 Sam

Bea 3 20.0

Ben 2 20.0

20.0 6 Sue

Bud 7 19.8 1 Sol


24
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time > Best Orders First: The market first matches Sol's order
market auction that calls at 10:30. The following orders are to sell 1 at 19.8 with Bif's order to buy 4 at the market.
submitted, before the auction happens: This match fills Sol's order and leaves Bif with a
remainder of 3 to buy at the market. Sol can trade with
Bif because Bif's market order has no price restriction.
Order Book

BUYERS SELLERS

ORDER
TRADER SIZE SIZE TRADER
PRICE

Bif 4 Market
buy

20.2 5 Stu

Bob 2 20.1 2 Sam

Bea 3 20.0

Ben 2 20.0

20.0 6 Sue

Bud 7 19.8 1 Sol


25
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time > Best Orders First: The market first matches Sol's order
market auction that calls at 10:30. The following orders are to sell 1 at 19.8 with Bif's order to buy 4 at the market.
submitted, before the auction happens: This match fills Sol's order and leaves Bif with a
remainder of 3 to buy at the market. Sol can trade with
Bif because Bif's market order has no price restriction.
Order Book
> Which 2 participants match next?
BUYERS SELLERS

ORDER
TRADER SIZE SIZE TRADER
PRICE

Bif 4 Market
buy

20.2 5 Stu

Bob 2 20.1 2 Sam

Bea 3 20.0

Ben 2 20.0

20.0 6 Sue

Bud 7 19.8 1 Sol


26
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time > Best Orders First: The market first matches Sol's order
market auction that calls at 10:30. The following orders are to sell 1 at 19.8 with Bif's order to buy 4 at the market.
submitted, before the auction happens: This match fills Sol's order and leaves Bif with a
remainder of 3 to buy at the market. Sol can trade with
Bif because Bif's market order has no price restriction.
Order Book
> The market then matches Bif's remainder of 3 with Sue's
BUYERS SELLERS order to sell 6 at 20.0. Sue's order goes next because it has
the highest precedence on the sell side now that Sol's
order is filled. This match fills the remainder of Bif's order
ORDER and leaves Sue with a remainder of 3 to sell at 20.0. Bif
TRADER SIZE SIZE TRADER
PRICE
can trade with Sue because Bif's market order has no price
restrictions.
Bif 4 Market
buy

20.2 5 Stu

Bob 2 20.1 2 Sam

Bea 3 20.0

Ben 2 20.0

20.0 6 Sue

Bud 7 19.8 1 Sol


27
Example
Example Background Setting The Matching Procedure
> Suppose that the traders submit their orders to a fixed-time > Best Orders First: The market first matches Sol's order
market auction that calls at 10:30. The following orders are to sell 1 at 19.8 with Bif's order to buy 4 at the market.
submitted, before the auction happens: This match fills Sol's order and leaves Bif with a
remainder of 3 to buy at the market. Sol can trade with
Bif because Bif's market order has no price restriction.
Order Book
> The market then matches Bif's remainder of 3 with Sue's
BUYERS SELLERS order to sell 6 at 20.0. Sue's order goes next because it has
the highest precedence on the sell side now that Sol's
order is filled. This match fills the remainder of Bif's order
ORDER and leaves Sue with a remainder of 3 to sell at 20.0. Bif
TRADER SIZE SIZE TRADER
PRICE
can trade with Sue because Bif's market order has no price
restrictions.
Bif 4 Market
buy
> And so on …
20.2 5 Stu
– The market then matches Sue's remainder of 3 with Bob's order to buy 2 for 20.1. This
match fills Bob's order and leaves Sue with a remainder of 1 to sell at 20.0. Sue can
Bob 2 20.1 2 Sam trade with Bob because Bob is willing to pay more than Sue demands.

Bea 3 20.0 – The market then matches Sue's remainder of 1 with Bea's order to buy 3 for 20.0. This

match fills the remainder of Sue's order and leaves Bea with a remainder of 2 to buy for
Ben 2 20.0 20.0. Sue can trade with Bea because Sue is offering 20.0 and Bea is bidding

20.0. The only price at which they can trade is 20.0.

20.0 6 Sue
– The next match does not result in a trade. Bea's remainder of 2 to buy for 20.0 cannot
Bud 7 19.8 1 Sol trade with Sam's order to sell 2 at 20.1 because Bea will not pay as much as Sam

demands. No further trades are possible. Table 6-3 summarizes the trades.
28
Order Book After the Matching
Example Continued

> The order book with the remaining unfilled orders appears below.
> Note that the buy and sell orders no longer overlap.
> Continuous markets always have a spread between the best bid and the best offer. If they
did not, a _______ would result.

BUYERS SELLERS
TRADER SIZE ORDER PRICE SIZE TRADER
20.2 5 Stu
20.1 2 Sam
Bea 2 20.0
Ben 2 20.0
Bud 7 19.8

29
Order Book After the Matching
Example Continued

> The order book with the remaining unfilled orders appears below.
> Note that the buy and sell orders no longer overlap.
> Continuous markets always have a spread between the best bid and the best offer. If they
did not, a trade would result.

BUYERS SELLERS
TRADER SIZE ORDER PRICE SIZE TRADER
20.2 5 Stu
20.1 2 Sam
Bea 2 20.0
Ben 2 20.0
Bud 7 19.8

30
Order Book After the Matching
Example Continued

> The order book with the remaining unfilled orders appears below.
> Note that the buy and sell orders no longer overlap.
> Continuous markets always have a spread between the best bid and the best offer. If they
did not, a trade would result.
> If this market now started continuous trading, the market quoted BBO would be:

BUYERS SELLERS
TRADER SIZE ORDER PRICE SIZE TRADER
20.2 5 Stu
20.1 2 Sam
Bea 2 20.0
Ben 2 20.0
Bud 7 19.8

31
Order Book After the Matching
Example Continued

> The order book with the remaining unfilled orders appears below.
> Note that the buy and sell orders no longer overlap.
> Continuous markets always have a spread between the best bid and the best offer. If they
did not, a trade would result.
> If this market now started continuous trading, the market quoted BBO would be 4 bid
for 20.0, 2 offered at 20.1.

BUYERS SELLERS
TRADER SIZE ORDER PRICE SIZE TRADER
20.2 5 Stu
20.1 2 Sam
Bea 2 20.0
Ben 2 20.0
Bud 7 19.8

32
The Winner’s Curse of
Transaction Costs + How to
Optimize

Setting Up Interview Question


Trading => Information Leakage
The Price Impact of Informed Trading

> As mentioned in a previous talk, informed traders push market prices towards their
estimates of fundamental value. We examine this more in the following slides.

> First of all, intuitively why might trading leak information about security values?

> Intuitive analogy: In poker the bets you make reveal your hand strength. You opponents
(other traders) figure out that you think your hand-range (the security) is valuable if you make
large bets.

1. TE Chpt. 10.3-10.4 34
Costs of Information Leakage
Informed trades push market prices towards fundamental value.

> Thus the price impact of informed trading is a transaction cost which harms the
informed trader. On the bright side, impact benefits society at large through more accurate
valuation/allocation of resources.

> First of all, are these costs important? Perhaps they are a boring detail?

1. TE Chpt. 10.3-10.4 35
Costs of Information Leakage
Informed trades push market prices towards fundamental value.

> Thus the price impact of informed trading is a transaction cost which harms the
informed trader. On the bright side, impact benefits society at large through more accurate
valuation/allocation of resources.

> First of all, are these costs important? Perhaps they are a boring detail- WRONG:

“How often do you guys talk about market


impact and information leakage, it's like
the only thing we seem to talk about at
Citadel half the time”

-- Ken Griffin interview, January


2021
“Also i have 42b”

-- true but not actual


quote, 2025

1. TE Chpt. 10.3-10.4 36
A Simple Market: Betting on a Binary Event
Setting up the problem toOptimizing
optimize. b/w Profits and Transaction Costs

> Consider the following environment, betting on a binary event (bernoulli!):


– A futures contract pays $1 if event 𝑬 occurs (e.g. Trump elected), $0 otherwise.

1. TE Chpt. 10.6 37
A Simple Market: Betting on a Binary Event
Setting up the problem toOptimizing
optimize. b/w Profits and Transaction Costs

> Consider the following environment, betting on a binary event (bernoulli!):


– A futures contract pays $1 if event 𝑬 occurs (e.g. Trump elected), $0 otherwise.
– All other traders believe that the probability of 𝐸 occurring is 𝛼, i.e. p(𝐸) = 𝛼.

1. TE Chpt. 10.6 38
A Simple Market: Betting on a Binary Event
Setting up the problem toOptimizing
optimize. b/w Profits and Transaction Costs

> Consider the following environment, betting on a binary event (bernoulli!):


– A futures contract pays $1 if event 𝑬 occurs (e.g. Trump elected), $0 otherwise.
– All other traders believe that the probability of 𝐸 occurring is 𝛼, i.e. p(𝐸) = 𝛼.
– You’re the most informed trader and know that 𝐩 𝑬 = 𝝅 > 𝜶.

> Since you know the event is more likely to happen than other people expect, you are
going to buy Q quantity of these futures to profit from their ignorance.

> Warmup questions: Explain why you want to buy the future not short-sell. Explain why your expected
payoff (ignoring transaction costs) is 𝜋𝑄

1. TE Chpt. 10.6 39
Adding the Leakage (Transaction Cost)
Betting on a binary event E. All other traders believe p(E)=𝛼. You’re the most informed trader
and know that p(E)=𝜋>𝛼.
> Unfortunately nothing in life is free. Other traders suspect that you may be better
𝑸
informed. As such, the more you buy, the higher the price they charge: 𝑷 = 𝜶 + 𝑳
– P = Price
– Q = quantity of futures bought
– L = parameter that characterizes liquidity in the market – when L is large you can
buy a lot without significant price impact.

1. TE Chpt. 10.6 40
Adding the Leakage (Transaction Cost)
Betting on a binary event E. All other traders believe p(E)=𝛼. You’re the most informed trader
and know that p(E)=𝜋>𝛼.
> Unfortunately nothing in life is free. Other traders suspect that you may be better
𝑸
informed. As such, the more you buy, the higher the price they charge: 𝑷 = 𝜶 + 𝑳
– P = Price
– Q = quantity of futures bought
– L = parameter that characterizes liquidity in the market – when L is large you can
buy a lot without significant price impact.

> Question: If you don’t trade then 𝑄 = 0 and we have 𝑃 = 𝛼. Why does that make sense, i.e. why is
the default starting price point 𝛼?

1. TE Chpt. 10.6 41
Transaction Cost Functions
Betting on a binary event E. All other traders believe p(E)=𝛼. You’re the most informed trader
and know that p(E)=𝜋>𝛼.

𝑄
> Note: 𝑃 = 𝛼 + is an example transaction cost function (also called market impact
𝐿
function).

> Quants use this type of function 1000s of times per day.

> If you haven’t seen it before, welcome the bane and joy of all quant trading. It is about
to haunt you for the rest of your (trading) life.

42
Transaction Cost Functions
Betting on a binary event E. All other traders believe p(E)=𝛼. You’re the most informed trader
and know that p(E)=𝜋>𝛼.

𝑄
> Note: 𝑃 = 𝛼 + is an example transaction cost function (also called market impact
𝐿
function).

> Quants use this type of function 1000s of times per day.

> If you haven’t seen it before, welcome the bane and joy of all quant trading. It is about
to haunt you for the rest of your (trading) life.

Details:

Our specific form is called “Linear Price Impact” or somewhat


confusingly also “Quadratic Transaction costs” because your
𝑄 𝑄 𝑄
total cost in $ is Q 𝑃1 − 𝑃0 = 𝑄 𝛼 + − 𝛼 =𝑄 .
𝐿 𝐿 𝐿

It is not however “Linear Transaction costs” 𝑄𝑐 where your %


cost is constant regardless of doing bigger Q.

43
Interview Q

Sample Interview Question


Expected Profit Net of Transaction Costs
Betting on a binary event E. All other traders believe p(E)=𝛼. You’re the most informed trader
and know that p(E)=𝜋>𝛼.

𝑄
> Recall that 𝑃 = 𝛼 + 𝐿
– P = Price
– Q = quantity of futures bought
– L = parameter that characterizes liquidity in the market – when L is large you can buy a lot without significant price impact.

> We previously mentioned that your expected payoff (ignoring transaction costs) is πQ
> Question: Now that we include transaction costs, explain why your expected net profit is:

𝑄
𝜋𝑄 − 𝑃𝑄 = 𝜋𝑄 − 𝛼 + 𝑄
𝐿

1. TE Chpt. 10.6 45
Optimization: Finding the Highest Net Profit
You’re the most informed trader and know that p(E)=𝜋>𝛼 . Profit = 𝜋𝑄−(𝛼+𝑄/𝐿)𝑄, where
P = price, Q=quantity bought, L=liquidity.
𝑄
> As established, Expected Profit = 𝜋𝑄 − 𝑃𝑄 = 𝜋𝑄 − 𝛼 + 𝑄.
𝐿

> Interview q: How much Q should you buy to make the most money?

𝑄
> The interview q is thus: max 𝜋𝑄 − 𝛼 + 𝐿 𝑄 . Easy calculus!
𝑄

1. TE Chpt. 10.6 46
Optimization: Finding the Highest Net Profit
You’re the most informed trader and know that p(E)=𝜋>𝛼 . Profit = 𝜋𝑄−(𝛼+𝑄/𝐿)𝑄, where
P = price, Q=quantity bought, L=liquidity.
𝑄
> As established, Expected Profit = 𝜋𝑄 − 𝑃𝑄 = 𝜋𝑄 − 𝛼 + 𝑄.
𝐿

> Interview q: How much Q should you buy to make the most money?

𝑄
> The interview q is thus: max 𝜋𝑄 − 𝛼 + 𝐿 𝑄 . Easy calculus!
𝑄

2
> FOC: 𝑄 : 𝜋 − 𝛼 − 𝐿 𝑄 = 0

> Rearrange terms for Q gives the answer to the interview question:

𝐿
𝑄∗ = 𝜋−𝛼
2

1. TE Chpt. 10.6 47
Findings from our
Transaction Cost Derivation

Important conclusions
Examining the Solution: General Findings
𝐿
Profit = 𝜋𝑄−(𝛼+𝑄/𝐿)𝑄, where P = price, Q=quantity bought, L=liquidity. 𝑄 ∗ = 2 𝜋 − 𝛼

𝐿
> What is the Maximum Expected Profit? Easy: let us now plug in 𝑄∗ = 2 𝜋 − 𝛼 .

> Maximum Expected Profits:


∗ ∗
𝑄∗ ∗ 𝑳 𝟐
𝑬 𝐏𝐫𝐨𝐟𝐢𝐭 = 𝜋𝑄 − 𝛼 + 𝑄 = 𝝅−𝜶
𝐿 𝟒

1. TE Chpt. 10.6 49
Examining the Solution: General Findings
𝐿
Profit = 𝜋𝑄−(𝛼+𝑄/𝐿)𝑄, where P = price, Q=quantity bought, L=liquidity. 𝑄 ∗ = 2 𝜋 − 𝛼

𝐿
> What is the Maximum Expected Profit? Easy: let us now plug in 𝑄∗ = 2 𝜋 − 𝛼 .

> Maximum Expected Profits:


∗ ∗
𝑄∗ ∗ 𝑳 𝟐
𝑬 𝐏𝐫𝐨𝐟𝐢𝐭 = 𝜋𝑄 − 𝛼 + 𝑄 = 𝝅−𝜶
𝐿 𝟒
> Comparative Statics:

𝜕𝐸 Profit 1 2
= 𝜋−𝛼 >0
𝜕𝐿 4
𝜕𝐸 Profit ∗ 1
= 𝐿 𝜋−𝛼 >0
𝜕(𝜋 − 𝛼) 2

> Key takeaways are that you expect to make more money if (1) the market is liquid and/or
(2) if your information is better than everyone else’s.

– Thus, depending on the circumstances, high liquidity may be more profitable than good differentiated information.

– Finally: When values aren’t known, informed trading make prices more informative.
1. TE Chpt. 10.6 50
Comparison to “Fancier” Tcost Model
The Almgren-Chriss Transaction Cost function is the most famous model

A Trade Level Approach

> The study was investigated by Robert Almgren et al. (2005) and was specifically for U.S. equities.
> The coefficients, possibly the exponents and functional forms might be significantly different across
different markets as well as over time.
– Therefore, such models require careful calibration for each market before use.
𝑄 Θ
𝐼𝑝𝑒𝑟𝑚 = 𝛾𝜎 ( )1/4 +(𝑛𝑜𝑖𝑠𝑒)
𝑉 𝑉
3/5
𝑄
𝐼𝑟𝑒𝑎𝑙𝑖𝑧𝑒𝑑 = 𝜇𝐼𝑝𝑒𝑟𝑚 + 𝑠𝑖𝑔𝑛(𝑋)𝜂𝜎 + (𝑛𝑜𝑖𝑠𝑒)
𝑉𝑇
– σ is the asset specific volatility
– Q/T is the trading rate
– V is the average daily volume
– Θ is the shares outstanding
– γ, η are coefficient
– μ is the adjustment factor
𝑄
> Compare with: 𝑃 − 𝛼 = 4𝐿
51
Theory of Modeling

UChicago Algorithmic Trading Lecture


Defining a Time Series Abstractly

> How should we get started modeling, i.e. relating the real world to some more abstract math to
infer something new?

Chan Algorithmic Trading (2013)


53
Defining a Time Series Abstractly
How should we get started modeling, i.e. relating the real world to some more abstract math to infer something new?

> A stochastic process {𝑋𝑡 } is as a ordered collection of Random Variables, often with past
observations influencing future ones.

> Intuitive example: The temperature each day.

Chan Algorithmic Trading (2013)


54
Defining a Time Series Abstractly
How should we get started modeling, i.e. relating the real world to some more abstract math to infer something new?

> A stochastic process {𝑋𝑡 } is as a ordered collection of Random Variables, often with past
observations influencing future ones.

> Intuitive example: The temperature each day.

> When the ordering represents time, a stochastic process is also often called a (stochastic) time
series.
– (Or to split hairs, the realized series is sometimes called the time series) Chan Algorithmic Trading (2013)
55
Stationarity

Algorithmic Trading
What is a “nice” time series to work with?
You have probably seen the IID assumption in classical statistics. The (slightly weaker) equivalent is Stationarity

57
Chan Algorithmic Trading (2013)
Stationarity: Similar to IID
What is a “nice” time series to work with? You have probably seen the IID assumption in classical statistics. The (slightly weaker)
equivalent is Stationarity

Defining “nice” time series


A time series is stationary if its
(unconditional) probability
distribution is the same at every
point in time.

As the most obvious example, this


means the mean and variance are the
same as every point in time.

Question: which of the plots on the


right is stationary, and which is not?

58
Chan Algorithmic Trading (2013)
Stationarity: Similar to IID
What is a “nice” time series to work with? You have probably seen the IID assumption in classical statistics. The (slightly weaker)
equivalent is a Stationarity

Defining “nice” time series


A time series is stationary if its
(unconditional) probability
distribution is the same at every
point in time.

As the most obvious example, this


means the mean and variance are the
same as every point in time.

Question: which of the plots on the


right is stationary, and which is not?
Stationarity is the key assumption of
most historical data modeling, for
example assuming that a strategy that
works in the past will work in the future.

Note 1: The definition of stationarity holds for not only a single time series, but
more generally, a stochastic process ie a family of potentially multi-dimensional
random variables indexed by time.

IID is stronger than the stationarity, for example the stationary variables don’t’
59
have to be independent, but just have same mean/variance/etc.
Chan Algorithmic Trading (2013)
Sample Interview
Question

Algorithmic Trading
Deriving the Moments of an AR(1)
An easy interview question once you know what an AR(1) is. This is asked of undergrads by multiple hedge funds.

Interview Question

An Interview Primer for Quantitative Finance


61
Deriving the Moments of an AR(1)
An easy interview question once you know what an AR(1) is. This is asked of undergrads by multiple hedge funds.

Interview Question: (*assumes stationarity though interviewers often don’t say this*)

Key Trick, use


stationarity

An Interview Primer for Quantitative Finance


62
Deriving the Moments of an AR(1)
An easy interview question once you know what an AR(1) is. This is asked of undergrads by multiple hedge funds.

Interview Question: (*assumes stationarity though interviewers often don’t say this*)

Key Trick, use


stationarity

An Interview Primer for Quantitative Finance


63
State-Space Modeling

Algorithmic Trading
How to Model Everything: State Variables
You have data, you like math. What should you actually do to relate the 2?

How do we summarize the world?


> In dynamic systems, state variables fully explain/define the current state of the system.

> Intuitively, this means they describe enough about the system to determine all its
future behavior perfectly (or, as perfectly as possible, up to assumed independent
random shocks).

> Usually, state variables are specified with smallest dimension possible, both for clarity
and computational simplification.

– In mechanical systems, the position coordinates and velocity of mechanical parts are typical state variables.
Why? Because knowing these, it is possible to determine the future state of the objects in the system.

– Similarly, in ecosystem models, population sizes of plants/animals plus quantities of resources (nutrients,
organic material) are typical state variables.

Advanced Econometrics
65
How to Model Everything: State-Space Models
You have data, you like math. What should you actually do to relate the 2?

A state-space model is a pair of 2 interconnected time series models


(1) The dynamic model, also called the state equation, specifies the state variables
𝑋𝑡 and how they evolve through time (eg AR(1)!)

– Why do we have 2 time series instead of 1? We generalize to saying you cannot directly observe the true
state (is my dog truly happy inside) but instead just have observed data (did he jump up and down).

Advanced Econometrics
66
How to Model Everything: State-Space Models
You have data, you like math. What should you actually do to relate the 2?

A state-space model is a pair of 2 interconnected time series models


(1) The dynamic model, also called the state equation, specifies the state variables
𝑋𝑡 and how they evolve through time (eg AR(1)!)

– Why do we have 2 time series instead of 1? We generalize to saying you cannot directly observe the true
state (is my dog truly happy inside) but instead just have observed data (did he jump up and down).

(2) The measurement model, also called the observation equation, which describes how
the measurements/observations 𝒀𝒕 depend on the state variables.

Advanced Econometrics
67
Example State-Space Model: Equations
You have data, you like math. What should you actually do to relate the 2?

A state-space model is a pair of 2 interconnected time series models


The most common state-space model, called the Linear Gaussian State-Space Model (or
also, Dynamic Linear Model) has the following form:

> Why restrict to linear and gaussian? For the same reason that linear and gaussian is often
beloved in many problems: closed-form solutions! Aside: the most famous solution is the
Kalman Filter.

Advanced Econometrics
68
Example State-Space Model: NASA
This type of model was first used by NASA, to solve the problem of locating and navigating Apollo spaceships with extremely limited
observations.

You can see why it would be important to figure out where a ship actually is!

Example:

(1) The state that needed to be estimated


was the position of the ship in space.

(2) The observations were optical


measurements made and inputted
by the crew eg where the sun is
in their window!

Advanced Econometrics
69

You might also like