Hi,
I am trying to read executions.txt file of IB
Is there any example of how to do it or which libraries I need to import.
Thanks!
Size:
Color:
Hi,
This solution may not support it out of the box but might still give an idea how to adjust your file to import it into WL:
Import real (historical) tradesWhat's the format of the file? We could probably add support for it in a future release of C.Components.
Size:
Color:
Historical Trades (HT) is included in the downloadable strategies in the utilities folder. The
No Coding version is simplest. All versions may read the file with minimal or no changes. It worked with the IB data I had a few years ago and in fact I added a few data column header titles to match IB's trade report.
Post a text data file with a few trades including column header titles.
One of the advantages with HT is it allows a single buy transaction to be sold in multiple transactions.
Size:
Color:
Eugene,
This is a standard export format from the IB TWS tool :
https://guides.interactivebrokers.com/twsguide/twsguide.htm#usersguidebook/configuretws/configure_auto_export.htm%3FTocPath%3DGlobal%2520Configuration%7C_____2Default columns are : Symbol,Action (BOT/SLD),Quantity,Price,Time,Date, Exchange,Account,Order Reference,Clearing
Size:
Color:
Alexandre, thanks. So TWS supports custom columns: "and custom allows you to define all fields that will be included in the report." That should make it compatible with ImportHistoricalTrades.
Size:
Color:
QUOTE:
Default columns are : Symbol,Action (BOT/SLD),Quantity,Price,Time,Date, Exchange,Account,Order Reference,Clearing
These default columns are compatible with Historical Trades for daily bars. Intraday bars require the date and time be combined into one date field.
BOT and SLD are not recognized actions in HT. Add these 2 lines to LoadActionDic() routine to recognize them as Long and Sell respectively.
CODE:
Please log in to see this code.
Likewise, if traded, how are Short and Cover trades represented?
Size:
Color:
With IBKR, there is no order instructions to specify Short and Cover. You are Short automatically when you sell more symbols that you have in your portfolio.
Size:
Color:
QUOTE:
there is no order instructions to specify Short and Cover
Neither HT nor Import Real (Historical)Trades support closing a long position and simultaneously opening a short position from a single sell order.
HT allows multiple exits on a single entry order. And an exit order will fill as needed against multiple entries. But short trades require short action be input to enter... At least for now.
So, Long trades will work now as in post #6. Short trades must be action labeled as such.
Size:
Color:
QUOTE:
Neither HT nor Import Real (Historical)Trades support closing a long position and simultaneously opening a short position from a single sell order.
Right, and at least for me it seems not sensible to support such ambiguous action in "Import Real (Historical) Trades".
Size:
Color: