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

Alpaca
Automation Generation
6 min readNov 16, 2018
Photo by Charlie Hammond on Unsplash

This is the part 3 and the last one of the 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, (5) Day Trading Automation, and the part 2 for (6) News/Event-Driven Trading, (7) Using Machine Learning, (8) Exchange Arbitrage (N/A for Alpaca), (9) Portfolio Rebalancing, and (10) ETF/Index Arbitrage.

(11) Market/Social Sentiment Strategy

Background

It is a great era that such exotic data like social sentiment time series data is available for our personal use. It is similar to the news/event-driven strategy, but social sentiment can target a longer timeframe and can incorporate several different news as well as sentiment sources.

Anecdotally, we’ve seen the traders' sentiment turn negative right before the price starts rising, which is, in a way, very opposite to one’s intuition.

The great thing about making a use of data is that you can do the research and analysis to uncover patterns which may be very counterintuitive.

Where to get the data

StockTwits tracks bulls and bears among internet users for each stock name, and there is also more aggregated data such as the bull-bear ratio published by Investment Intelligence.

For this strategy to work, it may make sense to develop a model that scores sentiment and associates the score with future returns at various time-horizons. The algorithm itself may not be that computational heavy or latency sensitive because the strategy’s time horizon tends to be longer. Also, most likely you can prototype something lightweight using Python Jupyter Notebook.

Bull-bear ratio chart from YChart:

(12) Pairs/Long-Short

Background

A stock price moves up and down, no matter how strong the company’s financials are. Part of the reason for this is that no single stock is completely uncorrelated to the broader market movements or the movements of the sector and industry peers.

What it is

A long-short or market neutral strategy lowers a portfolio’s beta and focuses on capturing alpha, or excess returns, from the company-specific risk, that you take by being long or short the stock.

Some long-short strategies are based solely on fundamental analysis, while others are entirely quantitative and focus on statistical arbitrage.

For example

An example is this: you think that American Airlines is doing a better job than the rest of the airline sector. You buy AAL but also are concerned that the airline sector itself may go down, so you short an equal dollar amount of another airline stock that you do not like as much, for example, DAL (Delta Airlines). If the whole airline sector goes down, you profit from the DAL short position, while of course, you have some loss from AAL long position.

But if at the end of the day American performs better than Delta, you can profit from this pair no matter how the whole sector moves. The same thing can be done across sectors or asset classes over any time horizon.

Almost all assets have some degree of correlation, so whether you choose to focus on differences in the quality of companies’ fundamentals, or you just want to trade the correlation or cointegration of a pair or basket, you could apply a long-short strategy thought process.

For implementation

As you can see, in order to achieve this strategy, you may need to perform some statistical analysis. Consider using python’s statistics packages or R, along with research environment tools such as Jupyter Notebook. It takes work but if you can get it right, it works well.

There are many asset managers, quantitative and fundamental, long-term and short-term, who are trading long-short strategies today.

While Alpaca does not support short selling yet, it is on the roadmap. In the meantime, you can also make a quasi-short position using inverse ETFs in some cases.

Quantopian example code for long-short:

(13) HFT (High-Frequency Trading)

Background

The notion of HFT is very broad. The name just refers to the time horizon of trading strategies and does not mean much in terms of actual trading concepts. For example, some call minute-level trading as HFT, while others disagree and would not even call second-level trading as HFT.

In the US equity market, the battlefield of HFT can be in the microseconds (1/10^6 of a second) or nanoseconds (1/10^9 of a second, and opportunities disappear very quickly unless you are the very first to the market. In his famous book Flash Boys, Michael Lewis talks a lot about the hard wire (fiber), but as of today, HFT firms are utilizing microwaves since they can go straight at the minimum distance to the destination. Yes, that’s right, the real-life rocket science.

For individuals traders

The good news is that their battlefield is far away from any of the strategies we talk about here, and individual traders do not need to worry much about this.

As you can imagine, minute-level trading doesn’t affect long-term investors, and HFT does not have much impact on mid-frequency traders or longer time horizon base.

An interesting reddit post about microwave in HFT:

(14) Order Slicing (N/A for Alpaca)

Background

When you start talking about “algo trading”, many “industry” people start thinking about order slicing first.

Order slicing or order execution algorithm refers to a computer logic that executes large block orders in small pieces to try to minimize market impact and information leakage. Execution transaction costs are especially important to large asset managers, because they may suffer from significant return deterioration when trying to enter or exit a large position.

Smart order routing, which executes orders piece by piece, can reduce information leakage and can prevent others from panicking or front-running the large block order.

For individual traders

This is all about the large positions dealt by institutions and may not be applicable to individual traders. However, we wanted to mention this here because this is one of the oldest and most well-known areas of algorithmic trading and is something that many “industry” people think of when hearing the term “algo” or “algo trading.”

It’s a bit old, but this TED talk is quite helpfulto understand this:

(15) Synthetic Options Strategy (N/A for Alpaca)

Background

Not strictly algorithmic trading, but synthetic options strategies can benefit significantly from automation and the use of trading API.

The simplest and well-known method is to buy an in-the-money call and sell an in-the-money put with the same expiration for the same size, which makes a position that has the same profile as an underlying long position at a much lower cost. While it sounds easy, it can be tricky to determine the best combination of call and put options to use, and it requires tracking the full chains and calculating values for each option in the chain. But once you build your own model, it’s a matter of seconds to come up with the answer.

Options trading in the automated trading space can be much more diverse and interesting than just long or short trading of individual stocks, as you can build structures such as covered calls.

Please note that Alpaca Trading API currently does not support options, but it is on the roadmap.

More detailed explanation about synthetic long position:

Conclusion

This series composes a list of different styles in automated trading at a very high level. For us to write up a broad overview, some descriptions may have ended up to be vague and may need more details. We hope that this series gives you preliminary ideas on the automated trading space.

If you liked this blog post, please give out claps, follow Automation Generation & Alpaca, and share it! Also, please do not forget to sign up for Alpaca Trading API today!

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.

--

--

Alpaca
Automation Generation

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