# High Frequency Market Taking

The high frequency trading (HFT) industry has generally settled on three main types of trading strategies that are sustainable because they provide real economic values to the market:

Sell 10 for \$99.25

Sell 5 for \$99.00 (best offer)

Buy 10 for \$98.75 (best bid)

Then at moment T a sell trade for a quantity of 9 comes in and turns our order book into this:

Sell 10 for \$99.25

Sell 5 for \$99.00 (best offer)

Buy 1 for \$98.75 (best bid)

The goal of our toy model is to calculate a “true” price at moment T and compare against the best bid/offer at moment T to see whether it is underpriced or overpriced. The argument is quite simple. Assume that another sell trade for a quantity of 9 will immediately come in (even though it hasn’t yet), the “true” order book should look like this:

Sell 10 for \$99.25

Sell 5 for \$99.00 (best offer)

Buy 2 for \$98.50 (best bid)

The “true” weighted mid price (if you aren’t familiar with it, it is here) can be calculated as (99.00*2+98.50*5)/(2+5)=\$98.64286. Notice that the observed best bid at this moment is:

Buy 1 for \$98.75 (best bid)

Our theoretical “true” price is now below the observed best bid on the market. This means that in this toy model the instrument at time T is considered to be overpriced, therefore we will issue an order to sell the last remaining quantity of 1 at \$98.75 for a theoretical profit of 98.75–98.64286=\$0.10714!

Though the above analysis only constitutes a toy model, the general workflow for a real model will be more or less similar and boil down to determining whether an instrument is underpriced or overpriced enough. Once you have the model defined, it is fairly straightforward to code the market data streaming part and the order execution part using our lighting-fast C++ library: https://github.com/crypto-chassis/ccapi. For big fans of Python, the same library also provides a binding for it: https://github.com/crypto-chassis/ccapi/tree/v5.19.1#python. In addition, you can find a good amount of order book and trade data from our data archive for backtesting purposes: https://github.com/crypto-chassis/cryptochassis-data-api-docs. With all these tools in hand, we hope that creating and backtesting a high frequency market taking strategy is no longer a daunting task for you and we wish you best luck!

If you are interested in our work or collaborating with us, join us on Discord: https://discord.gg/b5EKcp9s8T 🎉 We specialize in market data collection, high speed trading system, infrastructure optimization, and proprietary market making. You’re welcome to hire us as engineers, liquidity providers, traders, or asset managers.

Disclaimer: This is an educational article rather than investment/financial advice.

--

--

## More from Open Crypto Trading Initiative

An ongoing effort to embrace and promote open solutions for the crypto financial services industry