Back to the quant topics:

Microstructural fair value!

Let's dive into it:

1/n
The usual approach is to take the midprice which is just the average between the best bid and ask. This is decent for most applications, but can definitely be improved. Decent won't cut it in HFT! ...
2/n
Let's outline a few approaches:

OB Liquidity Based:

Weighted Midprice
Exponentially Weighted Midprice
TA (MA) based variants

Microprice & Variants:

HMM Microprice (stoikov)
ARIMA Microprice
SAE Microprice
3/n

Starting with the most basic, OB liquidity based, this is effectively taking into account the liquidity that exists in the book when generating fair value. This still relies on an efficient market assumption when pricing fair value and only incorporates information...

4/n
from our current timestamp. Simply weighting the midprice by the liquidity on each side of the order book is the idea. The question is how many levels. This is where you can decide. Large parts of the orderbook remain dormant and are only there to catch flash crash...

5/n
type scenarios. Look at many assets and you will so +80% LOs, these really shouldn't be incorporated so use volume to size this part when naively weighting them. The next approach plays on this and uses exponential weighting so that these dormant levels of the OB...

6/n
are discounted to something effectively gone. From there those familiar with using moving averages as indicators may notice that this is similar to the WMA and EWMA. There are plenty of MAs TRIMA, KAMA, MAMA, KMA, etc and evene Kalman variants can be used to weight the...

7/n
levels of the order book. There is no literature on this as far as I am aware, but I can verify that it works from personal toying around.

Now let's move on to the use of microprice approaches. This removes the efficient market assumption and says that potentially...

8/n
the price we see is not accurate, the idea that previous price information should be incorporated into fair value. Towards the end of my explanation of weighted approaches, I mentioned Kalman. When we incorporate past values we can generalize that the liquidity should...

9/n
play far less of a role in our prediction if we have past prices since we assume that liquidity will in turn drive changes in the order book and should appear in the price patterns. Thus we can use prediction-based models such as HMM uses hidden states like Kalman, but...

10/n
is more suited to the problem. We now must specify the number of ticks ahead. Usually, this is one or two, but we can draw from the approaches of exponential weighting to discount future tick predictions. Sasha Stoikov has a GitHub with code for those who would...

11/n
like to play around with this a bit more, and there are papers out there. Moving forward we may want a little less complex model since we are trying to regularize so ARIMA will bring trends into the OB. Finally, supervised autoencoding with MLP or LSTM models to...

12/n
supervise the AE are a practical choice for those with large data quantities. These are all important for market makers who need to make sure they receive a fair price for their liquidity. Thus I will show an approach that is better for those like...

13/n
Hummingbot who genuinely want to provide liquidity, but obviously don't want adverse fills. This would involve a centralized approach but instead of predicting each OB level or using complex RL models to not just prevent adverse fills, but attempt to create positive...

14/n
expectancy in their inventory. With this we use a volatility dependent offset from the fair value estimation. We prevent adverse fills simply by having our fair value accurately reflect a prediction of future price. This method is MUCH faster to compute than...

15/n
each level and will enable much lower latency, plus an easier project as a whole.

Disclosure:

I have tested this and it works pretty well, but don't use it since I am a taker just trying to get cheap fills with LOs not a maker.

16/16
But I do use the fair value approaches for training models, just not the centralized fair value prediction + offset approach.
You can follow @quant_arb.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: