I Tried Front-Running Stocks From Home

A data-backed trading strategy analysis with interesting revelations.

Quant Galore
DataDrivenInvestor

--

Year after year, we see headlines of high-frequency trading firms notching record profits. So naturally, I wanted to see if I could replicate some of that action for myself.

Photo by Austin Distel on Unsplash

Background

This strategy assumes that on a micro/milli-second basis, there is a lag in the order flow of similar stocks. The baseline logic is that if Stock A gets 500 bidders at 9:30:00:01, then a correlated stock — Stock B, will receive a similar amount of bidders at 9:30:00:02 (hour:minute:second:millisecond).

This assumption comes from the idea that while the chosen stocks move from the same information, there is a lag in the time it takes to put on trades. This lag comes from the long pipeline of traders who are reacting to that same information(in order):

  1. Market Makers / Exchange Members
  2. Algorithmic Funds / Traders
  3. Manual Institutions
  4. Retail Traders

In theory, if you are milliseconds faster than at least retail traders, you can get your bid filled, then immediately sell the shares at a higher price to the slower trader (in the example, assume Stock A went up as a result of the 500 bidders, and as a result Stock B also increased thereafter).

Setup

To test this, I chose two of the most correlated stocks: Coca-Cola and Pepsi-Co. For data, I used free historical quote data from Alpaca. Syncing millisecond data can get tricky, so I created OHLC second-bars instead. To get the bids and asks, I took a rolling sum of all sizes at the available millisecond.

Excel for Demonstrative Purposes Only; Pandas Python package was used.

Then, I shifted the data so that we can see the relationship between what the first stock did compared to the second stock 1 second later. As you can see from above, Stock 1 (Coca-Cola) has a lot more volume, so I later divided it by 10 so that it scales better.

Findings

Data For Trading Day of 01/13/2022, 1-second

There doesn’t seem to be the strongest relationship, let’s try zooming in:

Data For Trading Day of 01/13/2022, 1-second

Even still, it looks like there isn’t much edge here. But why?

Theory

Going back to the image of the timestamps and quotes, you may have noticed that often the bid sizes increase and decrease in tandem, without lag. We can safely eliminate the idea that such coordinated movement is from retail traders or even hedge funds. It is most probable that this is due to activity in the ETF redemption process. See here for more info on the ETF redemption mechanism.

ETFs often have pre-determined weights for their fund, and when it gets calls for redemptions (i.e., someone selling the ETF), they have to sell the holdings in exactly the same proportions as their weights, at exactly the same time. It goes the same way vice-versa for creations (i.e., someone buying the ETF). So, rather than many traders reacting to information at different times, it is more likely just 4–5 ETFs reacting to the same information at once.

That arbitrage/opportunity is primarily only available to Authorized Participants (APs); the main four of which are: Bank of America (BAC), JPMorgan Chase (JPM), Goldman Sachs (GS), and Morgan Stanley (MS).

So, for now at least, it looks like you might need a bit more to successfully front-run markets from home.

Final Thoughts

To end on a positive note, this was just the initial starting point of building a strategy. I found quite a few interesting relationships, and will be making updates as I flesh it out into a deployable system. To give a hint, if the no-lag is due to ETF purchases, what about correlated stocks that aren’t held by ETFs, what about ETNs, perhaps retail favorites?

If this piqued your interest and you’d like to read more like it, head over to The Quant’s Playbook where I do deep dives into actionable market exploits and opportunities.

Happy trading!

Subscribe to DDIntel Here.

Visit our website here: https://www.datadriveninvestor.com

Join our network here: https://datadriveninvestor.com/collaborate

--

--

Finance, Math, and Code. Why settle for less? @ The Quant's Playbook on Substack