After some additional testing I am yet to get this right.
I have included two additional samples (out of many) that shows an unbalanced table
(Both samples are from January 25th 2007.)
Sample 1:
Stock: ADSK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Time: [15:36:10]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________
| Bid || Ask |
______________________________________________
|NSDQ |042.200|000004||EDGA |042.180|000001|
|CINN |042.200|000005||NSDQ |042.210|000001|
|ARCX |042.190|000003||ARCX |042.210|000007|
|AMEX |042.180|000010||CINN |042.220|000001|
|BTRD |042.180|000001||BTRD |042.220|000001|
|AUTO |042.150|000012||AMEX |042.230|000010|
|GSCO |042.140|000001||COWN |042.250|000001|
|EDGX |041.880|000005||GSCO |042.260|000001|
|COWN |041.850|000001||EDGX |043.150|000010|
|EDGA |000.000|000000||AUTO |044.000|000003|
“EDGA” on the ask side is lower that NSDQ on the bid side.
This is an unbalance table and an impossible situation.
Clearly EDGA on the Ask side is at fault and I went back to see its last entry and here it is:
L2-->MarketMakerID[EDGA ] Ask[042.180]/Bid[000.000] AskSize[000001]/BidSize[000000] Time[03:19:38] Reason[ :NDR] ConditionCode[R:REG OPEN ] SourceID[015]
It shows an ask side with a price of 42.18 and quantity of 1 (100)
This entry is apparently obsolete as the market has change and this is no longer the offer, but I had no way of telling this from the Level 2 feed.
Here is another sample:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Time: [15:51:45]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________
| Bid || Ask |
______________________________________________
|ARCX |048.890|000005||BTRD |048.860|000001|
|NSDQ |048.890|000003||EDGX |048.890|000001|
|CINN |048.890|000001||CINN |048.900|000001|
|AMEX |048.860|000010||NSDQ |048.900|000004|
|ETRD |048.860|000008||ARCX |048.900|000011|
|UBSS |048.830|000004||AMEX |048.910|000010|
|LEHM |048.780|000001||LEHM |048.940|000001|
|JPMS |048.750|000001||TMBR |048.960|000011|
|FBCO |048.600|000001||WEDB |049.020|000001|
|TMBR |048.600|000012||COWN |049.050|000001|
|SALI |048.600|000001||JPMS |049.050|000001|
|KBRO |048.600|000001||WBLR |049.170|000001|
|RBCM |048.590|000001||ETRD |049.230|000010|
|OPCO |048.590|000001||BOFA |049.250|000001|
|SBSH |048.590|000001||BARD |049.280|000001|
|GSCO |048.580|000001||UBSS |049.330|000002|
|WCHV |048.580|000001||BEST |049.330|000001|
|BARD |048.580|000001||FBRC |049.490|000001|
|PRUS |048.550|000001||JEFF |049.680|000001|
|LAZA |048.550|000001||MADF |049.940|000001|
|COWN |048.550|000001||GSCO |050.000|000001|
|BEST |048.550|000001||WCHV |050.130|000001|
|DBAB |048.550|000001||CIBC |050.140|000001|
|THNK |048.510|000001||GROW |050.200|000001|
|MLCO |048.510|000001||SBSH |050.210|000001|
|WEDB |048.510|000001||PIPR |050.320|000001|
|CHLM |048.500|000001||MSCO |050.520|000001|
|PERT |048.500|000004||THNK |050.520|000001|
|NEED |048.500|000001||PACS |050.750|000001|
|HSBC |048.500|000001||OPCO |050.800|000001|
|EDGX |048.500|000002||PERT |050.860|000001|
|STFL |048.500|000001||CDRG |051.000|000005|
|BOFA |048.500|000001||STFL |051.000|000001|
|FBRC |048.490|000001||NEED |051.010|000001|
|PIPR |048.440|000001||NITE |051.240|000001|
|WBLR |048.400|000001||RHCO |051.250|000001|
|ADAM |048.400|000001||FBCO |051.490|000001|
|MSCO |048.380|000001||BMOC |051.540|000001|
|NITE |048.370|000001||HDLY |051.590|000001|
|PACS |048.250|000001||SALI |052.000|000001|
|CIBC |048.230|000001||MWRE |053.300|000001|
|HILL |048.200|000001||RBCM |053.730|000001|
|GROW |048.200|000001||KBRO |054.150|000001|
|JEFF |048.180|000001||ADAM |054.500|000001|
|BMOC |048.010|000001||PRUS |054.510|000001|
|HDSN |048.000|000001||TWPT |054.550|000001|
|TWPT |048.000|000001||MLCO |054.550|000001|
|CANT |048.000|000001||DBAB |054.600|000001|
|CDRG |048.000|000002||AUTO |054.800|000003|
|MAXM |048.000|000001||KING |054.970|000001|
|MADF |048.000|000003||HILL |055.450|000001|
|KING |047.990|000001||HSBC |056.000|000001|
|HDLY |047.890|000001||CHLM |056.000|000001|
|BERN |047.860|000001||NFSC |056.000|000002|
|BTRD |047.500|000042||CANT |056.000|000001|
|MWRE |047.000|000001||MAXM |057.000|000001|
|ALLN |046.000|000001||HDSN |057.000|000001|
|EFGI |045.000|000001||BERN |057.050|000001|
|FACT |045.000|000001||LAZA |059.810|000001|
|VNDM |045.000|000001||VNDM |060.000|000001|
|NFSC |040.460|000001||ALLN |060.000|000001|
|SUSQ |034.750|000001||FACT |060.000|000001|
|WEED |030.500|000001||EFGI |060.000|000001|
|STCS |020.000|000001||SUSQ |070.250|000001|
|CHDN |000.010|000001||WEED |075.520|000001|
|DOTC |000.010|000001||FRAN |099.990|000001|
|RHCO |000.010|000001||STCS |120.000|000001|
|BNCH |000.010|000001||CRTC |2000.000|000001|
|SEAB |000.010|000001||CHDN |2000.010|000001|
|CRTC |000.010|000001||SEAB |2000.200|000001|
|FSWC |000.010|000001||GARC |199999.980|000001|
|AUTO |000.010|000002||DOTC |199999.980|000001|
|FRAN |000.010|000001||FSWC |199999.980|000001|
|GARC |000.010|000001||BNCH |199999.980|000001|
|FAGI |000.010|000001||FAGI |199999.980|000001|
|ISSE |000.000|000000||EDGA |000.000|000000|
“BTRD” on the ask side is at fault and the last entry from “BTRC” is here:
L2-->MarketMakerID[BTRD ] Ask[048.860]/Bid[047.500] AskSize[000001]/BidSize[000042] Time[03:47:46] Reason[ :NDR] ConditionCode[R:REG OPEN ] SourceID[005]
Again a situation that the offer is obsolete but I had no way of telling that from the feed.
I need to resolve this so I can continue with my development.
Anyone?
Shimon Dekel