I have this crazy plan to create an algorithm that’ll automatically buy and sell stocks at times of the biggest opportunity. Winners every time. I know, my goals are small, are they? They don’t call it a magic stock picking machine for nothing!
I’ve written out my goal: My goal is to buy stock in quality companies whose stock price has dropped at least 5% in two days or less and then sell it within 30 days.
…at least that’s the model I’m starting with. How will this hold up to testing? Once we know that we have a goal that is workable, I can focus my attention to tweaking this goal and then create an algorithm flow chart to put the plan into action.
Let’s start on that “5% over two days” entry point. As my friend Done By 40 mentioned in the comments of our post last week, I’m not sure this is an accurate percentage to start at (since I picked it out of the air), so a little test can easily clean that up.
Testing is where the rubber meets the road with theories. If you’re buying a mutual fund for the first time, start tracking it’s progress at sites like Morningstar.com. With testing, you’ll become a better investor no matter how complicated your strategy may be.
Let’s look at some of my past opportunities to see how I would have fared.
British Petroleum (BP)
First, let’s explore BP after the oil spill. I did well on this stock initially but held it too long:
This chart comes from BigCharts.com. Here’s a quick plug: even when I was a financial advisor and had some awesome tools at my disposal, I loved this site for it’s user-friendly charts and historical data. When I had to look up past prices of stocks for clients, this was always my first choice. (BigCharts, if you’d like to sponsor this site, please send emails to joe (at) stacking benjamins (dot) com!)
To get to the oil spill I pulled up the 5 year chart. Guess when the spill happened? Ha! Hard to notice that stock price drop or the increase in volume, isn’t it?
Had my “5% rule” been in play, I would have purchased shares of BP at roughly $57 per share. I would have purchased again around $49 per share. I would have purchased a third time for around $29 per share. Of these trades, only one would now be profitable.
Interestingly, had this rule been in effect, I would have also purchased midway through 2011 at around $42.50. Plenty of evidence already that the 5% rule wouldn’t have been my buddy.
Bank of America (BAC)
I also have done very well in this stock, buying when the price was severely depressed.
I don’t think we need to go into as much detail here because you can see the same issue. I would have purchased several times on the way down in late 2008 and the results would have been horrible. There was also an opportunity in mid-2011 that would ultimately have been profitable, but it wouldn’t have made up for the huge losses this formula would have produced in 2008-2009.
This chart also reiterates how important that “sell” criteria will be.
Finally, let’s look at something a little closer to now:
Carnival Cruise Lines (CCL)
I purchased shares of CCL when the ship limped into shore without power earlier this year. Here is the chart:
I know this chart appears to feature a stock price that jumps around far more than the other two above, but check out the time frame. This is a YTD chart instead of a 5 year piece. Assuming the same set of goals, my purchase of this stock would have hit at around $34. Then I would have purchased more at around $32.30. In this case, had I purchased at those times I would have been profitable. The drop in February looks significant, but the biggest loss days were only around 3% per day. If we’d expanded the algorithm to purchase based on a 5% drop over multiple days we would have found ourselves stuck with a loss.
So Far What Do We Know
Clearly, the 5% rule I’d laid out doesn’t work. In each of these stocks I would have lost my ass with automatic trading.
So our algorithm that stated
a) Find great company (need to be defined)
b) Stock price falls 5% over two days or less
c) Purchase stock (amount and restrictions need to be defined)
d) Hold until (needs to be defined)
…definitely, among many other things, needs a new “b” rule.
Rather than try to scour my brain for the perfect solution, let’s just let fly some easy options that might lead us to the best course of action. Here are my initial thoughts:
– What would happen if we didn’t purchase until the chart showed some upswing first?
– What if the stock had to fall 5% AND there had to be some thoughts around volume. Maybe we don’t buy until volume reduces to a reasonable level….maybe only 120% of “normal” trading activity.
– Are there any fundamental factors or other barriers that we could study which would give us a better trigger than just the stock price decline….for example: what if we said Stock price declines until PE ratio declines to “x” or “declines BY x.”
I love this approach. By writing out these options I can now attack them individually, fully knowing that if there is some truth, it’ll probably exist inside a combination of these options OR within an option I wouldn’t have considered if I’d just “thought about it” in my head.
On Carnival, here’s the historical data. I’m going to take the difference between open and close to determine how much headway the stock made that day:
Feb 13th – 3%
Feb 14th + .9%
Feb 15th – .7%
Feb 19th (next open day) – .4%
Feb 20th – 2.4% (we’ve now reached our trigger of 5%, IF we change the 5% from “over 2 days or less” to instead assume that we have some trigger that adds stocks to the top of our “funnel” once they hit a 2.5 or 3% drop in a single day, rather than 5% in a day, that might also help our cause. Let’s check this out, also.) Closing Price = 35.43
Feb 21 +.5% Here’s our upswing day. = $35.36 …. with our new test, this is our “buy” day
Feb 22 + 1.1%
Feb 25 – 1.5%
Feb 26 – .3%
Feb 27 + 1.8%
Feb 28 + .4%
Mar 1 + .7%
March 4 + .7%
On March 5 – .2%
On March 6 – .3% Closing Price = 36.14
March 7 + .5%
March 8 – 1.5% Closing Price = 35.67
Let’s check out two initial “sell” strategies.
If we decide to sell after two consecutive down days, we would have yielded a decent return. If we waited for a -1% or more downturn first, we would have greatly cut into that return.
Verdict? Let’s Tweak our Theory:
If we modified the algorithm to:
Find quality stock (determine)
Stock watch triggers when more than 2.5% drop
IF stock loses 5% in next 5 trading sessions, BUY
Then SELL when there are two successive decline days
We would have scored a 2.2% gain in 10 days. While this seems like a lot of work for 2%, remember that this is an automatic program AND if this wins 5 times a year we’ve equaled the long term results of the S&P 500 without much hassle and in 50 days. Not bad….but still not worth the work yet. Trading costs would also eat into this return, but we’ll deal with that once we’re closer to a strategy that has some promise.
We might have some promise with this test. Let’s look at later declines in the stock price to test the new theory we’ve developed.
Back to the CCL chart. I’ll place it here for easier following:
Wow, check out this decline on 3/15 (only 7 days later). Let’s look at open/close on each day again….
Houston, we have a problem. In this case CCL would NOT have triggered a “watch” again, even though our chart shows another clear opportunity:
Check this out. See the lines on the chart? The little nub on the left side represents the “open” of the stock and the num on the right side of each line represents the “close.” All of the damage in this stock over the next three downturns happen after hours. All of my analysis above is open/close.
I really needed to be evaluating previous close to current close to catch all of these opportunities.
Ouch. Sigh. Feels like time wasted.
Oh, but it isn’t, Stackers. It definitely isn’t wasted time.
What can we learn from this?
First, check out the research I’m doing before engaging in something unfamiliar. When you decide to invest, do your homework! All that we’ve found out so far is that most of my preconceived ideas are wrong! However, there’s definitely light at the end of this tunnel. By playing this game we’re learning more about technical data, an area that I haven’t paid much attention to in the past. Technical data, for those of you new to investing, is charts and graphs….how the stock price moves. Fundamental data (the stats that I pay far more attention to….and with good reason) revolves around the performance of the company….how much they earn, how much they profit, how they conduct operations. We’ll use fundamentals to choose good companies.
Second, while we haven’t yet invested, this type of research helps me gain more comfort about the company. If I do invest, I’ll know that Carnival Cruise Lines is a pretty volatile stock.
Your thoughts on our progress? Hit me up in the comments.