How to Build an Automated Stock Trading Strategy (2022)

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email
Share on whatsapp

Index

Sign up to the Aikido Newsletter

“The best trading strategy is the strategy you can stick with through thick and thin”

Gary W. – Behavioral Finance and Investing: Are you Trying Too Hard?

I’m a quant fanatic, I truly believe (and evidence backs me) that relying on data to make your decisions in every aspect of life is the best way forward and will yield the best results. Quantifying your trading strategy not only improves investment returns, but it also helps drastically decrease stress and the amount of time you spend thinking about your investments. I’m Shane, Quant investor, and lifestyle designer and this is Aikido Finance!

The optimal trading strategy provides higher than average returns at lower than average risk. A trading strategy is a finite set of rules that are used to quantify a trader’s investing. Following a structured systematic approach when trading improves returns, reduces stress, lowers risk, and makes the trader less likely to panic sell or act on emotions. For example, the rules-based Top Quality High Momentum Strategy has backtested returns of 17.6% per year over the past two decades.

Quantitative investing is the search for above-average returns using data.

Automating your investing further removes emotions and improves returns. Indeed, 97% of people opted for Joel Greenblatt’s ‘just do it for me’ button when he released The Magic Formula. He found that the performance of these individuals were drastically better than those who wanted to follow the strategy manually.

Stock Picking doesn’t work

CXO tracked the results of 6,582 predictions from 68 investing gurus, made between 1998 and 2012. Despite having some well-known names in the sample, the average of the gurus’ accuracy (47%) didn’t beat a coin toss. 42 gurus had accuracy scores below 50%.

“The investor’s chief problem – and even their worst enemy is likely to be them self”

Ben Graham

So what can we take from all this?

Systematise your trading strategy. Stick ruthlessly to a set of rules / parameters that you follow – the algorithm. Then, automate the entire process; hand off the wheel, let the computer do the work.

Automate your trading strategy.

How to Build a Stock Trading Strategy

There is a 8 step process to building a trading strategy. Before we hop in, I should point out that pre-built automated trading strategies can be found here. But if you would like to build your own, here’s how:

8 Steps to build a trading strategy:

  1. Determine your amount to invest
  2. Choose your Market(s)
  3. Choose you Industries
  4. Choose you Market Capitalization (What size of companies go into the portfolio)
  5. Apply Filters
  6. Rank the Stocks
  7. Pick & Purchase Stocks
  8. Determine rebalancing

Once you have followed the 8 steps, you will have successfully created an AWESOME stock trading strategy. You will have created an investment thesis.

Step 1. Determine the Initial Amount to Invest

Eg. $10,000

Though, before you start you should consider the following:

  • Have a six month emergency cash pile
  • Pay off high interest debt first
  • Eliminate your worst spending habits
  • Think about your time horizon
  • Max out your pension contributions

Step 2. Choose Your Markets

Eg. USA only

There are a few things to consider here. If diversification is your goal, you might want to reduce home-country bias and invest across the globe. One way to do this could be to use a well-known all-world ETF as your universe. It is worth noting that emerging markets have tended to yield higher returns historically. The problem, is that the financial data may not be as accurate for the screening process that comes in the next few steps.

The most common options for markets are:

  1. US
  2. Europe
  3. Emerging Markets

Note: Australia is also a large investment market to be considered.

Here are some points to consider when trading strategies across geographies.

Step 3. Choose Your Industries

Eg. Impact Exclusion

Oftentimes you will not filter out or focus on specific industries. However, if you seek to invest with an impact (Environment / Ethical), this is one technique you can use. Check out this article for a list of industries you could exclude as well as a range of other quantitative impact filters.

Step 4. Choose Company Size

Eg. Microcap ($50M-$200M)

Here is the list of all Market caps to choose from:

  • Nano-cap (<$50M)
  • Micro-cap (<$300M)
  • Small-cap (<$2B)
  • Mid-cap (<$10B)
  • Large-cap (<$200B)
  • Mega-cap (>$200B)

As a general rule of thumb, smaller companies yield higher returns but exhibit higher volatility. The lion’s share of outperformance comes from <$25M market cap

Step 5. Apply Filters

Eg. Price-to-Sales < 1 and Positive 3 & 6-month Price Momentum

There are an abundance of filters to choose from. Broadly speaking there are 3 classes of filters: Fundamental (eg. Value), Technical (eg. Momentum), Alternative (eg. Quality of Management).

A full list of nearly all possible filters can be found in The Ultimate Investing Cheatsheet.

This is the funnest and most technical part of the process. This is what people think of when they hear ‘trading strategy’.

Ways to filter:

  • Static values – eg. Price-to-Earnings is < 15
  • Dynamic Values – eg. Price-to-Earnings is in the cheapest 10% of the universe/industry.

Dynamic values are slightly more effective, though harder to implement for the everyday investor.

Step 6. Rank the Filtered Stocks

Eg. Rank by 1-Year Price Momentum

Choose another metric from the list and rank the remaining stocks by it. This has now given order amongst entropy.

Step 7. Pick & Purchase the Stocks

Eg. Pick the top 25 stocks

The most common number of stocks to choose here are 10, 25, or 50.

Divide your amount to invest equally over the stocks you wish to invest in. eg. 250$ in each stock. Then go to your broker and purchase the stocks. I recommend Interactive Brokers as it allows you to integrate with Aikido Finance and automate your trading strategy.

Backtested performance of the stock trading strategy outlined above

Step 8. How to Rebalance a Stock Trading Strategy

In order to keep your portfolio up to date, you will need to buy and sell some stocks each month (this can alternatively be done each year).

So, how do you rebalance?

  1. Choose a monthly contribution amount (you will add this extra contribution to the portfolio)
  2. Run the filters again to get the new list of companies
  3. Compare the new list of companies to the companies currently in your portfolio
    a. Sell companies/shares that have exited the list
    b. Buy companies/shares that have entered the list

How to Automate a Stock Trading Strategy

There are tiers to just how automated and technical you want to get.

The Manual Way:

Follow the steps above to the best of your ability using a screener like FinViz. Then purchase the stocks that appear manually in your broker.

The Technical Way:

Code your own strategy using a algo-trading platform like Quantconnect. Coding + Financial knowledge required, but very powerful. Only a restricted set of US stocks available.

The Easy Way:

Use the no-code stock trading strategies available at Aikido Finance. Integrate your broker and create a quant portfolio in less than 5 minutes.

Conclusion

As I have outlined above, building a stock trading strategy is not difficult! Indeed, it is manageable even by novice investors when using automated trading platforms like Aikido. If you want to read a little more about why I’m such quant finatic check out this article. I will show you the power of using a rules-based trading strategy.

How are you automating your investing? Let me know in the comments below!

Until next time,

Take it easy.

Shane

More To Explore

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email
Share on whatsapp
Sign up to Aikido Newsletter