[ts-gen] Keeping TWS/shim up for an entire week?

Ken Feng kfmfe04 at gmail.com
Fri Aug 14 23:24:28 EDT 2009


Has anyone succeeded in keeping TWS/shim up for an entire week?

I have been trying to do so - my initial attempt is to query for forex
5 second bars.
It seems to be working most of the time, but recently, the system
falls into a strange state where the TWS remains up, but the Ruby/shim
needs to be restarted.

I believe the problem is, when TWS loses its connect and reconnects,
my initial query for 5 second bars is lost.  I will code around this
by requerying for bars upon a 3 4 2

But there seems to be two kinds of 3 4 2 recovery message sequences:

1.  Connectivity between IB and TWS has been lost.
HMDS data farm connection is OK:ushmds2a

2.   Connectivity between IB and TWS has been lost.
Connectivity between IB and TWS has been restored - data maintained.
HMDS data farm connection is OK:ushmds2a

The second one almost seems to iimply that I don't need to re-request
for 5 second bars, but it doesn't happen very often.  I will try to
re-request when I see the following message:

HMDS data farm connection is OK:ushmds2a

in hopes that re-requesting something that is already requested
doesn't hurt anything.  In trying to keep TWS/shim up, it seems to me
that I have to code for all sorts of states - I guess this is a
characteristic of real-time systems.

One strange side-effect of this reconnecting seems to be - sometimes,
querying continues and I get highs and lows of 0.0, but okay values
for open and close.  Very odd.

Here is my question:

Has anyone managed to keep TWS/shim up automagically for an entire
week?  If so, could you please share with us some of the things you
have done to ensure robustness of your system?

Thanks.

- Ken

------------------------------------------------------------------------------------------------------------------


26315|46542|4120244550|3| 4| 2|   -1|2105|HMDS data farm connection is
broken:ushmds2a|
26315|46861|   5006688|3| 4| 2|   -1|2103|Market data farm connection
is broken:cashfarm|
26315|46938|  44878646|3| 4| 2|   -1|2104|Market data farm connection
is OK:cashfarm|
26315|47180| 179511816|3| 4| 2|   -1|2104|Market data farm connection
is OK:cashfarm|
26315|48386| 853012319|3| 4| 2|   -1|1100|Connectivity between IB and
TWS has been lost.|
26315|48396| 855875171|3| 4| 2|   -1|1100|Connectivity between IB and
TWS has been lost.|
26315|48407| 861911318|3| 4| 2|   -1|1100|Connectivity between IB and
TWS has been lost.|
26315|48417| 867465195|3| 4| 2|   -1|1100|Connectivity between IB and
TWS has been lost.|
26315|48429| 876940400|3| 4| 2|   -1|1102|Connectivity between IB and
TWS has been restored - data maintained.|
26315|55207| 347345098|3| 4| 2|   -1|2106|HMDS data farm connection is
OK:ushmds2a|


More information about the ts-general mailing list