Skip to content

Analyzing ‘South Park’ for Stock Market Strategies – The Portfolio

Is a South Park Stock Market trading strategy viable?

After the previous post, we gathered the data needed to construct our portfolio. First, we will have to decide on a strategy for trading. Then, to assess the performance of this strategy, we need to get price data for all the tickers mentioned, and for the SP500 as well.

Step 1: Choose a strategy

  1. each time a South Park episode airs, you note all the publicly traded companies that are mentioned and invest 100 dollars equally split between them;
  2. at the same time, you invest 100 dollars in the SP500;
Date Episode Title Tickers
2000-12-13 The Wacky Molestation Adventure DENN
2009-10-07 Dead Celebrities CMG, MCD, TWTR

Notes:

  1. Given the usual air time of an episode, the most likely scenario in which we find ourselves is the one in which we are able to trade at the start of the next trading day. This means that our buy price will the open price.
  2. We want to compare the two strategies on different timelines, so we will look at the performance of the two after 1, 3, 6, 12 and 24 months
  3. There are some cases when companies are mentioned before being publicly traded. This is the case with Twitter in 2010 (TWTR had its IPO in September 2013) and Beyond Meat in 2017 (BYND has it’s IPO 2019). For the most part, IPOs are not the best time to start trading a ticker. With the most example of DoorDash, which had the most ridiculous of IPO of 2020,and that ‘holds no value’ , we are not going to invest in a company that is not already traded.

Step 2: Get historical prices

A good place to get free historical prices is the Yahoo Finance API. First, we get the open price of SP500, for its entire history. We save the data, as well as the trading days, that will be used to index the prices for the tickers.

url = 'https://query1.finance.yahoo.com/v7/finance/download/SPY?period1=884217600&period2=2609804800&interval=1d&events=history&includeAdjustedClose=true'

df = pd.read_csv(url, header=[0])
df = df[['Date', 'Open']]
df = df.rename(columns={'Open':'SPY'})
df = df.set_index('Date')

pd.DataFrame(df.index).to_pickle('tradingDays.pkl')
df.to_pickle('SPY.pkl')

Now we have to loop through all the tickers that are present and get the open price for them as well.

days = pd.read_pickle('tradingDays.pkl')
days = days['Date']

df = pd.DataFrame(days)
df = df.set_index('Date')

for stock in stocks:
     url = 'https://query1.finance.yahoo.com/v7/finance/download/' + stock.upper() + '?period1=884217600&period2=2609804800&interval=1d&events=history&includeAdjustedClose=true'
     _df = pd.read_csv(url, header=[0])
    _df = _df[['Date', 'Open']] _df = _df.rename(columns={'Open':stock}) _df = _df.set_index('Date')  _df = _df.reindex(days)  df = df.merge(_df, left_index=True, right_index=True) df.to_pickle('prices.pkl')

Step 3: Compute forward returns for each day

We want to see how, for a period of 1, 3, 6, 12, and 24 after the air date, each stock mentioned performed. For this, we compute the forward returns of each ticker like this:

returns_20  = (prices.shift(-20) / prices - 1) * 100
returns_63  = (prices.shift(-63) / prices - 1) * 100
returns_125 = (prices.shift(-125) / prices - 1) * 100
returns_252 = (prices.shift(-252) / prices - 1) * 100
returns_504 = (prices.shift(-504) / prices -1) * 100

Once we have the returns for all the trading days, we have to get the average returns for all the stocks mentioned in one episode at one time

def get_returns_for_episode(x):
     time_returns = []
     for _df in [returns_20, returns_63, returns_125, returns_252, returns_504]:
         _df = _df[x['tickers']]
         episode_returns = _df[_df.index > x['Date']].head(1).mean(axis=1).values[0]
         time_returns.append(episode_returns)
 return time_returns
data['ret'] = data.apply(lambda row : get_returns_for_episode(row), axis = 1)
data[['ret20','ret63', 'ret125', 'ret252', 'ret504']] = pd.DataFrame(data.ret.tolist(), index= data.index)
data.drop(columns=['ret'], inplace=True)

Step 4: Get SP500 forward returns

Now we do the same thing for SP500 to have a fair comparison.

returns_20  = (spy_prices.shift(-20) / spy_prices - 1) * 100 
returns_63  = (spy_prices.shift(-63) / spy_prices - 1) * 100
returns_125 = (spy_prices.shift(-125) / spy_prices - 1) * 100
returns_252 = (spy_prices.shift(-252) / spy_prices - 1) * 100
returns_504 = (spy_prices.shift(-504) / spy_prices - 1) * 100
def get_spy_returns_for_episode(x):
     time_returns = []
     date = x['Date']
     for _df in [returns_20, returns_63, returns_125, returns_252, returns_504]:
         spy_returns = _df[_df.index > x['Date']].head(1)['SPY'].values[0]
         time_returns.append(spy_returns)
 return time_returns
data['spy_ret'] = data.apply(lambda row : get_spy_returns_for_episode(row), axis = 1)
data[['spy_ret20','spy_ret63', 'spy_ret125', 'spy_ret252', 'spy_ret504']] = pd.DataFrame(data.spy_ret.tolist(), index= data.index)
data.drop(columns=['spy_ret'], inplace=True)

Step 5: Compare results

Now that we have all the data that we need, we just have to compare the results between the two strategies. First, there is a straightforward way of comparing the average returns for both the South Park strategy and the more conservative SP500 strategy.

ret20          6.382170
ret63         12.152171
ret125        21.687816
ret252        22.360691
ret504        45.846595
spy_ret20      1.390939
spy_ret63      3.424895
spy_ret125     6.009562
spy_ret252     8.880834
spy_ret504    19.552549

At each time interval, on average, the novel strategy outperforms the simpler one. The difference between the two decreases once we increase the holding time, but even at the 2-year mark, we more than double the expected returns of SP500.

Then there is the comparison of the distribution of returns. As we would expect, with SP500 there are no significant losses, but the gains are also limited. Based on your risk appetite, the potential losses might or might not be acceptable for you.

Lastly, we can look at the biggest winner and losers. The best episodes are the ones that mention Netflix, Disney, and the American Express Company.

There are also some big losses that might have been incurred. Interestingly, one of these losses was during the financial crisis, when even the lower-risk strategy lost 36%.

Final notes

There are plenty of sources of alternative data in the world, and it is difficult to know when we have fallen into the confirmation bias zone and when they make predict the future. This is but a small analysis of a show that pokes fun at all the new technology, so it makes sense that in the age of innovation, these are the stocks that show the most growth.

In the end, we just have to wait and see how the last two episodes will perform in the future(and they show good promises)

1 thought on “Analyzing ‘South Park’ for Stock Market Strategies – The Portfolio”

  1. Greetings,

    If you’re looking for financial assistance to achieve your business or personal financial goals, we can help. Our loan offer comes with an attractive annual interest rate of 1.5%, and we provide loan amounts ranging from 20,000 to30,000,000 for both business and private purposes. Our team is dedicated to working with you to ensure you get the financing you need to make your dreams a reality. Our financial service is global, so your location is not a problem.

    To learn more about this great opportunity, take the next step today and email thomasbusinessup@skiff.com

    Best regards,

    Trust Finance

    Thomas Mark

Leave a Reply

Your email address will not be published. Required fields are marked *