How effective is the Super Bowl in predicting market returns? Test this stock market theory, going back to the very first Super Bowl.
Download IndicatorThe Super Bowl Indicator, also known as the Stock Market Predictor, is a popular myth that suggests that the outcome of the Super Bowl can predict the direction of the stock market for the coming year.
This theory states that:
In this tutorial, we will put this theory to test, by building our very own Super Bowl Indicator.
Along the way, we will examine the underlying assumptions and principles, and evaluate its accuracy and reliability as a predictor of stock market performance.
We begin by creating inputs in ThinkOrSwim. These inputs provide flexibility, allowing you to toggle chart bubbles and labels on or off, depending on what you wish to visualize. Here’s how you set these inputs:
input chartBubblesOn = yes;
input labelsOn = yes;
These inputs are Boolean types, defaulted to “yes,” enabling both chart bubbles and labels on the chart. Later on, we’ll use these variables to control which features are displayed.
Next, we define constant values to represent the AFC and NFC conferences. These will make it easier to distinguish which conference each Super Bowl winner belongs to, enabling more straightforward comparisons.
def nfc = 1;
def afc = -1;
These simple definitions will help us set up the rest of the code for determining Super Bowl winners based on conference affiliations.
In this step, we’ll assign each Super Bowl winner to the appropriate conference based on the year. This block uses conditional statements to tie each year to either the AFC or NFC, which will allow us to visualize changes over time. You can use data from an external source, like Wikipedia, to ensure accuracy when inputting the winning conferences.
def SuperBowlWinner = if getYear() == 2024 and getYear()[-1] == 2025 then afc
else if getYear() == 2023 and getYear()[-1] == 2024 then afc
...
else if getYear() == 1967 and getYear()[-1] == 1968 then nfc
else 0;
This code block runs through each year and assigns the appropriate value (AFC or NFC) based on the Super Bowl’s outcome. You’ll need to ensure that all years from 1967 onward are accounted for, allowing for comprehensive analysis.
Now, let’s add code to calculate the market’s annual percentage change. This is crucial for understanding how each Super Bowl outcome correlates with market performance:
def yearChange = (close(period = AggregationPeriod.Year) - open(period = AggregationPeriod.Year))/(open(period = AggregationPeriod.Year));
def totalAFCWinners = TotalSum(SuperBowlWinner == afc);
def totalNFCWinners = TotalSum(SuperBowlWinner == nfc);
def AFCPctChange = if SuperBowlWinner == afc then yearChange else 0;
def NFCPctChange = if SuperBowlWinner == nfc then yearChange else 0;
def averageAFCPctChange = TotalSum(AFCPctChange)/totalAFCWinners;
def averageNFCPctChange = TotalSum(NFCPctChange)/totalNFCWinners;
By calculating the yearChange, we can analyze each year’s performance and store the results for AFC and NFC teams separately. This step provides valuable data on annual market trends and the average percentage change for each conference’s winning years.
Chart bubbles enhance the visual appeal and functionality of the Super Bowl Indicator. With bubbles, you can quickly identify Super Bowl winners and corresponding market changes each year. Here’s the code to add these bubbles:
AddChartBubble(chartBubblesOn and SuperBowlWinner, close, "Winner: " + if SuperBowlWinner == afc then "AFC \nYear Change: " + AsPercent(yearChange) else "NFC \nYear Change: " + AsPercent(yearChange), if SuperBowlWinner == afc then color.pink else color.cyan);
This line creates a bubble that displays the conference of the Super Bowl winner, along with the market’s percentage change for that year. You can modify the colors to your preference, making it even easier to distinguish AFC and NFC years.
With labels, we can summarize the total number of wins for each conference and the average percentage changes. This step provides a high-level view of the market impact by Super Bowl outcomes.
AddLabel(labelsOn, "AFC Wins: " + totalAFCWinners + " | Avg Pct: " + AsPercent(averageAFCPctChange), color.pink);
AddLabel(labelsOn, "NFC Wins: " + totalNFCWinners + " | Avg Pct: " + AsPercent(averageNFCPctChange), color.cyan);
Labels condense all the data into a more digestible format, making it easy to see overall trends at a glance. This feature provides immediate context for both AFC and NFC performance over the years.
If you want to expand the analysis, consider creating a custom Excel sheet. Enter historical Super Bowl winners, categorizing them by conference. Then, bring this data into ThinkOrSwim for analysis. By using Excel, you can easily update the data annually and even experiment with other variables.
For this process, set up columns in Excel for the year, conference, and market change. Use ThinkOrSwim’s import function to streamline the transition from Excel to the platform.
In this part, we create our own averaging function for more flexibility. Rather than using built-in ThinkOrSwim functions, this manual approach gives greater control over how data is processed, especially for separating AFC and NFC years:
def averageAFCPctChange = TotalSum(AFCPctChange)/totalAFCWinners;
def averageNFCPctChange = TotalSum(NFCPctChange)/totalNFCWinners;
This method ensures that the averages reflect only the years in which each conference won the Super Bowl, allowing for more precise analysis.
Before finalizing the indicator, test it on different time frames and chart types. You might find certain settings reveal more about the market’s reaction to Super Bowl outcomes. Experiment with other markets, such as the Dow Jones or NASDAQ, to see how they align with the Super Bowl theory.
Adjust the input variables and test on various periods. These tests will show whether the indicator holds any significant insights or is purely coincidental fun.
By completing this tutorial, you’ve not only built a fully functioning Super Bowl Indicator, but you’ve also gained insights into the ThinkOrSwim platform’s data handling capabilities. With the flexibility of inputs, chart bubbles, and labels, this indicator is a unique tool for exploring historical trends based on a famous football event.
Remember, the Super Bowl Indicator is meant for entertainment rather than scientific analysis. The purpose here is to help you explore new coding techniques and see how even non-traditional data points can be visualized in ThinkOrSwim. You can find the full script and Excel data template on our website for further experimentation.
#TOS Indicators
#Home of the Volatility Box
#Indicator Name: Super Bowl Indicator
#Full tutorial here: tosindicators.com/indicators/superbowl
### Inputs ###
input chartBubblesOn = yes;
input labelsOn = yes;
### Classifying Super Bowl Winners ###
def nfc = 1;
def afc = -1;
def SuperBowlWinner = if getYear() == 2022 and getYear()[-1] == 2023 then nfc else
if getYear() == 2021 and getYear()[-1] == 2022 then nfc else
if getYear() == 2020 and getYear()[-1] == 2021 then afc else
if getYear() == 2019 and getYear()[-1] == 2020 then afc else
if getYear() == 2018 and getYear()[-1] == 2019 then nfc else
if getYear() == 2017 and getYear()[-1] == 2018 then afc else
if getYear() == 2016 and getYear()[-1] == 2017 then afc else
if getYear() == 2015 and getYear()[-1] == 2016 then afc else
if getYear() == 2014 and getYear()[-1] == 2015 then nfc else
if getYear() == 2013 and getYear()[-1] == 2014 then afc else
if getYear() == 2012 and getYear()[-1] == 2013 then nfc else
if getYear() == 2011 and getYear()[-1] == 2012 then nfc else
if getYear() == 2010 and getYear()[-1] == 2011 then nfc else
if getYear() == 2009 and getYear()[-1] == 2010 then afc else
if getYear() == 2008 and getYear()[-1] == 2009 then nfc else
if getYear() == 2007 and getYear()[-1] == 2008 then afc else
if getYear() == 2006 and getYear()[-1] == 2007 then afc else
if getYear() == 2005 and getYear()[-1] == 2006 then afc else
if getYear() == 2004 and getYear()[-1] == 2005 then afc else
if getYear() == 2003 and getYear()[-1] == 2004 then nfc else
if getYear() == 2002 and getYear()[-1] == 2003 then afc else
if getYear() == 2001 and getYear()[-1] == 2002 then afc else
if getYear() == 2000 and getYear()[-1] == 2001 then nfc else
if getYear() == 1999 and getYear()[-1] == 2000 then afc else
if getYear() == 1998 and getYear()[-1] == 1999 then afc else
if getYear() == 1997 and getYear()[-1] == 1998 then nfc else
if getYear() == 1996 and getYear()[-1] == 1997 then nfc else
if getYear() == 1995 and getYear()[-1] == 1996 then nfc else
if getYear() == 1994 and getYear()[-1] == 1995 then nfc else
if getYear() == 1993 and getYear()[-1] == 1994 then nfc else
if getYear() == 1992 and getYear()[-1] == 1993 then nfc else
if getYear() == 1991 and getYear()[-1] == 1992 then nfc else
if getYear() == 1990 and getYear()[-1] == 1991 then nfc else
if getYear() == 1989 and getYear()[-1] == 1990 then nfc else
if getYear() == 1988 and getYear()[-1] == 1989 then nfc else
if getYear() == 1987 and getYear()[-1] == 1988 then nfc else
if getYear() == 1986 and getYear()[-1] == 1987 then nfc else
if getYear() == 1985 and getYear()[-1] == 1986 then nfc else
if getYear() == 1984 and getYear()[-1] == 1985 then afc else
if getYear() == 1983 and getYear()[-1] == 1984 then nfc else
if getYear() == 1982 and getYear()[-1] == 1983 then nfc else
if getYear() == 1981 and getYear()[-1] == 1982 then afc else
if getYear() == 1980 and getYear()[-1] == 1981 then afc else
if getYear() == 1979 and getYear()[-1] == 1980 then afc else
if getYear() == 1978 and getYear()[-1] == 1979 then nfc else
if getYear() == 1977 and getYear()[-1] == 1978 then afc else
if getYear() == 1976 and getYear()[-1] == 1977 then afc else
if getYear() == 1975 and getYear()[-1] == 1976 then afc else
if getYear() == 1974 and getYear()[-1] == 1975 then afc else
if getYear() == 1973 and getYear()[-1] == 1974 then afc else
if getYear() == 1972 and getYear()[-1] == 1973 then nfc else
if getYear() == 1971 and getYear()[-1] == 1972 then afc else
if getYear() == 1970 and getYear()[-1] == 1971 then afc else
if getYear() == 1969 and getYear()[-1] == 1970 then afc else
if getYear() == 1968 and getYear()[-1] == 1969 then nfc else
if getYear() == 1967 and getYear()[-1] == 1968 then nfc else
0;
### Stats ###
def yearChange = (close(period = AggregationPeriod.Year) – open(period = AggregationPeriod.Year))/(open(period = AggregationPeriod.Year));
def totalAFCWinners = TotalSum(SuperBowlWinner == afc);
def totalNFCWinners = TotalSum(SuperBowlWinner == nfc);
def AFCPctChange = if SuperBowlWinner == afc then yearChange else 0;
def NFCPctChange = if SuperBowlWinner == nfc then yearChange else 0;
def averageAFCPctChange = TotalSum(AFCPctChange)/totalAFCWinners;
def averageNFCPctChange = TotalSum(NFCPctChange)/totalNFCWinners;
### Chart Bubbles and Labels ###
AddChartBubble(chartBubblesOn and SuperBowlWinner, close, “Winner: ” + if SuperBowlWinner == afc then “AFC \nYear Change: ” + AsPercent(yearChange) else “NFC \nYear Change: ” + AsPercent(yearChange), if SuperBowlWinner == afc then color.pink else color.cyan);
AddLabel(labelsOn, “AFC Wins: ” + totalAFCWinners + ” | Avg Pct: ” + AsPercent(averageAFCPctChange), color.pink);
AddLabel(labelsOn, “NFC Wins: ” + totalNFCWinners + ” | Avg Pct: ” + AsPercent(averageNFCPctChange), color.cyan);Want the .ts file and the one-click import? Both come with a free account.
Here are some resources that you may find useful:
Join 40,000+ traders using institutional-grade tools for ThinkOrSwim.
Get the Bundle