Advanced CVD

From Bookmap
Revision as of 16:16, 20 March 2019 by Serg (talk | contribs) (Download and install)
Jump to: navigation, search

The advanced (or generalized) cumulative volume delta (CVD) indicator of Bookmap allows to track transactions and even performance from the perspective of various types of orders. This includes, passive and aggressive orders, Iceberg orders, Stop orders, orders of particular size or range of sizes, Stop orders that execute against Iceberg orders, passive Limit orders that become aggressive due to replacement, and even orders that imitate the behavior of native iceberg orders. The indicator allows to configure a set of filters that determines transactions of which of the above orders to be accounted in CVD computation.

What is a standard CVD indicator

CVD Example.png

It consists of 4 components:

  1. Cumulative (running) total traded volume of all transactions. This is also a sum of #2 and #3
  2. Cumulative volume initiated by aggressive Buy orders (trades that occur at best Ask price)
  3. Cumulative volume initiated by aggressive Sell orders (trades that occur at best Bid price)
  4. Cumulative volume delta (CVD), which is the difference between #2 and #3

Typically, only the CVD is actually displayed on the chart. It indicates the difference between Buying and Selling pressure. This information is valuable because it shows the sentiment of other market participants and indicates what is their prediction about the price. This is because traders send an aggressive order when it seems for them their last chance (at least in their time frame) to Buy or Sell at currently available price. And if the excess of Buying or Selling pressure is not compensated by corresponding excess of incoming passive limit orders, it moves the price in the direction of the pressure. The standard (or regular CVD) can be achieved using the following settings:

Standard CVD.png


The regular CVD becomes possible because each transaction always happens between a Buy order and a Sell order. And because in each transaction one of the orders must be passive (resting in the order book), and another an incoming aggressive order. The Buy and Sell volume in regular CVD is calculated from the perspective of aggressive orders, but this is only a choice.

Because each transaction occurs between passive/resting  and aggressive orders, we could equally calculate the Buy and Sell volume from the perspective of passive orders even without an access to BBO or market depth data. Similarly, we could calculate it only based on transactions of passive orders without an access to the Time & Sales data. If both aggressive and passive are taken into account, the Buy and Sell volumes would grow, but CVD would be precisely zero and any moment in time.

Classification of orders


The regular CVD is calculated from the perspective of aggressive orders and uses a single classification of orders: aggressive vs passive. Let's extend the list of available classifications as following:

  • Passive orders
  • Aggressive orders
  • Large and Small orders (in general, orders with certain size or range of sizes)

Now we can choose from the perspective of which orders the CVD should be calculated and add transactions of orders that match desired classification to Buy and Sell volume accordingly.


This set of filters allows to select desired classification of orders for which we wish to produce the CVD including, for instance, the ability to track only executions of Stop orders against Iceberg orders. For further fine tuning it allows to ignore order size filters for Stop and Iceberg orders, which is especially useful for Iceberg order which hidden size we can't know until it's fully executed.

Similarly to the regular CVD, it allows to examine market activity and the excess of pressure of Buyers and Sellers, but with higher granularity of classifications of orders.



This set of filters allows to mirror any set of settings in order to view the transactions from the perspective of one side of a trade (e.g. aggressive) or another (e.g. passive). The result of mirroring is:

  • No change in total volume
  • Buy volume becomes Sell volume and vice versa
  • CVD is flipped vertically

The image on the right side shows an example of two complementary / mirroring combinations of settings. Both are configured to track transactions of Stop orders only. But one of them gives the view from the opposite side of executed Stop orders.

Filtering by Order size

In a transaction between two orders at least one of them, the smaller one, gets fully executed. A large order can be executed against many smaller orders.

The indicator accounts only the executed volume. But order size filters are applied on actual order size of orders participating in the transaction, not on the size of transactions.

Order size of aggressive orders

The order size of a Market order is the sum of all of its transactions against other orders, which occur instantaneously when market order arrives to the exchange. But not all aggressive orders are Market orders. It can be a partially executed aggressive Limit order which stopped execution when reached its limit price and created a new best price. Moreover, it can be passive Limit order which was previously partially executed and then modified to becomes an aggressive order followed by its full or partial execution. The order size filter is applied on the maximum order size the order had during its lifetime.

Order size of passive orders

Similarly, the order size filter is applied on the maximum order size the order had during its lifetime. The estimated order size of an iceberg order is the sum of its transactions plus the remaining displayed size.

Large traders who have an infrastructure in exchange co-location, have a number of good reasons not to use native iceberg order offered by exchanges, but rather implement iceberg functionality themselves. The indicator identifies such custom iceberg orders and treats them in the same manner as it treats the native iceberg orders.

Relation of CVD to Position and to Profit and Loss

As shown above, CVD indicator in general (including the regular one) consists of two independent components: Buy and Sell volume, and two dependent components: Total volume (sum of the two), and CVD (difference of the two). It's easy to notice that these independent components are computed based on transactions (executed trades). This allows to think of CVD as a position of accounted transactions and even of their P&L.


A transaction is a set of parameters:

  • Buy or Sell
  • Transaction size
  • Transaction price
Transactions received from market data have the same structure as your own transactions. Therefore you can calculate someone else's Position and P&L based on market data in the same way that you calculate your own Position and P&L based on your own transactions.

These someone else's transactions are defined by the set of filters which tell the indicator transactions of which orders to take into account. In a regular CVD the only filter is that it accounts only the aggressive orders. This indicator offers more advanced filters, including the ability to account transactions of passive orders.

Relation to Position


Suppose a trader configures the CVD as shown on the image to account only Limit and Market orders of size 75, and suppose that no one else except this trader is using such orders during a trading day. In this case it's obvious that CVD will show exactly the same value as the position, displayed on the account balance of this trader. Similarly, the CVD in general can be treated as the position accumulated by orders that match the desired filters. In other words, CVD gives an insight about the position over time of selected classification of orders.

Because we switch on the indicator at some arbitrary moment, we don't know the initial position of tracked orders. But we can observe their trend, whether they are buying or selling or neutral.

Relation to Profit and Loss

Since each transaction is characterized not only by size and side, but also by transaction price, the trader from the previous example could also calculate his P&L based on market data only without looking at his account balance (assuming that no one else trades with such orders). Similarly, the P&L calculated based on transactions of orders that match the filters represents the P&L of those orders.

However, such P&L can be misleading in both directions because it assumes that initial position of tracked orders is zero, which is highly unlikely if we enable the indicator at an arbitrary moment. Here is an example: a trader was buying during a trend down and then selling the same amount during a trend up until the price returned to the same level. Depending on entry points, the resulting P&L can be very nice and positive. But if we reset the CVD (i.e. position) during the price reversal at the bottom, the resulting P&L during each interval and thus together will be negative.

Zero sum game

If we remove all filters and calculate CVD from the perspective of all orders, each transaction will be accounted from the perspective of both Buy and Sell orders, so the Buy volume becomes equal to the Sell volume. Therefore the resulting position (CVD) and P&L are precisely zero at any moment in time as shown on this image.


Tracking large orders

If we use the previous settings that demonstrated zero-sum game but apply a filter on the order size (e.g. 50 contracts as shown on the next image), it's not a zero-sum game anymore because some transactions occur between large orders that pass the filter and smaller orders that don't. The resulting CVD and P&L represent position and performance of all orders of size 50+ regardless of their other characteristics. In this example we also selected to ignore order size filter for iceberg orders.


Examples and special use cases


Download and install

The indicator is free for Bookmap users at least until 01-Apr-2019. Direct download link: Install via Settings->Api plugins configuration. Additional installation instructions are on the forum.