Managing the passive liquidity provided in the order book
At this point, we have all the sub-components we need to start building our trading strategies. The first strategy we will build will be the MM algorithm, which sends orders that are expected to rest passively in the order book. We discussed the details of this trading algorithm earlier in this chapter, so in this section, we will focus on the C++ implementation. All the source code for this MarketMaker
trading algorithm can be found in the Chapter10/trading/strategy/market_maker.h
and Chapter10/trading/strategy/market_maker.cpp
source files.
Defining the data members in the MarketMaker algorithm
First, we need to define the data members that make up the MarketMaker
class. The key members are the following:
- A pointer to a constant
FeatureEngine
object calledfeature_engine_
, which we will use to fetch the fair market price, using theFeatureEngine::getMktPrice()
method we saw earlier - A pointer to an
OrderManager...