Conservative Automated Trading Test #1

Posted on Monday, September 14th, 2009

ok so I’m going to post my experience with auto trading here so that anyone else who want’s to try it can benefit from my experience.  If you saw my earlier post you know I made a stock calculator that calculated what my minimum sale price for a stock needed to be to make money.  For me this meant I had to cover commission fees, the main difference in my calculator is that it was based on the amount you wanted to put in, so I could put in $1000 and it would tell me how many shares I can buy as well.

This all lead to the concept of automated trading.  I’ve known about computer automated trading for a while and the concept of system trading.  The problem a novice like me has with it is that you can lose a bunch if you don’t do it right mainly because of commission fees.  The more you have in a position the less this is a problem but for me with $1000 at a time commissions are 2% or $19.98 so I have to make 4% for to make 2% myself, which as you can see is a good deal for my brokerage.

So I then hear on NPR  that 35% of all trades in the stock market are done solely by computer.  It’s easy to imagine if you are managing a ton of money that you can develop a computer program to buy when certian things happen and sell when another thing happens, and since it’s a computer it can watch and wait all day everyday for those conditions to arise, and when it does it executes and makes you some money.  When dealing with sums of $10k and above that may be a price increase of .2% even less when you consider they are probably not paying 9.99 a trade like I am on both ends = 19.98 per cycle.

So I wanted to see if I could have a piece of that action.  I’ve been playing with stocks for a few months and my brokerage tdameritrade.com actually gives you software that you can program and let it run semi or fully automated.  If that doesn’t blow you away, it should, as software that does this usually costs in the $3,500.00 range.

So I figured I’d make an ultra conservative formula first.  And since I don’t like to loose, I only will program a winning exit, figuring I’ll pick stocks that I wouldn’t mind holding on to for a while if they went down in value.  I found an indicator that took various snapshots of the moving average that the program called ultimate oscillator, when it fell below 35 and came back across 35 I would buy which is very common practice in stock trading (buying when oversold).  The kicker is that I am  going to sell as soon as it gains 4% from my entry price no matter what and not a penny higher, unless of course the open was higher than the previous day than 9:30 the next day, than that would be the first time I could buy which would only make the payoff better.

So I decided to find low cap high volume stocks with high percentage gains and losses so I can see this work quickly. I did it with ETFC or E-Trade financial.  I thought they were going to go up from their 1.60’s anyway since I thought their stock was unfairly depressed.  I plugged in the formula and this is how it went.

Symbol Date Time Action Price Profit-Loss
etfc

8/31/2009

11:27:00

Buy

1.75

0

etfc

8/31/2009

12:57:00

Sell

1.82

19.99

etfc

8/31/2009

15:30:00

Buy

1.74

0

etfc

9/14/2009

15:24:00

Sell

1.81

20.2

So within 15 days, it was able to perform two round trip cycles of 2% gains every time after commissions were taken out.  The beauty about this is that I didn’t have to get up at 6 am to watch the stock market for 15 days straight, I just set the computer going and it did everything. 

Here is the part that was new to me and takes getting used to, the stock after that last buy on the 31st went sharply down into the 1.50’s.  I had to just watch and wait, knowing that that also happened when I tested the system over historical prices.  I just had to wait and forget about it and the computer will do it’s thing when the time is right, had I sold emotionally I would of lost way more than the gain was from the first sale.  So today for a brief moment ETFC hit $1.82 and the computer sold my shares completing two round trips.  Without automated trading I would have to be watching the stock price the entire day and still could have missed the 5 min or so window to sell.  I’m going to include some snapshots from strategydesk,

etfc_aug_28

 etfc_sept_14 

So I think the test wen’t well, I think in the future I will only go one round trip with one stock at a time until I have a dedicated machine for the job.  But the amazing thing to me is the consistency of backtesting, 4% in 15 days, or let’s just say 4% every 4 months, that’s still better than madoff promised his clients for returns.

And as  a programmer and not a daytrading stock guru, this is so much easier than having to keep up with day to day trends.

Categorized as Stock Trading