10.2.1391
An efs interested in bid ask analysis will use getMostRecentBid()/Ask to compare the trade price with the Bid Ask quote prices. What I've noticed is that when both the Ask and the Bid quotes occur between trades, only the last of them is returned to getMostRecentBid()/Ask, hence, if there has been a bid and ask price change rather than just a size change, the code thinks that only one price has changed. This can result is an apparent zero-sized spread, and other complications.
Here is a commented fragment from a Tick download of ES #F for Friday.
In other words, getMostRecentAsk(); and getMostRecentBid() never seem to both return a value. So if both the bid and ask price quote have changed there is only one update noticed by the code.
An efs interested in bid ask analysis will use getMostRecentBid()/Ask to compare the trade price with the Bid Ask quote prices. What I've noticed is that when both the Ask and the Bid quotes occur between trades, only the last of them is returned to getMostRecentBid()/Ask, hence, if there has been a bid and ask price change rather than just a size change, the code thinks that only one price has changed. This can result is an apparent zero-sized spread, and other complications.
Here is a commented fragment from a Tick download of ES #F for Friday.
PHP Code:
Q,081205,150000,0,827.75,0,287,, ;; AQ 7.75
T,081205,150000,827.75,1,
Q,081205,150000,0,827.75,0,287,,
Q,081205,150000,0,827.75,0,288,,
Q,081205,150000,0,827.75,0,289,,
T,081205,150000,827.75,1,
T,081205,150000,827.75,16,
Q,081205,150000,0,827.75,0,272,,;; AQ 7.75
T,081205,150000,827.75,1,
Q,081205,150000,827.5,0,37,0,,
Q,081205,150000,0,827.75,0,271,, ;; AQ 7.75 still, new size
Q,081205,150000,827.5,0,40,0,,
Q,081205,150000,827.5,0,48,0,, ;; BQ 7.5 still,new size
T,081205,150000,827.5,1, ;;TB
T,081205,150000,827.5,1, ;;TB
T,081205,150000,827.5,1, ;;TB
T,081205,150000,827.5,2, ;;TB
T,081205,150000,827.5,6, ;;TB
T,081205,150000,827.5,24, ;;TB
T,081205,150000,827.5,2, ;;TB
T,081205,150000,827.5,11, ;;TB, Bid size consumed
Q,081205,150000,827.25,0,418,0,,;; BQ Lower price 7.25 (was 7.5)
Q,081205,150000,827.25,0,318,0,,;; Q,081205,150000,0,827.5,0,282,,;; AQ Lower price 7.5 (was 7.75)
Q,081205,150000,827.25,0,317,0,,;; BQ 7.25 still, new size
Q,081205,150000,0,827.5,0,280,,;; AQ 7.5 still, new size
;; At the call to main() for this next trade getMostRecentBid() provides NO value (==null || ==0 test),
;; hence the code thinks the Bid Quote is still 7.5, however getMostRecentAsk() returns 7.5,
;; ie they are the same, the spread appears to be 0.
T,081205,150000,827.5,3, ;; TA, but code thinks TB too
T,081205,150000,827.5,3, ;; and so on, until size changes
Comment