¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Correlate orders and fills from the API to those in Flex Report


 

What is the most reliable way to correlate orders and fills from the API with the same in the Flex Report? It seems each fill has a unique execId and each order has a permId, but there are no such ids in the flex report.


 

I never had the need for Flex Reports but recently started a low-priority project to make an XML schema for automatic ingestion of Flex XML data. The test data I had collected for that does show some line-up between TWS API and Flex XML:
  • Field "execId" from the TWS API Execution class does line up with the "ibExecID" field in the Flex XML type "Trade"
  • The TWS API free-form field "orderRef" in the Order class is carried over to the Flex XML type "Trade" field "orderReference"

There may be others, but at least in my test data, "permId" does not line up with "ibOrderID".

You might have to select the Flex Query option "Include Audit Trail Fields" to see those fields in the Flex XML.

´³¨¹°ù²µ±ð²Ô


On Mon, Oct 30, 2023 at 10:19 AM, Little Trader wrote:

What is the most reliable way to correlate orders and fills from the API with the same in the Flex Report? It seems each fill has a unique execId and each order has a permId, but there are no such ids in the flex report.


 

That's perfect. Thank you.


 

IBKR no longer fill the OrderRef field in flex reports. They certainly used to, some time ago. Now the field is still there but the content is not carried over from TWS to daily reports any more, unfortunately, so it's always empty.

--
Best,
DS


 

I am not a frequent FlexQuery user but I do get my OrderRef strings in Flex (just tried it again to make sure).

The only thing I had to do was to select "Yes" for the blue toggle switch "Include Audit Trail Fields" in the querie's "General Configuration".

´³¨¹°ù²µ±ð²Ô


On Fri, Nov 17, 2023 at 05:56 AM, ds-avatar wrote:

IBKR no longer fill the OrderRef field in flex reports. They certainly used to, some time ago. Now the field is still there but the content is not carried over from TWS to daily reports any more, unfortunately, so it's always empty.

--
Best,
DS


 

You are right Juergen. great find (for me at least)!

I had been receiving daily flex reports since ancient times with OrderRefs filled without any additional settings until they stopped filling it a few months ago or so, so I was unaware that this would now need additional configuration and thought it went the way of the respective field not getting filled for any period exceeding the last trading date. This new configuration certainly sounds quite redundant to me since my explicit ordering of OrderRefs in the report column settings signals I want it filled, but well, I guess IB tried to further minimize the chance that this potentially dense data field inadvertently tax their system.

--
Best,
DS


 

I am on my papertrader account. Via API i can confirm OrderRef field is populated, but it's not filled in Flex Query report even after enabling "Include Audit Trail Fields"