Quant Mashup - MktStk
What are the Best & Worst Times of Day to Buy the Stock Market? [MKTSTK]
I awoke this morning to find the S&P 500 futures down about 11 points. My immediate thought was “oh goodie, there’s some candy for the old early morning BTFD’ers to enjoy” [translation, “I’ll be the market goes up from here”]. This instinct was based on many such mornings of
- 7 years ago, 4 Apr 2017, 07:17pm -
A Dead-Simple Hedge Ratio API [MKTSTK]
As the title suggests, I created a dead simple hedge ratio API called Risk Hedger. Also its free and the Python client is open source. So if you’re in to that kind of thing feel free to read on: What is a Hedge Ratio? Traders and investors buy/sell hedges when they want to reduce the risk of their
- 7 years ago, 31 Mar 2017, 12:32pm -
Simulating Correlated Random Walks for the S&P 500 [MKTSTK]
Waaaaaay back in the day, I showed how to simulate correlated random walks using copulas…. I was really thinking about the application to pairs trading back then… which was fine, because one of the limitations was that the method could only simulate two random variables at a time. If you wanted
- 7 years ago, 16 Mar 2017, 05:33pm -
A Regime Switching Model: Momentum vs Mean Reversion [MKTSTK]
Today I wanted to share a link to my first post on Quantopian, in which I describe a strategy that uses social data to switch between mean reversion and momentum based trading regimes. This feat is accomplished using a new social factor I’ve created. I believe this strategy presents a novel
- 7 years ago, 12 Aug 2016, 01:56pm -
Unbalanced Classes in Machine Learning and the Stock Market [MKTSTK]
Many assets exhibit bull or bear trends which persist for long periods of time. This presents an interesting problem for anyone trying to predict the future return of an asset: a lack of diversity in your training set. This problem is known as unbalanced classes in the machine learning field. The
- 7 years ago, 20 Jul 2016, 02:20pm -
How to Value Nadex Bull Spreads? [MKTSTK]
Exotic options have always been a hobby of mine. One of the curious things about Dodd-Frank was it started to push swap trading onto exchanges. As such, a cottage industry of exchange traded exotics (in the US they're technically swaps) has popped up over the last few years. The biggest of
- 8 years ago, 31 Mar 2016, 03:44am -
Limits of Machine Learning Part 2 [MKTSTK]
Last week’s podcast was pretty negative on the value of machine learning in trading, so this week I wanted to provide my own counterpoint and explore life within the limits I identified earlier. Specifically, I wanted to begin mapping the things machine learning algorithms might really be great at
- 8 years ago, 16 Mar 2016, 06:32pm -
Some Limits of Machine Learning in Trading [MKTSTK]
Aka my first podcast. Sorry I’ve been AWOL for so long; I’ve been deep in the lab working on my creation. As my work-life balance has careened towards work, I have found it difficult to sit down and write like I used to, so I am giving this whole podcast thing a try… So without further ado, I
- 8 years ago, 10 Mar 2016, 02:53am -
All Trading is Quant Trading [MKTSTK]
Quant trading is a redundant term: all trading is quant trading. Whether your an arbitrageur or a technician, fund manager or high frequency trader, you are basing your trading on the quantitative analysis of the market, you just might not realize it. A lot of times there seems to be an artificial
- 8 years ago, 10 Oct 2015, 08:36pm -
How to look up a Stock’s Short Interest with Python [MKTSTK]
Today I was trying to investigate short interest in the Energy sector: the group as a whole has rallied hard over the last few days and I suspect a short covering rally is at play, so some testing is in order. Much to my dismay, my searches didn’t return an easy way to do this in Python. Lots of
- 8 years ago, 7 Oct 2015, 09:56pm -
The importance of visualization in finance [MKTSTK]
Its somewhat shocking to think about, but the mathematical underpinnings of modern finance have existed since at least 1898 when an obscure french mathematician Louis Bachelier was first getting started on what would become known as random walks. The two centuries prior to Bachelier witnessed the
- 8 years ago, 10 Sep 2015, 11:00am -
Quant-Trader or Trader-Quant? [MKTSTK]
The term “quant trader” gets thrown around a lot these days. For any trader who has been in the industry for more than a decade, the adoption of the term is driven by survival. There’s a running joke in some HFT circles: these days, older traders would never get past HR using the same criteria
- 8 years ago, 26 Aug 2015, 01:15pm -
What does it mean that the stock market broke a 949 day streak last Friday? [MKTSTK]
Last Friday the S&P 500 did something it hadn’t done in a very long time (949 trading days to be exact): it went down by more than 3% in a day. Nearly eight months ago we highlighted the length of this non-losing streak as it stood then at 787 trading days (the market seems to like palindromes
- 8 years ago, 24 Aug 2015, 12:27pm -
The Kalman Filter and Pairs Trading [MKTSTK]
Imagine this scenario: you are a statistical arbitrage trader at a prop desk or HF. As such, you routinely hold an inventory of ETF exposure that you must hedge. The previous night, you instructed your overnight traders to calculate the hedge ratios for a matrix of ETF’s. The next morning before
- 8 years ago, 18 Aug 2015, 12:27pm -
Hello, Market Maker! [MKTSTK]
As we have made clear in the past, we are fascinated by the economics of open source software. This business model makes sense for massively scalable and ubiquitous bits of technology, but surely it must be anathema to the closed world of trading, right? This has an intuitive appeal, we know of
- 8 years ago, 7 Aug 2015, 07:15pm -
The Ornstein-Uhlenbeck process and pairs trading [MKTSTK]
Perhaps the most widely known form of statistical arbitrage is called Pairs Trading. In this general strategy, we start first by picking two stocks which are highly related to one another (either by correlation, cointegration, or both). One method for finding such pairs is to use a network graph
- 8 years ago, 3 Aug 2015, 12:46pm -
Synchronicity [MKTSTK]
Recently we read an excellent article on investing from Alpha Architect entitled One way to beat the market? Be different! In the article, the author shows how thinking differently from the pack can provide better performance for your investment portfolio. As often happens with lateral thinking,
- 8 years ago, 29 Jul 2015, 01:14pm -
New Academic Research: ECB predicts stock market using social data [MKTSTK]
The European Central Bank just released a research report that might be of some interest to readers of this blog. It turns out that Social Data can be useful in predicting the stock market (go figure!): Quantifying the effects of online bullishness on international financial markets [ECB] …In our
- 8 years ago, 22 Jul 2015, 11:11pm -
Research Links: Boltzmann Machines [MKTSTK]
Neural networks have long fascinated us from a distance, but quite frankly, we’ve always had lower hanging fruit to pick: there’s always been a simpler model that didn’t require us learning a whole new thing. Let’s face it, as traders we are always looking for the highest level of
- 8 years ago, 16 Jul 2015, 02:24am -
How much data should I use to build a trading strategy? [MKTSTK]
On average, High Frequency Trading is a young profession. At meetups, high frequency traders are likely to refer to the years prior to 2008 as “ancient history”. As a group, their attention spans might seem short and HFT strategies resemble their creators to a startling degree. However, in
- 8 years ago, 14 Jul 2015, 05:42pm -
Top 5 MKTSTK posts thus far… [MKTSTK]
As this year flies by and this blog nears one year from conception (the concept was hatched at the end of this month, launched a bit later), we thought it would be cool to take a look at what articles you all thought were the most interesting over this blog’s short existence [as measured by total
- 8 years ago, 12 Jul 2015, 08:47am -
Research Links: Correlation Networks [MKTSTK]
Evolution of worldwide stock markets, correlation structure and correlation based graphs [arXiv] We investigate the daily correlation present among market indices of stock exchanges located all over the world in the time period Jan 1996 - Jul 2009. We discover that the correlation among market
- 8 years ago, 9 Jul 2015, 11:52am -
Insuring tomorrow’s decline, today [MKTSTK]
As of pixel time the VIX is up over 7% and the S&P 500 is basically unchanged; we feel this situation arises when traders desire protection today for the possibility of danger tomorrow. In other words, the price of risk is rising and markets are stabilizing. Intuitively (i.e. the feeling our rat
- 8 years ago, 2 Jul 2015, 07:10pm -
Boom and bust research links: superexponential growth and crashes [MKTSTK]
Given the rapidity of today’s gap higher in the S&P 500, it would seem to be an appropriate time to repost some research related to the boom and bust cycle. Certainly it would seem we are near a phase transition of sorts in the stock market. For most of 2015 the market has been range-bound,
- 8 years ago, 8 May 2015, 07:18pm -
Social data research links: oil prices, real estate, and power laws [MKTSTK]
Oil price volatility and oil-related events: An Internet concern study perspective [ResearchGate] This paper investigates the effects of four types of oil-related events on world oil prices, using an event study methodology and an AR-GARCH model. The Internet information concerning these events,
- 9 years ago, 16 Apr 2015, 01:30pm -
Visualizing volatility with streamgraphs [MKTSTK]
Streamgraphs provide a useful way to visualize the volatility for a large group of assets over time. You can think of a streamgraph as like a stacked line graph where the data radiates out around a central axis. The following chart plots the rolling 10 day volatility for the Nasdaq 100 plus SPY and
- 9 years ago, 18 Mar 2015, 06:26pm -
Correlation filtering on the S&P 500 [MKTSTK]
Yesterday we shared a link to a video showing how Python’s Networkx package could be combined with Gephi to produce some stunning network visualizations. Today we wanted to use these same tools to look at the correlation structure of the S&P 500. To do so, we took the correlation matrix of the
- 9 years ago, 10 Mar 2015, 12:50pm -
Dimensionality reduction with graphs [MKTSTK]
We wanted to celebrate our 100th post on MKTSTK by exploring a new type of financial visualization. New to us, at least. One of the best aspects to making of living off the markets is that you never stop learning. A few weeks ago we ran across an example in Python’s sklearn for visualizing stock
- 9 years ago, 6 Mar 2015, 09:12pm -
Stock market visualization: Minimum Spanning Trees [MKTSTK]
One of the most useful ways to visualize the stock market is with Minimum Spanning Trees (MST). These are network graphs in which each vertex represents a stock symbol and where strongly related stocks are connected by edges. One popular way to do this is by using correlation matrices. In the past,
- 9 years ago, 4 Mar 2015, 10:12pm -
SIC lookup by stock symbol [MKTSTK]
We wanted a quick (and free) way to lookup the SIC code for a stock symbol in python. You can do this manually with the SEC’s EDGAR website, but if your list is 100’s of stock symbols this can get old pretty quickly. The following code makes use of Python’s BeautifulSoup package to extract the
- 9 years ago, 2 Mar 2015, 10:07pm -
Academic research links: social data and financial markets [MKTSTK]
Web Search Queries Can Predict Stock Market Volumes …A recent important discovery is that search engine traffic (i.e., the number of requests submitted by users to search engines on the [Internet]) can be used to track and, in some cases, to anticipate the dynamics of social phenomena. Successful
- 9 years ago, 28 Feb 2015, 02:11am -
Google Semantic Orientation [MKTSTK]
Suppose we have an unstructured block of text. We want to reduce the information contained within the raw words and phrases into a single score of whether it is positive or negative. For example, suppose we have a tweet and we want to determine whether it is bullish, bearish, or neutral. Semantic
- 9 years ago, 25 Feb 2015, 07:30pm -
What is social data? [MKTSTK]
In the lead up to the release of our first book, Intro to Social Data for Traders, we have been highlighting the ways that social data and stock prices are related. But what is social data, exactly? Social data is term which encompasses multiple sources of information such as search queries, social
- 9 years ago, 24 Feb 2015, 07:15pm -
Financial network visualization: clustering by Estimize analyst coverage [MKTSTK]
Estimize is a crowd-sourced network which collects structured financial predictions submitted by its users, many of whom are professional analysts. Users can make predictions ranging from what next month’s unemployment rate will be to what a stock’s next quarterly earnings report will say. There
- 9 years ago, 20 Feb 2015, 07:18pm -
The number of Google searches for this term just set a record and investors are noticing [MKTSTK]
Fast food has been on a roll as of late. The rate of Google searches for for the term “hamburger” is at all time highs, and investors in fast food stocks are enjoying tasty returns. Burger chains such as Red Robin (RRGB) and Jack in the Box (JACK) have more than tripled since 2011, with similar
- 9 years ago, 19 Feb 2015, 08:47pm -
Predicting a stock’s daily trading volume: Update 1 [MKTSTK]
Last week we presented some evidence that the total daily trading volume for SPY could be predicted from the first minute’s trading volume. We accomplished this using an Archimedean copula, a mathematical construct for modeling multivariate data. Interpreting a copula from an intuitive standpoint
- 9 years ago, 18 Feb 2015, 08:06pm -
Timing TSLA with Google Trends [MKTSTK]
Historical search volume presents a wealth of information. Recently, we presented a way to use Google Trends to predict stock market directiontsla_real_vol_, looked at the correlation between searches for the term “stock market” to the value of the VIX, and used searches for “farmville” to
- 9 years ago, 17 Feb 2015, 07:52pm -
Predicting a stock’s daily trading volume from the market open [MKTSTK]
Given yesterday’s post showing the link between trading volume and stock valuation, it would seem appropriate to investigate the ways in which we can predict today’s volume. Its all well and good to know that high volume coincides with volatility and falling prices but how do we know we are
- 9 years ago, 14 Feb 2015, 05:22am -
Trading Google Trends with logistic regression [MKTSTK]
Recently we have highlighted the value of using social data in your analysis of the market. Earlier we showed how you could have used Google Trends to price ZNGA after its IPO. We also showed how you can monitor risk with the Twitter stream. Today we will expand upon an example where we showed how
- 9 years ago, 5 Feb 2015, 02:49pm -
January’s false start marks return to normal for stocks [MktStk]
We have been thinking a lot about winning streaks lately. Looking at charts of the S&P 500 index it is hard not to be impressed by how many positive monthly returns we have had since the “resolution” of the last full-blown Euro crisis in mid-2012. We wanted to gain some historical
- 9 years ago, 31 Jan 2015, 04:01pm -
Update to MKTSTK’s first book release: Intro to Social Data for Traders [MKTSTK]
We wanted to provide an update to everyone who signed up for a free copy of MKTSTK’s first book, Intro to Social Data for Traders by our very own Thomas Pendergrass. This book is intended for traders and investors that want to gain an edge on the competition by including social media and search
- 9 years ago, 24 Jan 2015, 02:05pm -