I was looking at some papers on market making strategies on equities and was surprised by "advanced mathematics" used in them.Every paper started with formulation of problem as hamilton jacobi bellman equations with assumptions and proceeded to derive optimal quotes from there.
My intuition was that market making would deal with more order book phenomenon and adjusting bid ask prices accordingly.
It would take much time to have a reasonable understanding of equations so i was wondering if it is worth going down this rabbithole.
Market making models
-
prikolno
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
Variational PDEs are in use at mid-freq shops with theoretical physics lineage and for optimal execution. Never seen it in the wild for market making at the >2% ADV frequency.
Haven't yet found a favorite for optimal control but Lanczos, Gelfand and Evans are some of the best written texts of all time though.
Haven't yet found a favorite for optimal control but Lanczos, Gelfand and Evans are some of the best written texts of all time though.
- nikol
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
Dont be scared of HJB . It's worth to crack its meaning.
Dynamic programming and control theory by Bellman and Kalaba helped me to get the idea.
Here is previous discussion on MMs.
https://nuclearphynance.com/Show%20Post.aspx?PostIDKey=193335
Dynamic programming and control theory by Bellman and Kalaba helped me to get the idea.
Here is previous discussion on MMs.
https://nuclearphynance.com/Show%20Post.aspx?PostIDKey=193335
- EspressoLover
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
I could be wrong, I often am. But I'd say that HJB and the like have essentially no use for practitioners of HFT-style market making. I'd freely admit that I'm taking a provincial view here, if not for the the fact that the original A&S paper was titled High-frequency trading in a limit order book. (With most subsequent papers using similar terminology.)
As far as I can tell, A&S don't seem to have talked to any actual high-frequency traders. Or for that matter anybody who even regularly uses a limit order book. The word "data" only appears once (in case you're wondering it's available, but the authors definitely won't be using it). Anytime I see these type of quant finance papers- you know the kind with pages of differential equations but zero actual datasets- my eyes glaze over.
It makes me feel like I'm reading an anthropology paper on "Childrearing Habits in Papua New Guinea". Except the author's never left Cleveland, is only vaguely familiar with New Guinea, and barely spends any time even with his own kids. The armchair anthropologist reaches speculative conclusions by long chains of logic derived from arbitrary first principles. Maybe he does winds up getting things right. And if so it'd be super-impressive. Still, if I was trying to crack the emerging Papuan toy market, I wouldn't take his advice without booking a flight to Port Moresby.
Complex PDE models like HJB usually wind up baking in a whole bunch of unvalidated assumptions. Which basically forces the data to fit the pre-determined model. In practice, it's almost always better to let the empirical evidence drive the model rather than vice versa. The upshot tends to be "flat" models with more degrees of freedom, that allow for parameterizing over a less constrained universe of behavior. Among the ways that HJB misses the mark here for real practitioners (IMO):
Over-focus on volatility and risk: The vast majority of major market makers, don't care about optimizing for portfolio volatility. Virtu had one losing day in like a decade of trading. If your Sharpe ratio's 30, you don't care about boosting it to 40.
Ignoring adverse selection: Unlike risk, this *is* the binding constraint that limits market maker sizing. Market makers don't stop quoting larger because they're afraid of portfolio risk, they do so because the expected PnL on the marginal liquidity becomes negative. It's the first, not the second, moment. Isn't this just effectively the same way that HJB penalizes inventory? No. Inventory that you've been sitting on has way less toxicity than a quote that just got lifted. Liquidity sourced from retail brokerages has less adversity than lit exchange flow. Order flow at market open is more toxic than flow at the close. From a vol perspective, inventory-reducing trades are always good. From an adversity perspective, they can still be very toxic.
Ignoring queue position: HJB assumes that there's no competition. If I had no competition, my biggest concern would be what color to paint the helipad on my yacht. In practice market making is viciously competitive. Both in terms of price and queue position. The former can fit into the HJB worldview. The latter most definitely does not. Every market maker in the world would tell you the necessity of quoting at a position that is instantaneously unprofitable to build queue position. If you listen to HJB, no one would ever try to seize first queue position on new level formation. Yet that's consistently the most profitable trade in the market making universe.
Impractical in low-latency environments: HJB requires numerically solving a complex PDE. I left this point last, because I suppose you could approximate or pre-compute in a way to get response time under 10 microseconds. I wouldn't want to be the guy responsible for it though.
Papers like Avellaneda and Stoikov certainly are impressive intellectual achievements. I certainly always feel smart when I finally work my way through the pages of stochastic calculus. And then after that feeling wears off, I realize there's nothing useful here. @prikolno is smarter and definitely better informed than me. So, I'd trust him when he says it has practical applications for some players. But I don't see it for anyone in my corner of the world.
On a tangent, one piece that I would recommend for background reading that does a pretty good job of tying together academic theory with real-world is
this presentation. The author uses a fair bit of stochastic calculus, but he always keeps it grounded in the empirical data before straying too far into the clouds. I won't endorse every statement in there, but I think if more academics in quant finance would do well to follow his example.
As far as I can tell, A&S don't seem to have talked to any actual high-frequency traders. Or for that matter anybody who even regularly uses a limit order book. The word "data" only appears once (in case you're wondering it's available, but the authors definitely won't be using it). Anytime I see these type of quant finance papers- you know the kind with pages of differential equations but zero actual datasets- my eyes glaze over.
It makes me feel like I'm reading an anthropology paper on "Childrearing Habits in Papua New Guinea". Except the author's never left Cleveland, is only vaguely familiar with New Guinea, and barely spends any time even with his own kids. The armchair anthropologist reaches speculative conclusions by long chains of logic derived from arbitrary first principles. Maybe he does winds up getting things right. And if so it'd be super-impressive. Still, if I was trying to crack the emerging Papuan toy market, I wouldn't take his advice without booking a flight to Port Moresby.
Complex PDE models like HJB usually wind up baking in a whole bunch of unvalidated assumptions. Which basically forces the data to fit the pre-determined model. In practice, it's almost always better to let the empirical evidence drive the model rather than vice versa. The upshot tends to be "flat" models with more degrees of freedom, that allow for parameterizing over a less constrained universe of behavior. Among the ways that HJB misses the mark here for real practitioners (IMO):
Over-focus on volatility and risk: The vast majority of major market makers, don't care about optimizing for portfolio volatility. Virtu had one losing day in like a decade of trading. If your Sharpe ratio's 30, you don't care about boosting it to 40.
Ignoring adverse selection: Unlike risk, this *is* the binding constraint that limits market maker sizing. Market makers don't stop quoting larger because they're afraid of portfolio risk, they do so because the expected PnL on the marginal liquidity becomes negative. It's the first, not the second, moment. Isn't this just effectively the same way that HJB penalizes inventory? No. Inventory that you've been sitting on has way less toxicity than a quote that just got lifted. Liquidity sourced from retail brokerages has less adversity than lit exchange flow. Order flow at market open is more toxic than flow at the close. From a vol perspective, inventory-reducing trades are always good. From an adversity perspective, they can still be very toxic.
Ignoring queue position: HJB assumes that there's no competition. If I had no competition, my biggest concern would be what color to paint the helipad on my yacht. In practice market making is viciously competitive. Both in terms of price and queue position. The former can fit into the HJB worldview. The latter most definitely does not. Every market maker in the world would tell you the necessity of quoting at a position that is instantaneously unprofitable to build queue position. If you listen to HJB, no one would ever try to seize first queue position on new level formation. Yet that's consistently the most profitable trade in the market making universe.
Impractical in low-latency environments: HJB requires numerically solving a complex PDE. I left this point last, because I suppose you could approximate or pre-compute in a way to get response time under 10 microseconds. I wouldn't want to be the guy responsible for it though.
Papers like Avellaneda and Stoikov certainly are impressive intellectual achievements. I certainly always feel smart when I finally work my way through the pages of stochastic calculus. And then after that feeling wears off, I realize there's nothing useful here. @prikolno is smarter and definitely better informed than me. So, I'd trust him when he says it has practical applications for some players. But I don't see it for anyone in my corner of the world.
On a tangent, one piece that I would recommend for background reading that does a pretty good job of tying together academic theory with real-world is
this presentation. The author uses a fair bit of stochastic calculus, but he always keeps it grounded in the empirical data before straying too far into the clouds. I won't endorse every statement in there, but I think if more academics in quant finance would do well to follow his example.
Good questions outrank easy answers. -Paul Samuelson
- Strange
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
@EspressoLover is there any good introductory reading about modern market making?
--That word, you keep using that word! I don't think it means what you think it means
-
gaj
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
HJB is quite easy to understand if you discretize the problem (and you’ll have to discretize the PDE to solve it anyway). Before reading the papers, I came up with the same equations by playing with a discrete model, and a bright high schooler should be able to understand my derivation. The math for the continuous version looks intimidating, but it’s really unnecessary for practical trading purposes.
Like EL said, I never ended up using it in production. The purpose of a market making model is to tell you where to place your orders: how wide is your spread, do you skew up/down, and what size. HJB gives you these, but you have to provide the input parameters, which are unintuitive and the model’s assumptions are not necessarily realistic. I find it much more straightforward to just set the market making parameters to be some intuitive functions of inventory, volatility, time of day, etc.
Like EL said, I never ended up using it in production. The purpose of a market making model is to tell you where to place your orders: how wide is your spread, do you skew up/down, and what size. HJB gives you these, but you have to provide the input parameters, which are unintuitive and the model’s assumptions are not necessarily realistic. I find it much more straightforward to just set the market making parameters to be some intuitive functions of inventory, volatility, time of day, etc.
-
prikolno
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
>Impractical in low-latency environments
If you have enough alpha on the entries, you can actually bifurcate it from everything else so this doesn't pose a limitation. Then your entry model and its execution is invariant to inventory, past a certain (e.g. time) threshold the positions go into a bin that the model is not responsible for. This reduces the remainder into a classical portfolio liquidation problem. There's various informal terms to refer to this, including "exhaust", "take-make" (it's more viable if you strictly aggress to increase inventory) or a colorful French term with the initials v and c.
There's a certain appeal to this, including that "everything else" isn't as latency-sensitive and is heavily studied, and you can now quantify whether to roll your own or outsource it, including to HJB-based solutions like OptimIS and its relatives. It's also more plausible in a pro rata market where broker execution often has size advantage for the "make" leg. This would still be a "HFT" MM strategy in loose sense of the term.
But I started this post with a big "if" and was explicit when I mentioned the 2% mark. I don't know anyone that does it this way these days because there's not a lot of alpha to go around. YMMV.
It's befitting that your analogy about academic models ends with a reminder of said firm's S-1 original filing. I remember when the news broke about the 1 losing day, several academics and journalists put together some convoluted models and armchair theories to estimate the SR because it seemed almost unimaginable to them at the time. What is whimsical is that they were still underestimating the SR in those models because they didn't realize what's obvious to a practitioner, which is that they would've had zero losing days if there wasn't such a thing as a partial trading day.
If you have enough alpha on the entries, you can actually bifurcate it from everything else so this doesn't pose a limitation. Then your entry model and its execution is invariant to inventory, past a certain (e.g. time) threshold the positions go into a bin that the model is not responsible for. This reduces the remainder into a classical portfolio liquidation problem. There's various informal terms to refer to this, including "exhaust", "take-make" (it's more viable if you strictly aggress to increase inventory) or a colorful French term with the initials v and c.
There's a certain appeal to this, including that "everything else" isn't as latency-sensitive and is heavily studied, and you can now quantify whether to roll your own or outsource it, including to HJB-based solutions like OptimIS and its relatives. It's also more plausible in a pro rata market where broker execution often has size advantage for the "make" leg. This would still be a "HFT" MM strategy in loose sense of the term.
But I started this post with a big "if" and was explicit when I mentioned the 2% mark. I don't know anyone that does it this way these days because there's not a lot of alpha to go around. YMMV.
It's befitting that your analogy about academic models ends with a reminder of said firm's S-1 original filing. I remember when the news broke about the 1 losing day, several academics and journalists put together some convoluted models and armchair theories to estimate the SR because it seemed almost unimaginable to them at the time. What is whimsical is that they were still underestimating the SR in those models because they didn't realize what's obvious to a practitioner, which is that they would've had zero losing days if there wasn't such a thing as a partial trading day.
- EspressoLover
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
@prikolno
Thanks for the elucidation! I always learn something from your posts. I've never heard of the "exhaust" paradigm before, but can definitely see how it'd add value for certain categories of strategies.
@strange
At nearly 20 years old, it's starting to get a little long in the tooth. But I'd still recommend Larry Harris' Trading and Exchanges. To drop the link again, this presentation covers things from basics to fairly advanced concepts pretty well. Most of the papers by Kirilenko or Brogaard are pretty good, especially because they have access to de-anonymized datasets. Hasbrouk's a good author too.
Thanks for the elucidation! I always learn something from your posts. I've never heard of the "exhaust" paradigm before, but can definitely see how it'd add value for certain categories of strategies.
@strange
At nearly 20 years old, it's starting to get a little long in the tooth. But I'd still recommend Larry Harris' Trading and Exchanges. To drop the link again, this presentation covers things from basics to fairly advanced concepts pretty well. Most of the papers by Kirilenko or Brogaard are pretty good, especially because they have access to de-anonymized datasets. Hasbrouk's a good author too.
Good questions outrank easy answers. -Paul Samuelson
-
doomanx
- Posts: 0
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
Using PDE solvers in HFT is something done in the options space quite often. The idea is you have some other threads populating the cache with solutions in a grid around the current parameters. Matt Hurd talks about this a bit in his legendary post I recommend everyone read https://meanderful.blogspot.com/2018/01/the-accidental-hft-firm.html
Here's a good tutorial from a practitioner (KCG) https://ieor.columbia.edu/files/seasdepts/industrial-engineering-operations-research/pdf-files/Borden_D_FESeminar_Sp10.pdf. I think the HJB approach is better suited for building a simulation environment for backtesting. Under your model it tells you the 'optimal' execution fraction to target, which you can compare to your realised results. Can also use it to generate reward/cost signals for a reinforcement learning system.
Here's a good tutorial from a practitioner (KCG) https://ieor.columbia.edu/files/seasdepts/industrial-engineering-operations-research/pdf-files/Borden_D_FESeminar_Sp10.pdf. I think the HJB approach is better suited for building a simulation environment for backtesting. Under your model it tells you the 'optimal' execution fraction to target, which you can compare to your realised results. Can also use it to generate reward/cost signals for a reinforcement learning system.
did you use VWAP or triple-reinforced GAN execution?
-
ahgt_123
- Posts: 1
- Joined: Thu Jan 01, 2004 12:00 am
Market making models
@doomanx I have read about reinforcement learning for market making, sounded interesting and relatively easy.Can you suggest few good papers on the topic.