Quant Mashup
Quantocracy is now on Bluesky and Threads. See the links in the header. - Mike
Handling a Large Universe of Stock Price Data in R: Profiling with profvis [Robot Wealth]
Recently, we wrote about calculating mean rolling pairwise correlations between the constituent stocks of an ETF. The tidyverse tools dplyr and slider solve this somewhat painful data wrangling operation about as elegantly and intuitively as possible. Why did you want to do that? We’re building a
- 4 years ago, 21 May 2020, 10:26am -
VADER Sentiment Analysis in Algorithmic Trading [Quant Insti]
In Finance and Trading, a large amount of data is generated every day. This data comes in the form of News, Scheduled Economic releases, employment figures, etc. It is clear that the news has a great impact on the prices of stocks. Every trader takes great efforts in keeping track of the latest news
- 4 years ago, 21 May 2020, 10:26am -
An Improved Volume Profile Chart with Levels [Dekalog Blog]
Without much ado, here is the code ## Copyright (C) 2020 dekalog ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option)
- 4 years ago, 21 May 2020, 10:26am -
How to Wrangle JSON Data in R with jsonlite, purr and dplyr [Robot Wealth]
Working with modern APIs you will often have to wrangle with data in JSON format. This article presents some tools and recipes for working with JSON data with R in the tidyverse. We’ll use purrr::map functions to extract and transform our JSON data. And we’ll provide intuitive examples of the
- 4 years ago, 20 May 2020, 09:52am -
A Big Gap Up That Wipes Out A Big Loss Yesterday [Quantifiable Edges]
After closing down more than 1% yesterday, SPY is set to open up enough to erase all of yesterday’s losses. I decided to look back at other times this has happened. SPY Big Gap Up Erases Yesterdays Loss - Open to Close Results Not exactly a consistent edge, but I thought the general upside
- 4 years ago, 20 May 2020, 09:52am -
Probabilistic Sharpe Ratio [Quant Dare]
Can a Sharpe ratio of 1.55 be better than a Sharpe ratio of 1.63 in a 1 year track-record? Not necessarily. Sharpe ratios are not comparable, unless we control the skewness and kurtosis of the returns. In this post we are going to analyze the advantages of the Probabilistic Sharpe Ratio exposed by
- 4 years ago, 20 May 2020, 09:52am -
Implied risk premia [OSM]
In our last post, we applied machine learning to the Capital Aset Pricing Model (CAPM) to try to predict future returns for the S&P 500. This analysis was part of our overall project to analyze the various methods to set return expectations when seeking to build a satisfactory portfolio. Others
- 4 years ago, 19 May 2020, 12:11pm -
Prospect Theory Helps Explain Return Anomalies [Alpha Architect]
The field of behavioral finance provides us with fascinating insights into individual investor behavior, including how individuals view risk, as well as the impact of those views on asset prices. Prospect theory plays a major role in explaining investor behavior. The theory, formulated in 1979 by
- 4 years ago, 19 May 2020, 12:11pm -
Using Digital Signal Processing in Quantitative Trading Strategies [Robot Wealth]
In this post, we look at tools and functions from the field of digital signal processing. Can these tools be useful to us as quantitative traders? What’s a Digital Signal? A digital signal is a representation of physical phenomena created by sampling that phenomena at discrete time intervals. If
- 4 years ago, 19 May 2020, 10:31am -
Trend Following the S&P 500? Some Practical Advice [Alpha Architect]
Now that market volatility is back, tail risk management strategies are gaining some attention. A lot of investors are dipping their toe into the water and exploring trend-following strategies on the S&P 500 — arguably the most popular U.S. stock market index.This paper explores multiple trend
- 4 years ago, 19 May 2020, 10:31am -
Periodically Rebalanced Static Allocation 'Buy and Hold' Strategies in QSTrader [Quant Start]
For those systematic traders who are considering a long-term investment horizon one of the most common forms of generating a portfolio involves static proportional capital allocation amongst a collection of (hopefully) diversifying asset classes, which is periodically rebalanced to maintain the
- 4 years ago, 19 May 2020, 10:30am -
Profiling S&P 500 Drawdowns Since 1871 [Capital Spectator]
Longer is better for analyzing the stock market, which is why Professor Robert Shiller’s data set (with an 1871 starting date) is one of the great free resources on the internet for studying the history of US equities. With that in mind, let’s review how the current drawdown for the S&P 500
- 4 years ago, 19 May 2020, 10:30am -
A Volume Profile With Levels Chart [Dekalog Blog]
Just a quick post to illustrate the latest of my ongoing chart iterations which combines a levels chart, as I have recently been posting about, but with the addition of a refined methodology of creating the horizontal histograms to more clearly represent the volumes over distinct periods. The main
- 4 years ago, 19 May 2020, 10:30am -
Adding a 1-Day Lag When Executing TAA Strategies [Allocate Smartly]
We track 50+ public Tactical Asset Allocation (TAA) strategies in near real-time, allowing us to draw broad conclusions about TAA as a trading style. By design, most of those strategies trade just once per month, and most assume that next month’s asset allocation is both calculated and executed on
- 4 years ago, 18 May 2020, 11:09am -
How to Calculate Rolling Pairwise Correlations in the Tidyverse [Robot Wealth]
How might we calculate rolling correlations between constituents of an ETF, given a dataframe of prices? For problems like this, the tidyverse really shines. There are a number of ways to solve this problem … read on for our solution, and let us know if you’d approach it differently! First, we
- 4 years ago, 18 May 2020, 11:08am -
Cheap vs Expensive Factors [Factor Research]
This research note was originally published at Alpha Architect. Here is the link. SUMMARY Factors can be valued like stocks Factor valuations have not changed structurally over the last 30 years Cheap factors outperformed expensive ones on average INTRODUCTION Tesla (TSLA) breached the $100 billion
- 4 years ago, 18 May 2020, 11:08am -
Thoughts on Systematic Value Investing [Two Centuries Investments]
As a risk factor, Value is very much alive. Confusing the risk side and return side of factors creates the misconceived question of whether the value factor is dead. Something that is dead, does not move. A dead factor is a flat horizontal line with random noise. By contrast, value has been moving
- 4 years ago, 18 May 2020, 11:08am -
A Comparison of Charts [Dekalog Blog]
Earlier in May I posted about Market Profile with some charts and video. Further work on this has made me realise that my earlier post should more accurately be described as Volume Profile, so apologies to readers for that. Another, similar type of chart I have seen described as a TPO chart (TPO
- 4 years ago, 18 May 2020, 11:08am -
How to Run Python from R Studio [Robot Wealth]
Modern data science is fundamentally multi-lingual. At a minimum, most data scientists are comfortable working in R, Python and SQL; many add Java and/or Scala to their toolkit, and it’s not uncommon to also know one’s way around JavaScript. Personally, I prefer to use R for data analysis. But,
- 4 years ago, 15 May 2020, 09:39am -
Is this the pullback you’ve been waiting for? [Quantifiable Edges]
It has been 47 trading days since SPX posted its last 3-day pullback. That is a long time. And it is especially long considering SPX is still below its 200ma. Should SPX fail to rally out of this early hole this morning, we will finally see the 1st 3-day pullback since March 9th. Bulls could look at
- 4 years ago, 15 May 2020, 09:39am -
YTD Performance of Equity Factors - Update After Two Months [Quantpedia]
Nearly two months ago, in a time of the highest turmoil during the current pandemic crisis, we performed a quick assessment of the status of performance of equity factor strategies. The world has still not been able to ward-off health-care crisis completely, but a lot of countries have made
- 4 years ago, 15 May 2020, 09:38am -
Discussion: Managing the Costs of Passively Investing in Active Strategies [Alpha Architect]
We recently covered a paper by David Blitz that highlighted the potential problems with passively investing in “active” strategies. The research piece is great and surfaces a lot of great concepts. Like a lot of research we publish/summarize this article appears to “shoot Alpha Architect in
- 4 years ago, 15 May 2020, 09:38am -
Tracking Bitcoin Gains since its 3rd Halving in May 2020 using Python [Quant at Risk]
The Bitcoin’s 3rd halving was the most anticipated event this year. This a moment when a reward for all Bitcoin block miners is cut by half. It happens every 4 years or every 210,000 blocks on the Bitcoin blockchain. The previous two halving events took place in 2012 and 2016, respectively. Before
- 4 years ago, 15 May 2020, 09:38am -
Financial Data Manipulation in dplyr for Quant Traders [Robot Wealth]
In this post, we’re going to show how a quant trader can manipulate stock price data using the dplyr R package. Getting set up and loading data Load the dplyr package via the tidyverse package. if (!require('tidyverse')) install.packages('tidyverse') library(tidyverse) First,
- 4 years ago, 14 May 2020, 10:12am -
Academic Finance Research Galore. WFA Sessions Announced [Alpha Architect]
Attention all finance geeks. The latest and greatest from academic researchers is available for all to review. The WFA recently released their sessions. WFA is one of the more prestigious academic conferences and papers presented at the conference often find their way into top-tier academic
- 4 years ago, 14 May 2020, 10:12am -
Machine Learning and Investing: Forecasting Fundamentals w/ Ensembles [Alpha Architect]
Quantitative factor portfolios generally use historical company fundamental data in portfolio construction. The key assumption behind this approach is that past fundamentals proxy for elements of risk and/or systematic mispricing. However, what if we could forecast fundamentals, with a small margin
- 4 years ago, 13 May 2020, 01:37pm -
Get Rich Quick Trading Strategies (and why they don't work) [Robot Wealth]
Every aspiring millionaire who comes to the markets armed with some programming ability has implemented a systematic Get Rich Quick (GRQ) trading strategy. Of course, they don’t work. Deep down even the greenest of newbies knows this. Yet, still, we are compelled to give them a try, just once,
- 4 years ago, 13 May 2020, 08:19am -
Designing an energy arbitrage strategy (h/t @PyQuantNews) [Steve Klosterman]
The price of energy changes hourly, which opens up the possibility of temporal arbitrage: buying energy at a low price, storing it, and selling it later at a higher price. To successfully execute any temporal arbitrage strategy, some amount of confidence in future prices is required, to be able to
- 4 years ago, 13 May 2020, 08:19am -
How To Get Historical S&P 500 Constituents Data For Free [Robot Wealth]
In this post, we are going to construct snapshots of historic S&P 500 index constituents, from freely available data on the internet. Why? Well, one of the biggest challenges in looking for opportunities amongst a broad universe of stocks is choosing what stock “universe” to look at. One
- 4 years ago, 12 May 2020, 10:05am -
Skulls, Financial Turbulence and Risk Management [Alpha Architect]
When hunting for diversity, the typical investor considers only average correlations. However, when measuring an asset’s diversification benefits utilizing average correlations tend to mislead investors. For example, when both U.S. and non-U.S. equities produce returns greater than one standard
- 4 years ago, 12 May 2020, 10:05am -
Straddles and Trend Following [Flirting with Models]
The convex payoff profile of trend following strategies naturally lends itself to comparative analysis with option strategies. Unlike options, however, the payout of trend following is not guaranteed. To compare and contrast the two approaches, we replicate simple trend following strategies with
- 4 years ago, 11 May 2020, 10:10am -
How to Find Cheap Options to Buy and Expensive Options to Sell [Robot Wealth]
If you want to make money trading, you’re going to need a way to identify when an asset is likely to be cheap and when it is likely to be expensive. You want to be a net buyer of the cheap stuff and a net seller of the expensive stuff. Thanks, Capitain Obvious. You’re welcome. How does this
- 4 years ago, 11 May 2020, 10:10am -
Value Investing: Even Deeper History [Two Centuries Investments]
In last week’s post we extended the systematic value factor (or at least a pretty good proxy of it) back to 1871. The response from readers was encouraging, perhaps because of the pain that value investing has been causing lately. Long-run history gives some relief. This week we dig deeper,
- 4 years ago, 11 May 2020, 10:10am -
The Case Against Factor Investing [Factor Research]
Factor investing is likely the best option for investors seeking to outperform the market However, the cyclicality of factors makes factor investing challenging when it underperforms Investors that do not understand this cyclicality are likely better served by plain, rather than smart beta FREE
- 4 years ago, 11 May 2020, 10:09am -
Online Portfolio Selection: Mean Reversion [Hudson and Thames]
Mean Reversion is an effective quantitative strategy based on the theory that prices will revert back to its historical mean. A basic example of mean reversion follows the benchmark of Constant Rebalanced Portfolio. By setting a predetermined allocation of weight to each asset, the portfolio shifts
- 4 years ago, 10 May 2020, 10:03pm -
How to Hedge a Portfolio with Put Options [Robot Wealth]
There are 2 good reasons to buy put options: because you think they are cheap because you want downside protection. In the latter case, you are looking to use the skewed payoff profile of the put option to protect a portfolio against large downside moves without capping your upside too much. The
- 4 years ago, 8 May 2020, 09:35pm -
Machined risk premia [OSM]
Over the last few posts, we’ve discussed methods to set return expectations to construct a satisfactory portfolio. These methods are historical averages, discounted cash flow models, and risk premia. our last post, focused on the third method: risk premia. Using the Capital Asset Pricing Model
- 4 years ago, 8 May 2020, 09:34pm -
When endogenous risk management isn't enough: a simple risk overlay [Investment Idiocy]
"How does your risk management work?" ... is a question I'm frequently asked. In fact this is actually a difficult question, if you were to look at my open source python backtesting project pysystemtrade, you would struggle to point at a piece of code and say "Behold! Right
- 4 years ago, 7 May 2020, 02:54pm -
Backtesting ESG Factor Investing Strategies [Quantpedia]
Socially Responsible Investing (also called ESG Factor Investing) grows in popularity. More and more investors enter the stock market not just to invest their savings, but they are also want to support companies that bring positive social or environmental change. ESG factor investing can bring
- 4 years ago, 7 May 2020, 02:54pm -
The Size Effect in Multifactor Portfolios [Alpha Architect]
The lack of a statistically significant size premium in the U.S. since the publication of Rolf Banz’s 1981 paper, “The Relationship Between Return and Market Value of Common Stocks,” published in the Journal of Financial Economics, led many investors to question its use in building portfolios.
- 4 years ago, 7 May 2020, 02:53pm -
Sentiment analysis: ifo business climate data [Grzegorz Link]
Sentiment analysis is one of the investing tools I'm most fond of. There are multiple ways of measuring sentiment: from basic investor surveys to advanced text mining techniques, but one of the most robust and long-term datasets is ifo Institute's business climate sentiment polls.[4]
- 4 years ago, 6 May 2020, 10:44pm -
Can neural networks predict the stock market just by reading newspapers? [Quant Dare]
Markets are said to be driven by randomness, but this does not imply that they are 100% random and thus, completely unpredictable. In the end, there are always people behind investments and many of them are making decisions based on what they read in newspapers. We will be trying to estimate the
- 4 years ago, 6 May 2020, 11:32am -
How to download fundamentals data with Python (h/t @PyQuantNews) [TheAutomatic.net]
In this post we will explore how to download fundamentals data with Python. We’ll be extracting fundamentals data from Yahoo Finance using the yahoo_fin package. For more on yahoo_fin, including installation instructions, check out its full documentation here. Getting started Now, let’s import
- 4 years ago, 6 May 2020, 11:31am -
Pairs Trading Literature Review [Robot Wealth]
This post summarises the key lessons of the academic literature that has been published on pairs trading. The key themes are highlighted at the end of the page. Pair Trading Literature Review Gatev, Goetzmann, Rouwenhorst – “Pairs Trading: Performance of a Relative Value Arbitrage Strategy”
- 4 years ago, 6 May 2020, 11:31am -
Using Aggregate TAA Allocation as a Tool for Timing the Market [Allocate Smartly]
We track 50+ public Tactical Asset Allocation (TAA) strategies. A unique feature of our platform is that we show the aggregate allocation across all of those strategies each day (member link). For example, the graph below shows the aggregate allocation year to date by category of asset. Note the
- 4 years ago, 5 May 2020, 01:53pm -
Cheap vs. Expensive Factors: Does Valuation Matter for Future Returns? [Alpha Architect]
Tesla (TSLA) breached the $100 billion market capitalization in January 2020 and became the most valuable car manufacturer globally. However, valuing the company is challenging given the growth profile, complexity of the business, and erratic CEO. It is not yet profitable and cash flow is negative,
- 4 years ago, 5 May 2020, 01:53pm -
Overnight and Intraday SPX returns [Robot Wealth]
One of the things I’ve noticed from staring at the screen all day for the last few months is that most of the large negative returns in US stock indexes have come overnight. What do you mean by “overnight”? The core stock trading session for US stocks is between 9:30 am and 4 pm Eastern Time.
- 4 years ago, 5 May 2020, 09:30am -
LSTM Networks: Can They Predict Equity Index Prices? [Quant Insti]
In this article, we will study a deep learning framework based on recurrent neural networks to predict daily equity index price movements. Specifically, the focus will be on long short-term memory (LSTM) networks - which are a type of recurrent neural network. Different types of inputs and network
- 4 years ago, 5 May 2020, 09:29am -
Why Passively Investing in Active Methods May Not Work [Alpha Architect]
In this piece, David Blitz provides an interesting perspective on using the passive framework as a blueprint for constructing active (ETF-like) products. The article is not an empirical (no charts!) nor a theoretical (no analytics) analysis, but is focused on just one question: Is it efficient to
- 4 years ago, 5 May 2020, 09:29am -
Using Apache Airflow to Extract CoT Data [Robot Wealth]
In today’s post we are going to be extracting CoT (Commitment of Traders) reports from the CFTC website using a pipeline built on Apache Airflow. What is CoT data? The CoT report is a weekly publication which reports the open positions of market participants in the U.S futures market. It’s
- 4 years ago, 4 May 2020, 09:28am -