Use Machine Learning to Forecast the Stock Market

Just recently, I was reading an article that described the tremendous success of a particular treatment in combating the Methicillin-resistant Staphylococcus aureus (MRSAsuperbug. If you haven't heard of MRSA directly, it is likely you've heard something about current concerns that we are headed toward a time when our antibiotics will no longer be effective. This is largely an inevitable phenomenon that occurs because some bugs in the population are genetically more resistant to the relevant drug. When bugs that are susceptible to the drug are wiped out during treatment, the remaining drug-resistant bugs then reproduce and become the dominant variant in the population. To combat this, scientists are constantly pushing the boundaries of science to find new ways to combat these bugs.

In biology, this situation is called a Red Queen's race: the term comes from a quote in Lewis Carol's Through the Looking Glass:

"Now, here, you see, it takes all the running you can do, to keep in the same place."

This effectively describes the situation we're in with antibiotics, but perhaps the answer is not to be found in moving on to new, ever-more advanced drugs. Perhaps the answer might be found in understanding the larger cycle at play and using it to our advantage.

That new treatment for MRSA I was discussing earlier? That was actually from a 10th century book of medical potions called Bald's Leechbook. Among the listed ingredients were garlic, wine, and onions. This combination was found to have surpassed the results for our current treatment-of-last-resort, vancomycin.

But what does any of this have to do with forecasting the stock market? I would like to suggest that the very same phenomenon is at play in both scenarios. For example, every so often, a paper is published that alerts the financial world to the existence of a phenomenon that is a profitable anomaly. Most likely, this phenomenon is the downstream effect of some externally imposed, real-world constraint.

Take, for example, year-end tax loss sales. Because of the nature of tax laws, it makes sense for traders to sell their losses at the end of the year. This imposes downward price pressure on losing stocks toward year end. The falling prices then mean the stocks can be discounted beyond their fair value. This also means that, in January, the downward pressure is gone, replaced by upward pressure as new money is put to work in these undervalued assets. But once that phenomenon has been broadcast, it only makes sense for traders to attempt to get ahead of it and begin buying those stocks in late December and selling to those other traders who are expected to be buyers in January. These new traders, by entering the market, have now diluted the effect. They are relieving the year-end selling pressure and decreasing the January buying pressure. The effect is essentially arbitraged away right along with the profitability. What once worked no longer works and traders will begin to abandon the strategy and move on to the next new thing.

By now, I hope you are beginning to see the parallels. It is likely that the garlic, wine, and onions combination was once a very effective cure for bacterial infections that gradually lost its effectiveness as the bacteria adapted. Having been abandoned long ago as a cure, the bacteria had no reason to avoid the original genes that made them susceptible to this treatment. There are real-world constraints that make it nearly inevitable that these types of cycles will occur—both in living organisms and in markets. The key is to use this to our advantage.

In this chapter, we'll spend some time discussing how to build and test a trading strategy. We'll spend even more time, however, on how not to do it. There are countless pitfalls to avoid when trying to devise you own system, and it is nearly an impossible task, but it can be a lot of fun, and sometimes it can even be profitable. With that said, don't do dumb things such as risking money you can't afford to lose.

If you do decide to use anything you learned here to trade, you're on your own. This shouldn't be deemed investment advice of any kind, and I accept no responsibility for your actions.

In this chapter, we will cover the following topics:

  • Types of market analysis
  • What does research tell us about the stock market?
  • How to develop a trading system

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset