Import TOS trade data

status1

Active member
Did anyone try to export trade data and make it into an excel format ?

A couple of weeks ago I started on a project to see if I can make entering trade data from brokerages a little easier to save some time
I was able to download the trade data in excell format from all brokerages except for TD
While I could download transactions it does not show if it's an opening or closing transaction
The only place it shows up is on the confirmation page which is in HTML format and a messy one at that with data that is not in any useable excel format

I was just wondering if anyone tried it or found a workaround for this problem
 

Tb2018

Member
Hi,if you go to account statement and export to file(in THINKORSWIM)...than open in excel and scroll down into account order history you have it.
 

Marcas

Member
Tb2018 is correct. Don't go to TDA webpage. Open Thinkorwim, Monitor_Tab/Account_Statement. On the right hand side you have Actions Menu (three lines icon). From there you choose Export To File (csv) or to Excel directly and you have bunch of data (depending on lookback period you've chosen for Account Statement) to work with. Good luck.
 

status1

Active member
Thanks I am aware of that file and while it shows the trades it does not say if that trade is an opening or closing trade
It just says bot or sold but that can be bought to close or bought to open and the same for the sale side

Sure it's easier to download but if I can't tell if it's an opening or closing trade it kind of defeats the purpose of making things easier to enter into a trading log
 

garyw

Active member
@status1: When observing the TOS account export file, look in the section titled "Account Trade History"
The column titled "Pos Effect" will indicate either "TO CLOSE" or "TO CLOSE" fore every leg of each trade! Not sure where you are looking as even the "Account Order History" section includes that column! <-- Guessing you are NOT including that column in your export!
1588030524052.png
 

status1

Active member
Upon closer inspection it's still not a complete transaction because it does not show the commissions and fees that's why I was trying to look at the cash sweep which has that information but it does not have the open and close
So you have to mash the 2 positions into one to get an accurate transaction or have the confirmation in a csv format but that is not available
So either way I look at it this is not going to easy
 

garyw

Active member
status1:
The way I handle this for my personal use (not suggesting this is what you should do), is I know what TDA's fee structure is and account for those fees in my processing (do not require the commissions and fees to be in my trade history). -- I simplify to a single cost for the trade instead of deal with the fees, commissions, and exchange fees (which is cumbersome to keep track of).

Another possible approach, which I do NOT do, is since the information in the cash/sweep section includes timestamp, if you code, you can use that to correlate to the trade history section by referencing the cash section by timestamp for reference to the fee & commissions!
 

Marcas

Member
Status1, I think that all, or at least, most, info is contained in TOS export file.
For what I understand data is not organized the way you wish. If so you are not alone. There are some really frustrating issues with TOS export file. Nevertheless info is there and can be extracted.

If you show me _exact_ final form you want to see your trade, I may help (no descriptions please). PM me or, better yet, describe your problem in programmers part of the forum (Software Development) or in Excel section or in slack for programmers.
I can help with Py code only, if you want Excel version you have to do it yourself or ask other person.

Just consider if you are able to solve problem by your own and how desperately you need it done.
 

status1

Active member
instead of deal with the fees, commissions, and exchange fees (which is cumbersome to keep track of).
I agree but I still would like to have it showing to have an accurate p/l

I looked into the time stamp but it has somewhat of a delay so I can't use that to match the trades besides that makes it more complicated that I imagined
 

status1

Active member
I think that all, or at least, most, info is contained in TOS export file
Yes it's most but not all

I don't expect it to be organized in a certain way but at least they should have the complete data in one place not some here and some there I was not expecting such incomplete data from a big company like TD

I appreciate your help but I think I can manage by myself in excel
I just posted here in case someone found an easy way to get all the data garyw almost had it if it wasn't for the commissions missing

I am not in a rush and I understand this will take time I just want to make sure I don't start with something more difficult if there is an easier way around

So I am using the confirmation page which is in HTML format and I copy and paste the text from there into an excel file than slowly extract all the data I need from there
I am also learning a lot about VBA programing and all kinds of functions used in excel so that is also interesting to me

Ideally the ultimate goal is to automate the data entry with just a few clicks instead of entering all the data manually from each account every time I make a trade which takes a lot of time with all the different accounts I have

As a bonus if I can do that than perhaps I could also use the same data to enter it into the TJS program that Dan showed in a recent Trading group 1 presentation but that's far away Right now I am just gathering all the data I need
 

Marcas

Member
For what I can tell and from my experience you've chosen right path or, at least, path that many are familiar with. Definitely go for automation doing it manually is a fun but only for so long.
I don't know what TJS is, I'm convinced though that whatever it is you can do the same on your own.
Good luck and try to find somebody who already knows or trying to learn VBA, ideally working on similar projects - even if only to chat once a while.
 

status1

Active member
TJS = Trading Journal Spreadsheet
Here is the link https://trading-journal-spreadsheet.com/
That's the one that Dan mentioned in the trading group 1 a week or two ago

I could make the format to paste it in there but I don't think I could make an entire program like that at least not without a lot more time spent and a lot more programing knowledge If someone already made it I don't need to waste my time to reinvent the wheel
 

Marcas

Member
I checked the link. Seems to be a good stuff. What I like they ask for one time fee, not subscription. Considering that, your approach is reasonable. Still, if you know how to code you can do whatever you wish without relaying on others to guess your wishes.

I'm not discouraging you from purchase (price is reasonable) but encouraging to diving into coding. There is so much you can do with that.
 
Top