TWS Color Grouping Windows are identified by a color chain, as you can see in the Users’ Guide screenshot below. In the API, an integer number serves to map these specific colors and the function
displayGroupList facilitates the integration.
Let’s take a look at this scenario from our GitHub Reference Guide using
First, API users invoke the function
IBApi.EWrapper.displayGroupList to query the Groups.
The function returns a list of groups, in a format of integers separated by an “I” character like this “4|1|2|5|3|6|7”. See Python example from the GitHub Guide below.
def displayGroupList(self, reqId: int, groups: str):
print("DisplayGroupList. ReqId:", reqId, "Groups", groups)
Next, in order to integrate with a specific group, API users have to subscribe to the group, using the function
Finally, the Group Window in TWS can display a certain contract by invoking the API function
Visit GitHub for additional samples in Java, C++ or C#, and for instructions on how to unsubscribe from the Group Events.