In this video we show how to carry out performance attribution analysis on portfolios created in Palantir, and how this analysis can be automated using Hedgehog, the Palantir Finance programming language. This video is best viewed in full-screen mode.
If you have trouble viewing the embedded video, you can download a copy here.
Pairs trading is a popular strategy used by many asset management firms where the firm goes long one security, and short another. In this video, we will use Palantir to analyze a strategy of trading one gold ETF off of another (GLD and GDX). GLD is the ETF that tracks the spot price of gold and GDX is an ETF whose underlying securities are the stocks of gold mining companies.
The video below is best viewed in full-screen mode.
If you have trouble viewing the embedded video, you can download a copy here.
In this case study, we use Palantir Finance to investigate potential correlations between stock returns and the lunar cycle. The 2002 paper Are Investors Moonstruck? Lunar Phases and Stock Returns by Yuan, Zheng, and Zhu provided the inspiration for the study. The video below is best viewed in full screen mode.
If you are having trouble with the embedded video, click here to download a copy.
While Palantir was developed with financial analysis in mind, its tools are data agnostic and can be applied to any data source. In the study below, we import climate data from the website http://www.rimfrost.no/ and perform a quick analysis of trends in average monthly air temperature over the past several centuries.
This video is best viewed in full screen. If you are having trouble with the embedded video, click here to download a copy.
In most analysis packages, it is difficult to incorporate multiple assets classes into the same analysis. With Palantir, we can quickly traverse the capital structure of companies by integrating data on options, bonds, credit default swaps, and any other instrument a company issues. This streamlines many common workflows, from screening stocks to developing trading strategies and conducting research.
Click on the video below to see Palantir tackle a cross asset study in just minutes.
If you are having trouble with the embedded video, click here to download a copy.
A 2003 paper by Pan and Poteshman entitled The Information in Option Volume for Stock Prices (found here), and highlighted by this 2006 New York Times article suggests that events in equity options markets can serve as predictors for trends in the stock market. Their fundamental claims are two-fold: first, that options traders are better informed than the majority of the market, so optimism in the equity options market will tend to lead good performance in corresponding stocks, and vice versa; and second, that this phenomenon is more observable in firms where information flow is less efficient. The academic study uses information from a proprietary database offered by the Chicago Board Options Exchange (more on that later). Here, we will replicate the study using less descriptive data, but the basic workflow and thought process remains identical.
A few months ago, we launched a trial version of Palantir Finance available to the general public. We call it Joyride. If you haven’t tried it yet, you can access it at http://joyride.pfinance.com. For this particular blog post, we’ve created it entirely using the data available on Joyride (courtesy of Xignite), so we encourage you to sign up for Joyride and try out this study for yourself.
The study will compare the relative performance of high-beta and low-beta stocks adjusted for market risk. Our goal is to create two separate indices with equivalent beta adjusted exposures — one with the low-beta stocks and one with the high-beta stocks. We cannot directly compare the low versus high beta stocks without adjusting for the indices’ average beta to the market. [1] When we are finished, we will generate a plot with both indices on the same graph. The plot will reveal an interesting phenomenon that occurred prior to the major crash in 2008.
Open Joyride
To begin, please open a browser window and point it to http://joyride.pfinance.com/. From there, you can run Joyride. If you haven’t done so already, create a username and password (this only takes a few seconds). In order to understand the features used in this study, I highly recommend that you watch our video tour. (You will need to create an account to start the tour.) It takes about 10 minutes and provides an overview of how to analyze data in Palantir Finance.
Create Your Group
Once you have logged into the program, click on the Explorer icon (). This will bring up the Instrument Explorer application. From here, we will make two baskets of stocks, one with high betas and one with low betas. First, select S&P 500 from the “Start with” pull-down menu. Next, click on the percentile button: . At the bottom of the graph, click on the expression bar (labeled ‘Bucketing Metric’) and enter the following text: beta(SPX, 252). By doing so, you are calculating a beta over the past 252 days for each stock in the S&P 500 Index and displaying it on a histogram. Now select the bottom 20% of stocks with the mouse. Your screen should look like this:
A recent Motley Fool article discusses reverse stock splits and their implications for future performance: “Investors have to wonder: Will reverse splits do any good, or are they basically the kiss of death for a company?” With Palantir Finance, we can easily examine the short-term performance of companies that undergo reverse stock splits. This question lends itself particularly well to a common process in Palantir Finance where we create a group of instruments based on a selection of filters, generate an index based on that group and compare the performance of that index to a benchmark.
The Explorer tool allows us to add a set of filters to isolate only the instruments we are interested in. The following set of filters returns stocks in the NYSE, Nasdaq and AMEX with a market cap larger than $10 million that have undergone a reverse stock split.
The Chicago Board Options Exchange Volatility Index, or VIX, is often cited as a market-timing indicator. Traders have created a variety of strategies to exploit supposed correlations between this “fear index” and future market returns. Using Palantir Finance, we can effortlessly examine the exact nature of these correlations to make more informed trading decisions. The inspiration for this study came from a report from the Credit Suisse Quantitative Trading and Derivatives Strategy group. The original report can be found here.
The VIX measures the implied volatility of index options based on the S&P 500. Plotting both the VIX and the S&P 500 on a chart with a split axis, a pattern immediately emerges.
The VIX and the S&P 500 appear inversely correlated, especially during two notable periods – the tech bubble and the real estate bubble. This is an interesting observation, but it isn’t especially helpful. We want to know whether the VIX can act as a leading indicator for market returns. To achieve this end, we look at the VIX’s current standing relative to its recent trend, or “relative level”, defined as the ratio of its current value to its N-day moving average, minus one. This isn’t a commonly used financial metric, but we create it easily enough in the Custom Metric tool. Read the rest of this entry »
Normally, if you wanted to go long oil, you might buy an energy sector ETF or buy oil stocks. But it’s possible that those stocks may not be available or that they are not available at a high volume. Or maybe you just want to find a less commonly used and less crowded ways to invest. What are some things that can be done with those restrictions?
One question you might ask is “What stocks have similar price movements to oil when we discount the index and sector?” This question can be answered in Palantir in a few steps. To do so, we’ll first use regressions on every stock in the S&P 500 to take out the movements of the S&P 500 and that stock’s sector ETF. Then, we’ll correlate the resulting residuals to the daily percent change of oil and look at a distribution across all 500 stocks. Next, we’ll select the ones with the highest correlation and create an index that tracks the stocks over time. Lastly, we’ll compare this index with an oil trust to see how they compare.
Removing market and sector movements
The first thing we need to do is “clean” our stock’s returns. The best way to remove the S&P 500 and sector price movements is to do regressions of our stock against the targets and use the residual as our new series. What this basically does is remove the parts of returns that can be explained by the S&P 500 and the stock’s sector and leaves us with what we’re interested in: the movements that don’t fall into one of those two categories.
Here’s an example of how you’d do so using Palantir Finance, a metric called “removeMarketSector”. This metric becomes built into the system and we will use it in other applications, notably Instrument Explorer and Chart.
Note that all the regressions are done in daily percent changes, and by default the regression is run over the past year.
Disclaimer: Palantir Technologies is not affiliated with, endorsed or sponsored by Palantir.net, Inc.
Palantir.net's website is located at www.palantir.net