You can get executions for up to the past 7 days via the API from TWS (but not the Gateway) by setting the 'Show trades for' dropdown in the Trades Log window to 'Last 7 Days'.
I am not aware of TWS API requests for trade executions that go back several days, Mark. But maybe the built-in TWS "Export Trade Reports Periodically" feature works for you.
In TWS take a look at 'File -> Global Configuration -.> Configuration -> Export Trade Reports'. The default columns contain only the most basic fields (not even the execution ID) but you can add additional fields as needed. You will have one CSV file per day named "trades.YYYYMMDD.csv" and TWS does not delete any of these files.
闯ü谤驳别苍
On Mon, Aug 30, 2021 at 05:16 PM, Mark Dabrowski wrote:
How does one get?Trade Log for the last 7 days programmatically,