Ultimate List of Automated Trading Strategies You Should Know — Part 2

Alpaca
Automation Generation
7 min readNov 13, 2018
Photo by Olga Bast on Unsplash

This is the part 2 of a series “Ultimate List of Automated Trading Strategy Types.” Check out the part 1 for (1) Time-Series Momentum/Mean Reversion, (2) Cross-Sectional Momentum/Mean Reversion, (3) Dollar Cost Averaging, (4) Market Making, and (5) Day Trading Automation.

(6) News/Event-Driven Trading

Background

Trump says something about Amazon, and the company’s share price drops. The FDA publishes an approval for an outstanding generic application, and one biotech company’s share price jumps up. Elon Musk tweets about taking Tesla private, and the Tesla stock quickly trades higher.

News can cause significant changes in a stock price, but it’s challenging to (a) identify such events and to (b) take the right actions as soon as they happen.

Possible Approach

For (a), it’s the era of data, and you can get historical news and tweets from several sources, and identify keywords or particular events that may have led to a material price movement. Machine learning, or more specifically natural language processing, might solve some of the problems here, too.

For (b), again, it may not make sense for you to keep monitoring Twitter, StockTwits, Bloomberg or Y! Finance and react to the news with a manual trade. Rather, with Alpaca Trading API, you can automate this if-then-that process into something that continuously scans for news or events and reacts accordingly.

For Implementation

All you need here is a news and/or Twitter feed, which you can constantly monitor for new actionable events. Twitter and StockTwits both provide APIs for personal use as well. Some cloud environment such as Amazon Lambda may be a good solution for this too.

Trigger Finance’s (now part of Circle) Trump Trigger:

(7) Using Machine Learning

Background

The evolution of AI and machine learning technology is also changing the landscape of algo trading.

While institutions have been doing massive experiments using terabytes of data and GPU clusters, due to the nature of secrecy in the industry, public discussion and research have often been limited to simple price predictions with bare minimal LSTM or ARIMA models.

Use Cases

But the power of ML allows the practitioner to find the optimal signal among a set of rules with varying parameters. Without ML, a trader might develop a rules-based system that is too inflexible to changing market conditions. Or a trader’s mechanical system might have suboptimal feature parameters that do not effectively capture the feature’s predictive value.

For example, ML can be used to choose the dynamic parameters of indicators like MACD for developing an exit strategy based on the context and other factors.

The application of machine learning in trading isn’t just for analyzing price data. Lots of new hedge funds are making use of satellite images to add fundamental information for better investment decisions. Natural language processing is another.

Data-driven trading is improving a lot with machine learning today. It is not just a coincidence that we at Alpaca are also seeing great interest among users for ML-based trading strategies.

For Implementation

You will certainly need a good set of tools such as scikit-learn and tensorflow, in addition to good data sources, and possibly may benefit from computer resources such as a GPU to build your trained model.

On the other hand, you may need less or even no market knowledge. Deep learning or the use of multi-layered neural nets has become possible to do even with a consumer laptop, and often it can be difficult for the practitioner to understand the logic behind the decisions generated from a deep learning model. Generally, it’s probably going to be helpful to have domain knowledge, no matter what industry you apply ML to, as ML and deep learning are by no means a silver bullet.

A public python notebook about stock prediction using LSTM:

(8) Exchange Arbitrage (N/A for Alpaca)

What It Is

The idea of exchange arbitrage is simple — you want to capture the price differences that occur when a certain fungible asset trades on more than one venue.

In Reality

This is not particularly applicable to the U.S. equities today as the markets are incredibly efficient. Rather, there still exist opportunities for individuals to engage in cryptocurrency exchange arbitrage, but even these are rapidly disappearing and involve other operational and counterparty risks not seen in U.S. stocks.

While exchange arbitrage sounds promising, it is not risk-free nor is it riskless and you should be aware of and consider all operational, technical, and legal issues that can arise. That said, exchange arbitrage is well understood and mechanical and hence much more suitable for automation.

Again, the US equity market is very efficient today, and regulations prohibit locked or crossed markets, so opportunities are extremely rare and short-lived. Further, Alpaca currently does not offer direct market access at this moment.

Great overview of crypto exchange arbitrage:

(9) Portfolio Rebalancing

Background

As the old saying goes, you may not want to put all your eggs into one basket. By diversifying your investment into multiple different assets, you can distribute risk, and your entire portfolio value can be more efficient in terms of the risk/return profile. It all sounds good, and this is what you can expect to hear from your financial advisors and asset managers. It’s based on the simple mathematics as follows:

What we are talking about here is maximizing the return while keeping the risk (volatility) at the lowest possible point for the expected return.

In Reality

You can do research on the expected risk/return by looking into the historical data for each stock so that you can construct the portfolio from scratch.

Great. Now, you need to actually buy those stocks to make this happen, but what if we are talking about 50 different names? It’s error-prone and time-consuming to do it manually. OK, let’s say you managed to do so once, now time flies and weeks or months later, some stocks moved a lot more than the others, and risk profile of your portfolio might have been changed. You now need to do the calculation again and find out the optimal portfolio structure, then buy and sell stocks resulted by the calculation!

For Implementation

You may notice that this is all about numbers and pretty mechanical from a risk/return calculation to placing orders. This is a part of the reasons why there are now many Robo Advisors, which automated this work to charge fees for advisory and asset management.

With Alpaca’s commission-free REST trading API, there is nothing that prevents you from doing it yourself. You can even do it by using a Google Spreadsheet now.

Ref. some medium article about Modern Portfolio Theory:

(10) ETF/Index Arbitrage

Background

While there are many exotic ETFs that hold complicated structured products such as swaps and options, some ETFs are purely baskets of individual stocks.

Since an Index ETF and a basket of their underlying holdings are fundamentally the same things, there exist price arbitrage opportunities when the ETF price dislocates from the basket price.

In Reality

Super active ETFs like SPY (which tracks the S&P 500 Index) likely have no chance for individuals to take such arbitrage opportunities, but for some of the less liquid ETFs, individuals may have an opportunity. Any arbitrage opportunities are very short-lived, and again you need to keep monitoring the market activities to locate them.

Once you detect an opportunity, you may want to get in before it disappears. It would be likely to last somewhere between a few seconds to minutes. While a latency should not be a major issue here, it’s still not suitable to be manually traded either.

To Be Continued…

This is part 2 of 3 posts to overview the various types of automated trading strategies. Stay tuned for the final post to cover more.

Technology and services are offered by AlpacaDB, Inc. Brokerage services are provided by Alpaca Securities LLC (alpaca.markets), member FINRA/SIPC. Alpaca Securities LLC is a wholly-owned subsidiary of AlpacaDB, Inc.

You can find us @AlpacaHQ, if you use twitter.

Follow Automation Generation, a Medium’s publication created for developers/makers in trading and fintech.

--

--

Alpaca
Automation Generation

$0 commission API stock brokerage. Join us 🌟 https://alpaca.markets *Securities by Alpaca Securities LLC alpaca.markets/#disclosures