[ts-gen] order execution and connectivity problem

R P Herrold herrold at owlriver.com
Tue Oct 9 10:24:24 EDT 2007


On Mon, 8 Oct 2007, Nils Gebhardt wrote:

> I get some strange connectivity behavior. ...

> However, the next entry in the log is:
>
> Oct  8 09:10:09 vneumann : 27815|33009|2099191087|3| 4| 2|      -1|1100|
> Connectivity between IB and TWS has been lost.|
> Oct  8 09:10:10 vneumann : 27815|33010|2100191862|3| 4| 2|      -1|2103|
> Market data farm connection is broken:eurofarm|
> Oct  8 09:10:10 vneumann : 27815|33010|2100194086|3| 4| 2|      -1|2103|
> Market data farm connection is broken:cashfarm|
>
> repeating ca 200 times with OK and broken messages:

I suspect the quick answer is that these messages (concerning 
the non-availability of the data farms) are probably harmless 
(or at least nothing which you can influence, except by 
opening a ticket with TAC at IB), and may be ignored.  We 
strongly believe that Sales happen through a different part of 
the IB backend than History and Market data.

But I _am_ concernted that a MKT order took 40 minutes to fill 
on the initial SELL.  What are the 'Regular trading hours' on 
the exchange upon which 'GBM' trades?  If it does not open 
until 9:10, or there is no counterparty around, it may not be 
an issue that the order did not fire.  I simply lack suficient 
information to know, and will poke around this a bit, showing 
the process I take.

mysql> select * from Symbol where name like '%GBM%' ;
+------+-----+------+------+------+-------+
| uid  | tid | exch | name | desc | conid |
+------+-----+------+------+------+-------+
|  131 |   4 |   13 | GBM  | BOBL |  NULL |
| 5523 |   3 |   13 | GBM  | BOBL |  NULL |
+------+-----+------+------+------+-------+

SecType.uid 3 is of course the Future.  It seems to be on the 
Eurex: GBL, GBM, GBS (Eurex).  [In passing I note that there 
is a .au stock with the same symbol: GBM, GREATER BENDIGO GOLD 
MINES. which we do not have in our Symbol set]

>From the IB site, the relevant exchange hours seem to be:
 	07:30 - 20:00 (CET)
 	www.eurexchange.com

Section 2.19 of my 'commands.pdf' reference spends some time 
developing how to use the 'past' command, after populating the 
PastFilter table with a couple of lines permitting gathering 
intra-day one minute and one second data, and queries outside 
of 'rth'.  This is a work in progress, and so I have not 
formally added it to the trading shim site yet, but a copy is 
at:
    http://www.herrold.com/commands.pdf

mysql> select Contract.uid, Contract.sid, SecType.type,
 	Exchange.name, Symbol.name, FutDetail.expiry from Contract
 	left join Symbol    on Contract.sid   = Symbol.uid
 	left join SecType   on Symbol.tid     = SecType.uid
 	left join Exchange  on Contract.route = Exchange.uid
 	left join FutDetail on Contract.tag   = FutDetail.uid
 		where Contract.sid = '5523';
+-----+------+------+-------+------+--------+
| uid | sid  | type | name  | name | expiry |
+-----+------+------+-------+------+--------+
| 189 | 5523 | FUT  | SMART | GBM  | 200709 |
| 194 | 5523 | FUT  | SMART | GBM  | 200710 |
| 199 | 5523 | FUT  | SMART | GBM  | 200711 |
| 204 | 5523 | FUT  | SMART | GBM  | 200712 |
+-----+------+------+-------+------+--------+

Section 6.1.3 of the reference shows examples of the 
Contract.sid reversing 'left join' for all SecType we support.

http://www.eurexchange.com/market/quotes/INT/FIX/FGBM/200712_en.html
indicates that the current front month is: Dec 2007

So we are interested in Contract.uid: 204

Running the following with the shim, using the command line 
as the source of transactions:

[herrold at centos-4 shim.070928]$ ./shim --data logd
x86 /proc/cpuinfo: 2793759000;
time stamp clocks: 2792917405
  264 112 116 112 116 112 116 112 116 112 116 112 116 112 116 
112 116 112 116 112 116 112 116 112 116 112 116 112 116 112 
116 112 116 112 116 112 116 112 116 112 116 112 116 112 116 
112 116 112 116 112 116 112 116 112 116 112 116 112 116 112 
116 112 116 112 116 112 116 112 116 112 116 112 116 112 116 
112 116 112 116 112 116 112 116 112 116 112 116 112 116 112 
116 112 116 112 116 112 116 112 116 112
x86 /proc/cpuinfo: 2794
time stamp clocks: 2794, 2794000 1

The trading shim has finished program initialization, including the
construction of successful connections to the database and IB tws.

ping acme;
past add 204 14 Ymd_T(20071008 16:00:00);
Hcmd:   0x9ba4e28 past
Hmsg:   0x9ba4e28
ping end;
quit;
[herrold at centos-4 shim.070928]$


The _relevant_ command is:

   *** past add 204 14 Ymd_T(20071008 16:00:00); ***

Which is reflected in the syslog at 09:57:03:

Oct  9 09:55:04 centos-4 :  4334|35704|   1569102|4|100| 5|#
 	|4|100|5|****************|
Oct  9 09:55:04 centos-4 :  4334|35704|   1569114|4|100| 5|#
 	|4|100|5|0.41|070928|data|
Oct  9 09:55:04 centos-4 :  4334|35704|   1569117|4|100| 5|#
 	|4|100|5|****************|
Oct  9 09:55:04 centos-4 :  4334|35704|   1759301|3| 9| 1|1|
Oct  9 09:55:04 centos-4 :  4334|35704|   1759370|3| 4| 2|
 	-1|2104|Market data farm connection is OK:usfarm|
Oct  9 09:55:46 centos-4 :  4334|35746|  44253485|1| 2| 0|ping
 	acme;|
Oct  9 09:57:03 centos-4 :  4334|35823| 121022468|1|19| 0|past
 	add 204 14 Ymd_T;|
Oct  9 09:57:03 centos-4 :  4334|35823| 121043370|2|20|
 	3|1|204|14|Ymd_T|
Oct  9 09:57:04 centos-4 :  4334|35824| 121486077|3| 4| 2|
 	-1|2106|HMDS data farm connection is OK:ushmds2a|
Oct  9 09:57:04 centos-4 :  4334|35824| 121491993|3| 4| 2|
 	204| 165|Historical Market Data Service query message:HMDS
 	server connection was successful.|
Oct  9 09:57:05 centos-4 :  4334|35825| 122779163|3| 4| 2|
 	-1|2106|HMDS data farm connection is OK:euhmds2|
Oct  9 09:57:05 centos-4 :  4334|35825| 123334261|3|17| 3|
 	204|390|
Oct  9 09:57:05 centos-4 :  4334|35825| 123325239|3| 1|
 	1|20071008  09:30:00|107.54|107.54|107.54|107.54|
 	208|107.54|false|FUT.SMART.GBM.
Oct  9 09:57:05 centos-4 :  4334|35825| 123325266|3| 1|
 	1|20071008  09:31:00|107.54|107.54|107.54|107.54|
 	1114|107.54|false|FUT.SMART.GBM.

    ...
Oct  9 09:57:06 centos-4 :  4334|35825| 123334116|3| 1|
 	1|20071008  15:58:00|107.57|107.57|107.57|107.57|
 	0|107.57|false|FUT.SMART.GBM.
Oct  9 09:57:06 centos-4 :  4334|35825| 123334135|3| 1|
 	1|20071008  15:59:00|107.57|107.57|107.57|107.57|
 	0|107.57|false|FUT.SMART.GBM.
Oct  9 09:57:06 centos-4 :  4334|35825| 123946200|4|100| 5|#
 	|4|100|5|event: history insert|(204, 5, 20071008  09:30:00 --
 	20071008  15:59:00)|
Oct  9 09:57:18 centos-4 :  4334|35838| 136287763|1| 2| 0|ping
 	end;|
Oct  9 09:57:22 centos-4 :  4334|35842| 139493605|1| 7|
 	0|quit;|

I see History data there, but am unsure about Timezone skew, 
to be able to look for the OHLC data and quantity entry [i.e., 
when did trades start after the order was entered, such that 
Quantity > 0] in question.  The PastFilter.uid = 15 value also 
shows additional data outside of 'regular trading hours', but 
I am uncertain the exact time in play to look for an open and 
trading market at the time of your MKT order.

You should be able to use this email and the command.pdf 
reference as a template to see into the right time frame of 
History.  Please let the list know the result of your 
investigation.

Hope this helps.

-- Russ Herrold


More information about the ts-general mailing list