Opening and closing positions aggressively
In this section, we will build a liquidity taking algorithm, whose behavior we covered in the first section of this chapter. This trading strategy does not send passive orders as the MM algorithm does; instead, it sends aggressive orders that trade against liquidity resting in the book. The source code for the LiquidityTaker
algorithm is in the Chapter10/trading/strategy/liquidity_taker.h
and Chapter10/trading/strategy/liquidity_taker.cpp
source files. First, we will define the data members that make up the LiquidityTaker
class in the next subsection.
Defining the data members in the LiquidityTaker algorithm
The LiquidityTaker
trading strategy has the same data members as the MarketMaker
algorithm we built in the previous section. Before we describe the data members themselves, we will present the header files we need to include in the liquidity_taker.h
source file:
#pragma once #include "common/macros.h" #include "...