Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 08:08:03 +0000



Handling IB API server disconnect - please help

View Count: 2782

[2016-06-01 03:00:05]
User754985 - Posts: 109
IB has a period - appr. from 12:15 to 12:27 - when historical and RT data servers are connected and data are getting into SC, yet "IB API server" is shown as not connected (in IB Gateway)

IB Gateway is attempting to reconnect, and SC is not. So, an order can get triggered but will not get through to IB for execution.

What would be the way to catch this situation in SC?

if (sc.ServerConnectionState==SCS_DISCONNECTED || sc.ServerConnectionState==SCS_CONNECTION_LOST)

- these get triggered on a disconnect from IB Data servers, but not IB API Order server...
[2016-06-01 06:22:12]
Sierra Chart Engineering - Posts: 104368
There is not a way to detect this other than checking the status of the order and seeing that it was rejected. Assuming Interactive Brokers is rejecting the order.

But eventually Sierra Chart will put the order into an error status after it times out.

The other thing you can do is check the particular times mentioned by using this variable:
https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scCurrentDateTime

And not submitting an order to begin with.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-06-01 06:22:48
[2016-06-01 06:48:04]
User754985 - Posts: 109
Problem is this maintenance time is somewhat floating.

It is a 5-15min period within roughly 45-55min. Blacking out these 50min for a continuously trading system is very sub-optimal.

IB API should be having a relevant error/warning message code - would be really great to add another constant SCS_apiDISCONNECTED based on it.
[2016-06-01 07:03:15]
Sierra Chart Engineering - Posts: 104368

IB API should be having a relevant error/warning message code - would be really great to add another constant SCS_apiDISCONNECTED based on it.

There is no chance in 1,000,000,000,000 years we are going to do something like this. We are not going to do a Mickey Mouse solution and we are not going to give in to Mickey Mouse interfaces like the TWS API is.

What Interactive Brokers needs to do is one of the following:
-Disconnect the API client
-Immediately reject the order because it cannot be accepted during the server disconnect
-Immediately accept the order and put it into a Pending Open state.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-06-01 07:04:08
[2016-06-01 14:53:11]
User754985 - Posts: 109
Your hate of IB API is clear.

But they are a good broker, with good spreads,execution and commission, etc.

And so what do we users have to do during this mega fight of yours against mickey-mouse interfaces of the world?

Your integration of IB API is solid and stable. And I suggested a very simple improvement that could make it more complete.

On my side, I will write to IB asking about how to handle such situation
(though i foresee their response that an appropriate error code/warning is available through the api and can be easily recognized)
[2016-06-01 16:49:05]
Sierra Chart Engineering - Posts: 104368
Interactive Brokers needs to solve this problem for you. It is that simple. They can do it easily.


(though i foresee their response that an appropriate error code/warning is available through the api and can be easily recognized)
This is not an acceptable answer from them.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-06-02 03:12:13]
Sierra Chart Engineering - Posts: 104368
Although we can look at this from a different perspective.

If you tell us the particular integer error codes indicating the order server being connected and disconnected, we can then use those to set an internal status in the Interactive Brokers TWS interface which can be used to reject an order sent while the connection is down.

We could do this for a custom programming charge of 150 USD.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-06-02 10:30:42]
User754985 - Posts: 109
I am now in a discussion with IB who apparently were under the impression that the API client DOES get disconnected during daily IB API server maintenance...
[2016-06-02 16:37:40]
Sierra Chart Engineering - Posts: 104368
OK understood.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account