Buyer/seller prevalence

The metric is designed to estimate the market sentiment

The buyer/seller prevalence is a metric based on the side of trades during the selected period. The metric belongs to [2,2][-2, 2] interval. The more trades with ‘buy’ side available, the more positive the buyer/seller prevalence is.

The algorithm is as follows:

  1. get all trades for the selected period

  2. group trades by side (“buy” and “sell”)

  3. calculate the sum of trade amounts in base currency

  4. apply the following logic where buybuy and sellsell are the sum of buy and sell trade amounts

prevalence={0if sell=buy(buysell)/buybuy>sell and buy2sell2buy/(buysell)buy>2sell(sellbuy)/sellsell>buy and sell2buy2+sell/(sellbuy)sell>2buyprevalence = \left\{ \begin{array}{ll} 0 & \textrm{if $sell=buy$}\\ (buy-sell)/buy & \textrm{$buy>sell$ and $buy \leq 2 \cdot sell$}\\ 2-buy/(buy-sell) & \textrm{$buy > 2 \cdot sell$}\\ -(sell-buy)/sell & \textrm{$sell>buy$ and $sell \leq 2 \cdot buy$}\\ -2+sell/(sell-buy) & \textrm{$sell > 2 \cdot buy$}\\ \end{array} \right.

Here you can find the chart of how the applied function looks like.