meaning of depth balance

116 views
Skip to first unread message

Jian

unread,
Nov 6, 2010, 5:46:35 PM11/6/10
to jbook...@googlegroups.com
hey jbooktraders
    I am a newbie of jbooktrader, could you give me an explanation of meaning of market depth balance? is it something related to volume? 

Eugene Kononov

unread,
Nov 6, 2010, 6:01:32 PM11/6/10
to jbook...@googlegroups.com
Market depth balance is the number which quantifies the relationship between the size of all bids and the size of all offers in the exchange's limit order book. For every snapshot every 1 second, JBookTrader sums up all bid sizes, sums up all offer sizes, and calculates the balance as
balance = 100 * (cumulativeBidSize - cumulativeAskSize) / (cumulativeBidSize + cumulativeAskSize)

So, by design, the balance varies from -100 to +100. It's negative when the size of all offers exceeds the size of all bids, and positive otherwise.

Jian

unread,
Nov 6, 2010, 7:51:41 PM11/6/10
to jbook...@googlegroups.com
thank for the explanation, two questions in my mind:
1) You mentioned 'every 1 second', but i saw the following line in StrategyRunner.java
        scheduler.scheduleWithFixedDelay(new SnapshotHandler(), 0, 500, TimeUnit.MILLISECONDS);
    shouldn't it be half second?
2) how balance related to volume? is this statement true: higher balance means high volumen?
 

--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To post to this group, send email to jbook...@googlegroups.com.
To unsubscribe from this group, send email to jbooktrader...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.

Eugene Kononov

unread,
Nov 6, 2010, 8:03:34 PM11/6/10
to jbook...@googlegroups.com


1) You mentioned 'every 1 second', but i saw the following line in StrategyRunner.java
        scheduler.scheduleWithFixedDelay(new SnapshotHandler(), 0, 500, TimeUnit.MILLISECONDS);
    shouldn't it be half second?


No, it's every 1 second. The 500ms scheduler rate is to ensure that we get exactly on the second. If we scheduled every 1 second, sampling would be off due to clock drift. See the run() method in SnapshotHandler.java.

 
2) how balance related to volume? is this statement true: higher balance means high volumen?
 

There is no relationship between balance and volume, or more precisely, the relationship is unknown since JBT does not keep track of volume. However, in the next release, it will. Regardless, these are two different quantities: balance measures the state of the limit order book, and volume is the number of contracts/shares traded.

Astor

unread,
Nov 6, 2010, 9:49:11 PM11/6/10
to jbook...@googlegroups.com

This indicator may measure something about retail investors' sentiment but it is unlikely to capture much about institutional trades. Those often use "iceberg" orders, where a very small posted limit order (tip of the iceberg) conceals a much larger true order size.  Perhaps you may find this link useful: http://www.dgf2008.de/content/paper/Frey_Sandas_Iceberg_Sept7th08.pdf
 
Another interesting way to analyze limit order book, while combining the price and the quote size, is to view each bid and ask quote as call and put: When an investor places an ask limit order, he effectively grants other investors the right, but not the obligation to buy his stock at the limit price. This is similar to writng a call. Same logic can apply with respect to bids and puts. The bid-ask spread represent twice the premium that the investor ( or market maker) expects to earn in return for granting such right.   Within that framework, the time to expiration t =(quote size / average daily volume ).
Then, black-scholes type formula can be inverted to get implied volatility of the bid and ask quotes. Change in average implied volatility may be predictive of the stock direction in the same way VIX index is.  


From: Eugene Kononov <eugene....@gmail.com>
To: jbook...@googlegroups.com
Sent: Sat, November 6, 2010 5:01:32 PM
Subject: Re: [JBookTrader] meaning of depth balance

Market depth balance is the number which quantifies the relationship between the size of all bids and the size of all offers in the exchange's limit order book. For every snapshot every 1 second, JBookTrader sums up all bid sizes, sums up all offer sizes, and calculates the balance as
balance = 100 * (cumulativeBidSize - cumulativeAskSize) / (cumulativeBidSize + cumulativeAskSize)

So, by design, the balance varies from -100 to +100. It's negative when the size of all offers exceeds the size of all bids, and positive otherwise.

nonlinear5

unread,
Nov 6, 2010, 10:01:41 PM11/6/10
to JBookTrader
> Another interesting way to analyze limit order book, while combining the price
> and the quote size, is to view each bid and ask quote as call and put: When an
> investor places an ask limit order, he effectively grants other investors the
> right, but not the obligation to buy his stock at the limit price. This is
> similar to writng a call. Same logic can apply with respect to bids and puts.
> The bid-ask spread represent twice the premium that the investor ( or market
> maker) expects to earn in return for granting such right.   Within that
> framework, the time to expiration t =(quote size / average daily volume ).
> Then, black-scholes type formula can be inverted to get implied volatility of
> the bid and ask quotes. Change in average implied volatility may be predictive
> of the stock direction in the same way VIX index is.  
>

I never thought about it in that manner, but yes, it makes sense.
Reply all
Reply to author
Forward
0 new messages