Problems with downloading TD Ameritrade transactions.

David Reiser dbreiser at icloud.com
Wed Jul 27 17:31:30 EDT 2016


ofx.py is a python script/module that runs entirely independent of gnucash.

There is a copy at http://stuffbillhasdone.blogspot.com/2010/04/ofx-python.html

That site author mentions jongsma.org. But I think that’s a dead site these days. Maybe the Wayback Machine has it if you’re interested.

You’ll need some version of python available, but I don’t think ofx.py is all that tied to any version. I use 2.7, but I don’t think 3.x would object to the code. If you’re running a command line window with the ‘current directory’ being the location of the ofx.py file, you would enter the command:

/usr/bin/python ofx.py ameritrade 123456789 123456789

Those numbers are your account number, entered twice. After you hit return, you’ll be asked for your password. Enter the 4 digit TDA PIN for your account.

As long as nothing goes wrong, you’ll end up with a file in the same directory as ofx.py named something like ameritrade20160727.ofx

You may notice that date control is exceptionally rudimentary in ofx.py. You may or may not get the most useful range of dates for a download. I’m pretty sure you’ll end up with most recent nnn days, where nnn is some indistinct number that is probably more than 30, but I’ve had trouble trying to nail it down. And I think TDA has gotten more restrictive with how much you can download at one time since the first time I ran the script 8 or 9 years ago.

If you aren’t on some flavor of Unix, or if you have multiple versions of python around, the /usr/bin/python should be replaced with whatever it takes to launch python on your system.
--
Dave Reiser
dbreiser at icloud.com





> On Jul 27, 2016, at 4:09 PM, RD via gnucash-user <gnucash-user at gnucash.org> wrote:
> 
> Thanks Mike and Dave,
> 
> I have tried several different combinations in the user configuration. Nothing has worked and I am getting frustrated. I searched for the ofxpy setup but couldn't find anything. Can you share a link for that?
> 
> 
> 
> On Wednesday, July 27, 2016 1:07 PM, Michael via gnucash-user <gnucash-user at gnucash.org> wrote:
> I was able to connect to TDA via aqbanking, but never to successfully 
> download anything that way.  I download in csv format, convert to a qif 
> and then import to gnucash.  Kind of a pain but it works.  Didn't know 
> about ofxpy.  Will look at that. Mike
> 
> 
> On 07/27/2016 09:25 AM, David Reiser wrote:
>> Are you using your account number as your login ID and your PIN as the password?
>> 
>> I’ve forgotten how I originally received my PIN, but I think there’s a way to set a new one if you are logged into the web account access. The ofx credentials are completely different from the web login credentials.
>> 
>> In the past I found that libofx (the utility gnucash uses for Import…) has done a better job of handling buy/sell transactions than aqbanking (directconnect utility). So I’ve used ofxpy to connect to TDA and download ofx files for importing.
>> 
>> TDA also has a habit of including a bunch of placeholder ticker symbols for stocks from which you’ve closed out positions. Dealing with those is a hassle no matter which downloading scheme you use. And I still haven’t figured out how to consistently deal with the way they report the money market/clearing account transactions.
>> 
>> My retirement account at TDA is now big enough that I’ve been thinking about pestering my account advisor to lean on the IT group to allow ofx downloads from the web page (just like Vanguard and TIAA-CREF do…). Maybe they’ll care enough about keeping my money to consider offering better digital service.
>> --
>> Dave Reiser
>> dbreiser at icloud.com
>> 
>> 
>> 
>> 
>> 
>>> On Jul 27, 2016, at 11:35 AM, RD via gnucash-user <gnucash-user at gnucash.org> wrote:
>>> 
>>> 
>>> 
>>> 
>>> Has anyone successfully downloaded transactions from TDAmeritrade?
>>> 
>>> My user setup seems to be fine as I can download the account list -
>>> 
>>> 11:33:51 Sending request...
>>> 11:33:51 Using old SSL preparation code.
>>> 11:33:51 TLS: SSL-Ciphers negotiated: TLS1.2:RSA-AES-256-GCM:AEAD
>>> 11:33:54 Waiting for response...
>>> 11:33:54 Parsing response...
>>> 11:33:54 Parsing response
>>> 11:33:54 Status for signon request: Success (Code 0, severity "INFO")
>>> The server successfully processed the request.
>>> 11:33:54 Status for account info request: Success (Code 0, severity "INFO")
>>> The server successfully processed the request.
>>> 11:33:54 Operation finished, you can now close this window.
>>> 
>>> but downloading transactions fails consistently -
>>> 
>>> Connected to "ofxs.ameritrade.com"
>>> Using old SSL preparation code.
>>> TLS: SSL-Ciphers negotiated: TLS1.2:RSA-AES-256-GCM:AEAD
>>> Connected.
>>> Sending message...
>>> Message sent.
>>> Waiting for response...
>>> Receiving response...
>>> HTTP-Status: 400 (Bad Request)
>>> Error parsing server response
>>> 
>>> Thanks.
>>> RD
>>> 
>> 
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> 
> _______________________________________________
> gnucash-user mailing list
> 
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.




More information about the gnucash-user mailing list