Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Analysis of minute bar trading volumes of the ETFs SPY & SH

Title: Analysis of minute bar trading volumes of the ETFs SPY & SH
Author: Grant Kiehne
Abstract:
SPY is an S&P 500 ETF, and SH is a -1X (inverse) S&P 500 ETF, thus both ETFs track a common index. Their relative trading volumes may have a relationship that could be exploited in a trading algorithm. The analysis is presented as a heatmap of the difference in the z-score normalized trading volumes over a rolling 390 minute trailing window. The horizontal and vertical axes are daily trading minute and trading day, respectively; each row represents a trading day and each column a trading minute. Visualization of the heatmap provides a means to discern patterns and anomalies of potential utility in developing a trading algorithm.
Quantopian username: Grant Kiehne
Filename: heatmap example v01
References:
https://www.quantopian.com/posts/research-platform-how-to-get-a-nice-heatmap
https://www.quantopian.com/posts/messing-around-with-spy-vs-sh-volume-profiles-h-slash-t-grante-kiehne-and-michael-van-kleeck
https://www.quantopian.com/posts/modified-heatmap-based-on-grant-kiehnes-example
https://www.quantopian.com/posts/heatmap-of-returns-by-day-of-week

7 responses

If anyone ends up making money off of a strategy inspired by this, you owe me a six pack of porter from http://www.backeastbrewing.com/. Just give them a call, ask for Tony, and tell him you want to put it on a credit card for me to pick up. "Aspiring quant. Will work for beer."

Just noticed a minor mistake. Please disregard:

# lighter color means z_diff > 0 (V_SH > V_SPY) & darker color mean z_diff < 0 (V_SH < V_SPY)  

I changed the colormap, so this comment no longer pertains.

I think I see ET flying across the greenscreen sky in a bike basket. Or is this one of those stereograms where I have to squint and cross my eyes to see the pattern, hold on, (-x-)v(-x-). Nope. Oh I know, it's one of those modern art pieces right? Where's my AAPL-tini!?

(All offered in friendly jest of course.)

It's actually a photo of the throw rug in my man cave!

Here's an update. The original notebook cannot be copied. Folks might find the code handy in doing minutely analysis for:

Infographics Challenge: Economic Implications of COVID-19
https://www.quantopian.com/posts/infographics-challenge-economic-implications-of-covid-19

Still here Grant? I'm cleaning up this old MarketMole gmail account and came across this Q reference. What a different 5 years can make!

@ Market Tech - I have tapered off to being completely disengaged, but that's o.k. I am still curious about how things work in this domain, and posted this recently:

https://www.quantopian.com/posts/analysis-of-financial-markets-mid-march-2020

I read "The Big Short: Inside the Doomsday Machine" by Michael Lewis a few months back, and continue to seek out articles and podcasts, more related to macro-level financial/economic matters.