Hey folks, an update from me.
Nothing exciting really, sitting in a 10% drawdown.
I've been trying to get accurate trade confirmations from IB, and unless your orders are filled synchronously (eg. you send an order and your system waits for it to get filled and updates your database) seems like this is not easy to get.
I'll document some of the issues here in case other find it useful.
I'm using somewhat standard setup, IB Gateway with IBC.
As we know, IB Gateway can only return trades from today (I don't know exactly when do they make the cutoff). I then went with Flex Reports as that's the solution mentioned quite a bit, but that has its own problems.
If you use Activity flex reports, you can specify a custom date range (eg. trades from the last week), but the trades can be delayed quite a bit - currently, in my Flex report I can't see any trades from last 48 hours.
If you use Trade Confirmation Flex Query, that is hardcoded to only trades for today, and you can't change that, even though the documentation helpfully suggests you can. I've spent an hour chatting with customer support to see if there's a way to do this, and there's not.
Also, what's not helpful with Flex reports is that from what I see they don't retain the Order Ref - I've double checked that I'm setting it on the orders and I can see it in the TWS.
Customer support rep suggested that I use REST API, but that's another gateway to host and run and I don't want to do that. So that leaves us with the problem, unless you use TWS as your "gateway" which can return last 7 days of trades (I can't find info on why Gateway can do only today), you're stuck.
My current solution will likely be to write a wrapper service around IB Gateway that will be always up and do all the housekeeping, which does seem like a lot of work for something as simple as "get me the trades for last 7 days".
How do you folks do this, and do you have a need to fetch trades from last X days at all?