Building the feature and computing complex features
In this section, we will build a minimal version of a feature engine. We will only compute two simple features – one (market price) that computes fair market prices based on the top of book prices and quantity and another (aggressive trade qty ratio) that computes how big a trade is compared to the top of book quantities. We will use these feature values to drive our market-making and liquidity-taking trading algorithms later in this chapter. The source code for the FeatureEngine
class we will build here can be found in the Chapter9/trading/strategy/feature_engine.h
file on GitHub. We discussed the details of this component in Chapter, Designing Our Trading Ecosystem, in the Designing a framework for low-latency C++ trading algorithms section.
Defining the data members in the feature engine
First, we need to declare the FeatureEngine
class and define the data members inside this class. First, we will include the required...