Join Early Retirement Today
Reply
 
Thread Tools Search this Thread Display Modes
Personal Algo Trading
Old 09-01-2021, 02:16 AM   #1
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Personal Algo Trading

Note, this thread is about outright trading - so please don't come here looking to bash me or anyone else posting with how day trading is a fools game, you can't time/beat the market, etc., etc. Completely irrelevant to the topic. If you've come here to attack anyone or preach your opinion, please leave now. This thread has to do with Active Investing for those with a high-tech/software background.

That being said...

Any software developers here that are into trading? Ever considered/thought/dreamed about writing your own algo trading system and see how your programming might do in the market? Now is the time to do it!

Both TD Ameritrade and ETrade provide public APIs for developers to roll their own - direct programming interfaces in to their platform. Couple that with free commissions, and why not give it a try? Take $5k or $10k of your play money and see what you can come up with. You can do your coding in any language you're comfortable with that can interface with a REST API. Believe it or not, my system and tools are written in Visual Basic and Excel. You could use Java, Python, really anything you are good at programming with.

In January 2020 a friend pointed me to the TD API. I then spent a couple months developing an automated system. When it was ready, I spent another couple months running in a sandbox and fine tuning it. Come May, I turned it on live and it's been running on its own since. I'm not insanely rich like Jim Simons (yet), but it's been profitable and it's exciting watching it run, analyze what it's doing, fine tuning. Depending on what the market is doing, my system on average is executing between 10 and 50 round trip trades a day. Since May of last year, it's done 3400 round trip trades. Ultimately, I'd like to see it doing 500 to 1000 a day!

Key here is that you have so much flexibility in how you develop your system - buy or sell 1 share at a time if you like, penny stocks, etc. - the commissions are free (some small limitations with TD), so there's no penalty for experimenting. You determine the rules and the level of risk.

For anyone who has interest, below are the links to TD and ETrade and the documentation on their APIs. It only took 5 minutes to get set up with a developer account on TD. I haven't used the ETrade API, but when I quickly reviewed it a while back, it looked extremely similar to the TD API.

https://developer.tdameritrade.com

https://developer.etrade.com/home
njhowie is offline   Reply With Quote
Join the #1 Early Retirement and Financial Independence Forum Today - It's Totally Free!

Are you planning to be financially independent as early as possible so you can live life on your own terms? Discuss successful investing strategies, asset allocation models, tax strategies and other related topics in our online forum community. Our members range from young folks just starting their journey to financial independence, military retirees and even multimillionaires. No matter where you fit in you'll find that Early-Retirement.org is a great community to join. Best of all it's totally FREE!

You are currently viewing our boards as a guest so you have limited access to our community. Please take the time to register and you will gain a lot of great new features including; the ability to participate in discussions, network with our members, see fewer ads, upload photographs, create a retirement blog, send private messages and so much, much more!

Old 09-01-2021, 02:27 AM   #2
Recycles dryer sheets
Luvtoride's Avatar
 
Join Date: Aug 2021
Location: Northern NJ/ Jersey Shore
Posts: 185
Wow, this sounds really neat! Has it worked / been lucrative NJHowie? Do you need to invest in TD or eTrade to open an account and have access to the tools.

Darn, I need to retire soon so I have more time to learn/ execute stuff like this.

Thanks.
Luvtoride is offline   Reply With Quote
Old 09-01-2021, 02:52 AM   #3
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
It is neat, and I believe that developers now have the ability to do for themselves what they've been busting their hump doing for the Wall Street firms. Who would believe it possible to be able to compete in the same space as the big firms with nothing more than your home computer(s) and an internet connection?

With TD you do not need a TD brokerage account to just sign up and open the developer account. However, the moment you want to use the API, you are going to need a TD brokerage account to run the trades through. I'm not familiar with what ETrade requires, but it's likely similar.

ETrade provides a sandbox for running offline and testing - so maybe you do not need a brokerage account there to use the sandbox. TD does not provide a sandbox - so I developed my own, but using a real brokerage account there.

As far as being lucrative, the returns have been multiples above market returns. My portfolio turnover numbers are insane. Having just finished August, year to date my portfolio turnover has been roughly 110x! That's not 110%, but 110 times the portfolio size. My approach is extremely low risk, not looking for home runs, just lots of singles and quickly compounding the returns. It's worked well thus far.
njhowie is offline   Reply With Quote
Old 09-01-2021, 03:01 AM   #4
Recycles dryer sheets
Luvtoride's Avatar
 
Join Date: Aug 2021
Location: Northern NJ/ Jersey Shore
Posts: 185
Thanks, very interesting. I just signed up and registered for the tools on TD. I will have to find some to to learn and study this but it sounds like it’s worthwhile to “play” with.
Thanks.
Luvtoride is offline   Reply With Quote
Old 09-01-2021, 07:02 AM   #5
Full time employment: Posting here.
latexman's Avatar
 
Join Date: Mar 2014
Location: Apex
Posts: 584
Can you briefly describe the human machine interface. Do you pick or limit the stocks or the algo? Does the algo have complete control on buys and sells, or do you set limits? Does the algo do any puts or calls? Any AI in the algo code? Sounds interesting.
latexman is offline   Reply With Quote
Old 09-01-2021, 07:13 AM   #6
Recycles dryer sheets
 
Join Date: Feb 2018
Posts: 136
This sounds great! I’ll check out the E*TRADE side of things. Looking forward to it, thanks for posting!
RVplusDog is offline   Reply With Quote
Old 09-01-2021, 07:19 AM   #7
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by latexman View Post
Can you briefly describe the human machine interface. Do you pick or limit the stocks or the algo? Does the algo have complete control on buys and sells, or do you set limits? Does the algo do any puts or calls? Any AI in the algo code? Sounds interesting.

You can program it to do whatever you want. If you can dream it and translate it into source code, you can do it.

Human machine interface? My system runs lights out, hands off.

You can use TD's API with the following instruments - stocks and options are no problem:

"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",


The way I've developed my system, it has a universe of about 1000 stocks to work with, which I've downloaded as a results set from screening in Fidelity's system. The algo can do what it wants with any of them from that point forward. It has complete control over buys and sells. However, I can monitor the current positions, and manually sell if I want. I could also manually buy if I wanted. But my objective was for me not to touch it.

Dream of the logic you would want an automated system to perform if you had the resources to scan data on thousands of stocks in real time. Something you wouldn't possibly be able to do manually. That's where the value is.
njhowie is offline   Reply With Quote
Old 09-01-2021, 07:36 AM   #8
Moderator
sengsational's Avatar
 
Join Date: Oct 2010
Posts: 8,648
Does your algo use any fundamentals, or is it exclusively momentum?
sengsational is offline   Reply With Quote
Old 09-01-2021, 07:40 AM   #9
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by sengsational View Post
Does your algo use any fundamentals, or is it exclusively momentum?

As part of the screening process to get the universe of stocks I feed in to the system (which I do maybe once every few months), I do query on some fundamentals. However, at run time it is solely focusing on technicals/momentum - RSI/MACD.
njhowie is offline   Reply With Quote
Old 09-01-2021, 08:22 AM   #10
Moderator Emeritus
aja8888's Avatar
 
Join Date: Apr 2011
Location: The Woodlands, TX
Posts: 12,921
Kudos to you, njhowie! What you did sounds like fun and some hard work!

I'm too old, slow and not a programmer to do anything like this, but wish I could!

Cheers!
__________________
Everyone has a plan until they get punched in the mouth...philosopher Mike Tyson
aja8888 is offline   Reply With Quote
Personal Algo Trading
Old 09-01-2021, 08:27 AM   #11
Give me a museum and I'll fill it. (Picasso)
Give me a forum ...
 
Join Date: Aug 2004
Location: Laurel, MD
Posts: 6,160
Personal Algo Trading

Yikes! My first reaction was Howieís been hacked!

Seriously it sounds fascinating but I could barely follow the action as observer.
__________________
...with no reasonable expectation for ER, I'm just here auditing the AP class.Retired 8/1/15.
jazz4cash is offline   Reply With Quote
Old 09-01-2021, 08:31 AM   #12
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by jazz4cash View Post
Yikes! My first reaction was Howie’s been hacked!

LOL! You know how conservative I am, so I could see how you'd come to that conclusion. But it's also indicative that you can do this in a low risk fashion.
njhowie is offline   Reply With Quote
Old 09-01-2021, 08:49 AM   #13
Moderator
sengsational's Avatar
 
Join Date: Oct 2010
Posts: 8,648
Is there a book or some other source that one could study to get an idea about how to go about designing something? I could code it, but I wouldn't know where to start from a concept point of view.
sengsational is offline   Reply With Quote
Old 09-01-2021, 08:52 AM   #14
Thinks s/he gets paid by the post
Out-to-Lunch's Avatar
 
Join Date: Jan 2020
Location: Milwaukee
Posts: 1,482
Very interesting.


Are you doing this in a taxable account, or can you do this in a tax-deferred account?
__________________
The closing years of life are like the end of a masquerade party, when the masks are dropped. -Arthur Schopenhauer, philosopher (1788-1860)
Out-to-Lunch is offline   Reply With Quote
Old 09-01-2021, 08:57 AM   #15
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by sengsational View Post
Is there a book or some other source that one could study to get an idea about how to go about designing something? I could code it, but I wouldn't know where to start from a concept point of view.
If you're looking for books, I would start here:
https://www.google.com/search?q=algo...+trading+books

I have not personally used any of them, so can't make a good recommendation. You can also find a fair number of Youtube instructional videos and forums discussing the APIs and how to put together a sample application using it. Play with google and querying with different search terms, you'll find them.

My background was boots on the ground with this stuff, so designing something came naturally.
njhowie is offline   Reply With Quote
Old 09-01-2021, 09:01 AM   #16
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by Out-to-Lunch View Post
Very interesting.


Are you doing this in a taxable account, or can you do this in a tax-deferred account?

Taxable account...2020 was a learning experience in how to do taxes when you have enough transactions that you crash Turbotax.

I don't believe there's any reason why you wouldn't be able to do it with a tax-deferred account.
njhowie is offline   Reply With Quote
Old 09-01-2021, 09:03 AM   #17
Moderator
sengsational's Avatar
 
Join Date: Oct 2010
Posts: 8,648
Quote:
Originally Posted by njhowie View Post
My background was boots on the ground with this stuff, so designing something came naturally.
Ah, there you go! I'm sure if I designed something, being a total noob, it would effectively be putting money from my account into your account, lol! But it's cool that you can leverage your work experience. My work experience is with coding in the manufacturing / logistics as opposed to finance. My hobby coding is to optimize beer delivery and beer drinking! Just added a feature so that the server can bring you a specific beer without you having to even ask for it.
sengsational is offline   Reply With Quote
Old 09-01-2021, 10:31 AM   #18
Thinks s/he gets paid by the post
 
Join Date: Aug 2007
Posts: 1,859
This could be a lot of fun. I might have to give it a shot with a small amount and see what happens.

How bad was tax filing for this account?

One reason I stopped with Robinhood was because they didnít support tax deferred/exempt accounts and it seemed counterproductive to pay taxes while taking on a lot of risk. And I didnít want to deal with the paperwork.

If I decide to try this, Iím going to see if I can use a roth.
__________________
Eat, Drink and Be Merry.
tulak is offline   Reply With Quote
Old 09-01-2021, 11:32 AM   #19
Thinks s/he gets paid by the post
 
Join Date: Mar 2012
Posts: 2,458
Quote:
Originally Posted by tulak View Post
This could be a lot of fun. I might have to give it a shot with a small amount and see what happens.

How bad was tax filing for this account?

One reason I stopped with Robinhood was because they didn’t support tax deferred/exempt accounts and it seemed counterproductive to pay taxes while taking on a lot of risk. And I didn’t want to deal with the paperwork.

If I decide to try this, I’m going to see if I can use a roth.

If you can do it with Roth, then there obviously wouldn't be any tax reporting - easy peasy.

The tax filing wasn't bad at all after I learned how to do it (after Turbotax crashed during download with a message that it wasn't designed to do that many transactions). Though there may be thousands of trades, you can net them all together and put on a single line (one for long term gain/loss and another for short term gain/loss) - so long as there aren't any with special attributes (e.g. wash sale or K-1 reporting) - you can pull it right from the bottom line of your 1099 from the brokerage. For those that do have special attributes you have to individually split those out and report each on its own line, and then net everything else. If you have so many with special attributes that you don't want to even do those individually, you can just net everything together on one line, and then mail a report in your own format which identifies each of the individual transactions and the fields they require (could even be the 1099 from the brokerage) to a special IRS document warehouse address in Austin, TX.
njhowie is offline   Reply With Quote
Old 09-01-2021, 12:24 PM   #20
Recycles dryer sheets
 
Join Date: Jun 2013
Posts: 191
This looks like fun. I have the accounts and cash to get started, and I write code all day at w*rk, often against REST APIs. Any chance you'd open-source your algo howie? lol
HenryD is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saint James Trading / Private Platform Trading pletal FIRE and Money 8 04-15-2019 05:24 AM
Personal Umbrella versus Personal Excess Liability policies ? Linney FIRE and Money 25 11-28-2006 08:06 PM
LEARN- STOCKS & ONLINE TRADING whattolearn FIRE and Money 42 06-23-2005 04:41 PM
Day Trading TK FIRE and Money 19 06-01-2005 07:02 PM
Anyone used marketedge.com for stock trading Paul Other topics 0 11-28-2004 08:00 AM

» Quick Links

 
All times are GMT -6. The time now is 03:17 PM.
 
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2021, vBulletin Solutions, Inc.