Skip to main content

Super Bowl Indicator for ThinkOrSwim (Free Download)

IndicatorFreeBeginner25 min video93 lines of codeFeb 12, 2023

Free Super Bowl indicator for ThinkOrSwim. Bubbles mark each AFC or NFC winner since 1967 with that year's change, and labels total the wins and averages.

Super Bowl Indicator on a SPX chart in ThinkOrSwim
On this page

Overview

In this tutorial I build a Super Bowl indicator for ThinkOrSwim to test the Super Bowl stock market theory. The theory says an AFC winner points to a market decline as the year closes out, and an NFC winner to a rally. The indicator puts a bubble on the last day of each year with the winning conference and the year's change, and two labels add up each conference's wins and average change.

It's a fun, non-scientific theory, and I say so in the video. What carries over to other projects is the thinkScript: turning an Excel sheet into a long if/else chain, reading yearly prices on a daily chart, and building your own averages with TotalSum. It runs on SPX back to the first Super Bowl in 1967, and on any other symbol as far back as ThinkOrSwim has data.

Key Takeaways

  • The Super Bowl indicator is a free ThinkOrSwim study that marks the last trading day of each year from 1967 to 2022 with the Super Bowl winner's conference: a pink bubble for the AFC, a cyan bubble for the NFC.
  • Each bubble shows that year's change: the yearly candle's close minus its open, divided by the open. Two labels show each conference's wins and average year change on the loaded chart.
  • The theory says an AFC win points to a market decline by year-end and an NFC win to a rally. In the video I call it non-scientific and treat it as a fun test.
  • In the video, a 5-year SPX chart covering the 2018 to 2022 games showed 2 AFC wins and 3 NFC wins, an AFC average of .231 (23.1%) and a 15.76% change in the 2020 AFC bubble. The video doesn't read out totals for the full history back to 1967.
  • The winners come from an Excel sheet in the download, where one formula writes each year's line of thinkScript, so all 56 lines paste in at once.

What Is the Super Bowl Indicator Theory?

The Super Bowl indicator theory links the conference of the Super Bowl winner to how the stock market finishes the year. The NFL has two conferences, and each Super Bowl puts one team from each against the other. The theory gives each conference a market direction.

Winning conferenceFull nameWhat the theory saysColor on the chart
AFCAmerican Football ConferenceA market decline as the year closes outPink
NFCNational Football ConferenceA market rally as the year closes outCyan

I recorded the video on Super Bowl day, with the Philadelphia Eagles playing for the NFC and the Kansas City Chiefs for the AFC. The theory has no scientific basis, and the point of the tutorial is to test it with real data and learn some thinkScript along the way. The same approach works for any theory like it in the future.

What the Super Bowl Indicator Shows

The Super Bowl indicator draws two things on a price chart: a bubble for every year and a pair of labels at the top.

  • Chart bubbles. On the last trading day of each year, a bubble at the close reads "Winner: AFC" or "Winner: NFC", with "Year Change" and that year's percentage change on the line below. AFC bubbles are pink and NFC bubbles are cyan, so you can scan the years at a glance.
  • Labels. The pink label reads "AFC Wins" with the number of AFC winners on the chart and "Avg Pct", the average year change in those years. The cyan label shows the same for the NFC.

The media usually applies the theory to the S&P 500, and I use SPX in the video. The section on testing other markets below covers DIA, QQQ and single stocks.

How to Add the Indicator to ThinkOrSwim

The Super Bowl indicator is a study, so it goes on the Studies tab. You can import the download or paste the code into a new study.

  1. Click the Studies icon and click Create. I named mine TI_SuperBowl indicator.
  2. Delete the starter code, paste in the code from the Code tab on this page, and click OK and Apply.
  3. Load SPX on a daily chart and set the time span. Use 5 years for a quick look, or the maximum available data to reach back to the first Super Bowl.
  4. Double-click the study to turn the chart bubbles or the labels off and on.

To import the download's .ts file instead, follow our guide on how to import a study into ThinkOrSwim.

Building the Winners List in Excel

The Super Bowl indicator needs every winner since 1967 inside the code, and Excel writes that code for you. I copied the winners from Wikipedia into a sheet and marked each one as NFC or AFC. The sheet is in the download, with these columns:

ColumnWhat it holdsFirst row
YearThe year the game was played2022
Super BowlThe game's number56
RomanThe Roman numeralLVI
WinnerThe winning teamLos Angeles Rams
NFC1 if the winner is an NFC team1
AFC1 if the winner is an AFC teamEmpty
FunctionThe thinkScript line Excel writes for that yearThe formula below

The last row is 1967, when the Green Bay Packers won the first Super Bowl. The AFC and NFC date from the 1970 merger of the NFL and AFL, so for the first 4 games the sheet lists the NFL champion as NFC and the AFL champion as AFC.

The formula in the Function column is mostly text, with the year and the conference dropped in:

This step’s code is free with an account. Create one or sign in.

For the first row, it produces if getYear() == 2022 and getYear()[-1] == 2023 then nfc else.

The A2+1 part adds 1 to the year, and Excel's own IF writes nfc when the NFC column has a 1 and afc when it doesn't. Fill the formula down to the last row, copy the whole column, and paste it into the thinkScript editor. The trick works for any data you want to type into a study row by row.

How the Code Works

The Super Bowl indicator code has 4 parts: two inputs, the winner classification, the stats, and the bubbles and labels. The snippets below come from the downloaded file, in the order I built them in the video.

Step 1: Give Each Conference a Value

This step’s code is free with an account. Create one or sign in.

NFC is 1 and AFC is -1. The two values are different, and both are whole ones, so the code can count and compare them.

Step 2: Classify the Winners

This step’s code is free with an account. Create one or sign in.

This is the column pasted from Excel, with 0; added for the final else.

getYear() returns the year of the current bar, and getYear()[-1] returns the year of the next bar, because a negative offset looks forward. Both checks together are true on one bar only: the last trading day of that year.

On that bar, SuperBowlWinner is 1 or -1, depending on the conference. On every other bar it's 0, which thinkScript reads as false.

Step 3: Measure Each Year's Change

This step’s code is free with an account. Create one or sign in.

A plain (close - open) / open would measure one daily bar.

Adding period = AggregationPeriod.Year to each price makes the code read the yearly candle instead: its close minus its open, divided by its open. That gives the change from the first open of the year to the last close. Our tutorial on aggregation periods explains how to read a larger timeframe on a smaller chart.

To check it, I looked at the 2020 bubble, which showed 15.76%. Taking the open of the first candle of 2020, on January 2, and the close at the end of the year gave the same 15.76%.

The year change starts at the first open in January. The Super Bowl is played in January or February, so the first few weeks of each year's change come before the game.

Step 4: Count the Wins and Average the Changes

This step’s code is free with an account. Create one or sign in.

TotalSum adds up a value across every bar on the chart.

SuperBowlWinner == afc is 1 on the last day of each AFC year and 0 on every other bar, so its total sum is the number of AFC winners on the chart.

For the averages, the code first splits the year changes by conference. AFCPctChange holds the year change in AFC years and 0 everywhere else, and NFCPctChange does the same for NFC years. Summing one list together would mix the two conferences. The average is then the sum of each conference's changes divided by its number of wins. The built-in Average function would give errors here, so I built the average from scratch.

When I first tested the count with a label, it showed 11 AFC winners on the chart I had loaded. On a 5-year chart it showed 2, and the Excel sheet agreed: since 2018, 2 AFC winners and 3 NFC winners.

Step 5: Bubbles, Labels and On/Off Switches

AddChartBubble takes 4 arguments, and the full line is on the Code tab. Here they are one at a time:

  • Condition: chartBubblesOn and SuperBowlWinner. The bubbles input is on and the bar is the last day of a Super Bowl year.
  • Price: close, so the bubble sits at that day's close.
  • Text: "Winner: " + if SuperBowlWinner == afc then "AFC \nYear Change: " + AsPercent(yearChange) else "NFC \nYear Change: " + AsPercent(yearChange). The \n starts a new line inside the bubble.
  • Color: if SuperBowlWinner == afc then color.pink else color.cyan.

I first tested the bubbles in yellow before adding the color logic.

This step’s code is free with an account. Create one or sign in.

Each label joins the number of wins, a divider and the average change. AsPercent formats the average as a percentage: before I added it, the AFC average on the 5-year chart showed as .231 in decimal form.

The two inputs at the top switch the bubbles and labels on and off from the settings window:

InputDefaultWhat it controls
chartBubblesOnyesThe yearly AFC and NFC bubbles
labelsOnyesThe AFC Wins and NFC Wins labels

Our AddLabel tutorial covers labels in more detail.

Results From the Video

The Super Bowl indicator results in the video come from SPX charts and serve mostly to check the code. They are historical figures from the charts I had loaded on Super Bowl day, most likely in February 2023, since the sheet ends with the 2022 game.

ChartGames coveredAFCNFCOther figures shown
SPX, the time span I loaded first (not stated)Not stated11 winsNot read outNone
SPX, 5 years2018 to 2022 (5 games)2 wins, average .231 (23.1%)3 wins, average not read out2020 bubble: AFC, year change 15.76%
SPX, maximum data (back to the 1920s, I believe)1967 to 2022Not read outNot read outThe first bubble is 1967, an NFC win by the Green Bay Packers
QQQ, maximum dataFrom 2000Not read outNot read outNone

On the 5-year chart, the AFC years averaged a gain of 23.1%, while the theory calls for a decline after an AFC win. Two AFC years is a tiny sample, and the video gives no win counts or averages for the full history, so load the maximum data yourself to see the totals since 1967.

Testing Other Markets and Time Spans

The Super Bowl indicator's labels count only the years on the loaded chart, so the time span and the symbol decide what you're testing.

  • SPX. When I switched to the maximum available data, the chart loaded data back to what I believe is the 1920s, and the first bubble appeared in 1967. As far as I know, SPX is the only market in ThinkOrSwim that reaches back to the first Super Bowl.
  • QQQ. The data starts in 2000, so the labels cover the games from then on.
  • Other markets. DIA, Apple or any stock works, as far back as ThinkOrSwim allows for that symbol.
  • Shorter spans. A 5-year chart checks the recent games. Zooming in on single years, such as bear market years, shows what happened in them.

Adding Newer Super Bowls

The Super Bowl indicator download covers the games from 1967 to 2022, the last game before I recorded. Later games need one new line each, an edit that isn't shown in the video. The chain starts with the newest year, so add the new line at the top:

  1. Look up the winner, and whether the team plays in the AFC or the NFC.
  2. In the code, change def SuperBowlWinner = if getYear() == 2022 to start with the new year instead. For the game played in 2023, the new first line is def SuperBowlWinner = if getYear() == 2023 and getYear()[-1] == 2024 then, followed by nfc or afc and else.
  3. Put the old 2022 check back on the line below it, starting with if getYear() == 2022.

You can also add a row to the Excel sheet with the year and a 1 in the NFC or AFC column, fill the formula down, and paste the new column over the old chain.

How I Use the Super Bowl Indicator

The Super Bowl indicator is a fun way to bring a lot of data into ThinkOrSwim and test a theory for yourself on the markets you follow. I treat it as entertainment and a thinkScript exercise, and in the video I ask you not to take it to heart.

Any seasonal read is background, and it isn't an entry signal by itself. Decide where your stop goes before you enter a trade, and size it so a stop-out costs a small, fixed share of your account.

For seasonal patterns by month, our Seasonal Analysis indicator shows how often each month has closed higher and its average change. For simulated trades instead of labels, our free event backtesters place orders with AddOrder:

  • The Santa Claus rally backtester turns a calendar window into one trade a year, from the first bar on or after December 18 to the first bar on or after December 24.
  • The election backtester takes the same approach as this indicator: a list of outside dates, here 6 election days, typed into the code.
  • The SPY meltdown backtester trades a price event instead of a date, the session after SPY closes more than 3% below its open.

The rest are on our ThinkOrSwim backtesters page, and more free studies are on the indicators page.

Full thinkScript code

Super Bowl Indicator.tsthinkScript · 93 lines
The full code is free with an account

Create a free account or sign in to copy all 93 lines and download the file.

Download

Super Bowl Indicator

Download the Super Bowl Indicator for ThinkOrSwim. The download is a .zip with three files: TI_SuperBowl_IndicatorSTUDY.ts, the study and the same code as the Code tab on this page; Super Bowl Winners - Excel Sheet.xlsx, the 56 winners from 1967 to 2022 with their conference and the formula that writes each line of code; and a short text file that links to our import guide. If you haven't imported a study before, here's how to import into your ThinkOrSwim platform.

Download free

Video: Super Bowl Indicator, built line by line

25 minutes on YouTube.

Watch on YouTube

Questions

What is the Super Bowl indicator?

The Super Bowl indicator is a stock market theory that links the Super Bowl winner to how the market ends the year: an AFC winner points to a decline and an NFC winner to a rally. Our free ThinkOrSwim study tests it by tagging each year since 1967 with the winning conference and that year's percentage change.

Does the Super Bowl stock market theory work?

The video doesn't give a verdict for the full history, and I call the theory non-scientific. On a 5-year SPX chart, the 2 AFC years averaged a 23.1% gain, where the theory calls for a decline. Load the maximum data on SPX to see the win counts and averages back to 1967.

How do I add the Super Bowl indicator to ThinkOrSwim?

Import the .ts file from the download, or click the Studies icon, click Create, delete the starter code and paste in the code from the Code tab. Click OK and Apply, then load SPX on a daily chart. Set the time span to the maximum available data to reach back to the first Super Bowl in 1967.

What do the pink and cyan bubbles mean?

Pink bubbles mark years when an AFC team won the Super Bowl, and cyan bubbles mark NFC years. Each bubble sits on the last trading day of the year, at the close, and shows the winning conference and the year change. The labels at the top use the same two colors for the AFC and NFC totals.

How does the Super Bowl indicator calculate the year change?

It reads the yearly candle with AggregationPeriod.Year: the close of the year minus the open of the year, divided by the open. That measures the change from the first open in January to the last close in December. In the video, the 2020 bubble on SPX showed 15.76%, which matched the chart.

Why do the AFC and NFC totals change when I change the chart?

The labels use TotalSum, which adds up only the bars loaded on the chart. A 5-year chart counts 5 games, and in the video that was 2 AFC wins and 3 NFC wins. The maximum data on SPX counts every game back to 1967, and a symbol with a shorter history counts fewer.

Can I test the Super Bowl theory on QQQ or individual stocks?

Yes. The study works on any symbol, as far back as ThinkOrSwim has data for it. In the video I note that QQQ data starts in 2000, so its labels cover the games from then on, and I suggest testing DIA, QQQ or Apple alongside the S&P 500.

How do I add newer Super Bowl winners to the code?

Add one line per game at the top of the SuperBowlWinner chain, in the same format: the year, the next year, then nfc or afc and else. The download covers the games from 1967 to 2022. You can also add rows to the Excel sheet, fill the formula down and paste the new column into the study.

Get each new indicator by email

One email on Sundays with the week's new tool and its code. A free account also unlocks every .txt download.

No credit card. Unsubscribe anytime.