Login Page - Create Account

Support Board


Date/Time: Fri, 10 Jan 2025 09:52:08 +0000



Message to Interactive Brokers about Position Updates

View Count: 1455

[2016-08-30 18:56:54]
Sierra Chart Engineering - Posts: 104368
Hello Interactive Brokers API Support,

We received the following information from one of our users:

Siteng J: The log file shows the same behavior as we checked before
Siteng J: Sierra chart invoked the function to request for account information before the connection has been fully established
Siteng J: So there is a kind of competing session that no account data was returned
eggnog999: When u say connection are you referring to full fill on order?
Siteng J: No, when Sierra CHarts connects to TWS
Siteng J: If you want to see this in the log, I can show you
eggnog999: sure
Siteng J: They just need to put in a wait of something so that only makes requests when the connection is fully established
Siteng J: Open that file, search for "<- 6-2-1-U1644808"
Siteng J: That is the request to get account information
Siteng J: If you look at several lines below that, you should also see messages like "Market data farm connection is OK..."
Siteng J: Those messages actually can be considered as a flag that shows the connection is successful
Siteng J: Since the request came before those messages, no account data has been sent back through out the entire API connection session
Siteng J: Here is a successful example: try to search for "<- 6-2-1-DU273679"
Siteng J: This is the request to account data for your paper trading account
Siteng J: You should see that request was sent after the messages "Market data farm connection is OK..." appeared in the log
Siteng J: So account information and portfolio information was sent back by TWS immediately after the request was sent

We have set in bold the relevant information from you.

You are indicating that Sierra Chart should not be sending an API request for Account Data until the connection is fully established and you are saying that the connection is fully established based upon some messages indicating the market data connection is OK.

Sierra Chart also does wait five seconds before requesting Account Data in our newest versions.

A requirement to wait sending an Account Data request to our knowledge is not documented anywhere in your documentation and this requirement is very absurd to require an API program to go through such a check.

Once the connection is established to trader workstation, the API client needs to be able to make whatever requests it can. What you need to do on your side is remember that there has been a request for Account Data and then when the connection is fully established within Trader Workstation you need to then make that request internally again to your server. This is the proper solution.

An API program should not have to go through any special protocol to make a request for account data once the connection has succeeded to Trader Workstation.

We insist that you solve this problem on your side. Look at all of the trouble you have caused your users and our users all these years. Does this make any sense? No it does not.


The other solution is do not even allow the connection to Trader Workstation until such time that the API can handle the Account Data request without failure.

Thank you,
Sierra Chart Engineering
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-08-30 19:06:24
[2016-09-01 07:04:15]
Sierra Chart Engineering - Posts: 104368
Response from Interactive Brokers:

The Trader Workstation (TWS) is a Java application and API programs would connect to TWS via a socket based connection. TWS would host a socket server and listen on a specific port number for API clients to connect.

When initiating a socket connection in general, not specific to TWS, one should always make sure that the connection has been fully established before sending out any communication messages. I have went back and found the original log file submitted by the client mentioned in the link provided by you, you should see that Sierra Charts always starts to send out API requests immediately (only 16 ms) after its connection attempts:

----------------------------------------
06:11:53:172 -> 15-1-U1644808-
06:11:53:188 -> 9-1-11271-
06:11:53:188 <- 62- // Request for account updates was sent out here
06:11:53:188 <- 8-1-40000-
...

In the chat with the client, I did not mean you need to wait for a message of Market Data Farm connection as a flag before sending out API requests to TWS. Instead, I only meant that message can be considered as a indicator that indicates the socket connection has been fully established.

We apologize for the fact that this is not documented on the current API documentation, but this has always been a suggestion by IB Development Team that API clients should put a wait (about 1 second) in their program to make sure it does not send out API requests before a socket connection has been fully established.

We will definitely work on providing a better API documentation to include such suggestion so as to make sure API connection always works smoothly.

Regarding:
you should see that Sierra Charts always starts to send out API requests immediately (only 16 ms) after its connection attempts:

We understand what you are saying and based upon the original communication from you we changed the delay for requesting account updates to five seconds rather than immediate.

For many years, it was always a five second delay because we know it is important to allow the server a chance to do any initial processing after the socket connection comes in.

However, when we added support for needing to verify whether a user has a live account and also check their account balance, is the reason why we then switched to an immediate request so that we could determine whether there was a sufficient account balance to meet CME market data requirements for our data feed.

This was necessary before considering the connection fully connected in Sierra Chart before any market data requests were made.

This type of account balance check proved unreliable and it was removed but we did not restore the five second delay for requesting account updates but it has been now.

Even with the five second delay the user is still experiencing a problem. Unless the user did not update to our latest version. This very well could be the source of the remaining problem. We will check with them again. If there continues to be a problem we will let you know.
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-09-01 07:09:32

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

Login

Login Page - Create Account