Back to Community
Does TSLA follow the Price of Gas? Yes.

Is the stock price of Tesla Motors (TSLA) linked to the price of gasoline?

Some people think that cheap gasoline incentivizes the purchase of gas-fueled cars, lowering demand for Teslas, thus causing a drop in TSLA stock price. I try to find out whether that is true: I investigate the relationship between the price of TSLA and the price of UGA, an ETF tracking the price of gasoline.

I conclude that TSLA roughly follows UGA, with a lag of about 50 business days. However, there are some caveats to this conclusion, as well as many opportunities for further investigation. I invite you to clone the notebook, run your own tests, and try some of the suggested further projects. Please feel free to share your results if you find anything interesting!

Loading notebook preview...
Notebook previews are currently unavailable.
9 responses

Correlation doesn't equal causation. I think you could find this kind of relationship among many things.

Cameron: correlation doesn't imply causation, but correlation with a time lag and a plausible causality hypothesis makes for a much stronger argument.

For what it's worth, this was originally part of a much longer investigation -- I looked into ten commodity-tracking ETFs. None of them fit Tesla nearly as well as UGA.

That's what I'm saying. You just chose one that fit.

0.08 correlation are you kidding.
I amend your work but this was just a click bait imo especially with that title.

https://www.distractify.com/these-hilarious-graphs-show-unexpected-correlations-between-seemingly--1197695212.html
you probably already saw this.

Cameron, one of the problems that I pointed out is that there is a non-constant lag between the two time-series. If you look at the graphs, that's reasonably clear. The difficulty is in fitting to the lag, because it's not constant. You can see in the graph above that the correspondence from day 250 onwards is pretty good -- in fact, for the data from day 250 onwards, the Spearman correlation is 0.55, which is undeniably significant.

On the other hand, for the data before day 200, the lag appears to be a lot shorter. If you look at the graph above, doesn't look as if it's shifted for the best fit for those days. If you were to allow for a lag between the time-series that changes slightly over time, you could get a strong correlation. (Unfortunately this is a difficult computation for which I'd have to build my own tools.)

Beyond that, note that both time-series are quite noisy. Sure, overall the correlation I got was 0.08, but if I smooth the data with a Kalman-filtered moving average, it rises to a 0.2. Again, that's not strong, but it shows the difference made by the noise at the daily level.

I'm not a statistics major like you, I'm economics. Is your goal of all this to predict TSLA stock price and make money? Or just see if it fits for research?

You can manipulate almost any stock time series with lag to correlate with many things, and as humans we love to see patterns and predict things. That being said if you really think this is significant go ahead. I just feel like your time can be spent on better things than trying to find the correlation after applying all these filters. Especially if your end goal is to not make money, whats the point?

Mostly I'm just calling you out because your title is extremely misleading. If you didn't say Yes, i wouldn't be talking to you. And since you linked your website to your account I feel like this is for self promotion and other reasons than to help the community.

That being said have you correlated it to electricity prices? I think that would be a stronger argument since irrelevant of gas prices if it costs more to charge the Tesla it would be more predictive. Yet, even if it is correlated, the data is all just a fluke.

Lots of questions! I'll tackle these one-by-one.

Is your goal of all this to predict TSLA stock price and make money? Or just see if it fits for research?

I watched TSLA during the oil crisis of late 2014/early 2015. During this time, the price of TSLA declined considerably -- the reason being, apparently, that many investors thought that cheaper oil would reduce demand for Tesla vehicles. Testing whether this relationship holds generally was my goal with this notebook. I looked into many oil-related ETFs. I'm going to write an algorithm to trade TSLA based on gas prices some time in the near future. (Whether it'll be successful is another matter...)

Mostly I'm just calling you out because your title is extremely misleading.

I don't mean to get technical, but I never claimed that there was a strict causal relationship. In broad strokes, I think my claim that Tesla follows (read: correlates with a time lag) the price of Gas is true.

That being said have you correlated it to electricity prices?

Nope, but it's an interesting idea. Note that the electricity costs for Tesla vehicles are generally quite low (if I recall correctly, around $6k a year). Compared to the initial cost of the vehicle (over $75k), I doubt that would have much of an impact on consumer demand.

system buys TSLA and shorts CARZ if UGA is above 2 week moving average

Clone Algorithm
2
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57c387b3da444a10050508f5
There was a runtime error.

This one buy both TSLA and TLT if UGA is above 2 week moving average .

Clone Algorithm
12
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57c3917e938d060ffd38972b
There was a runtime error.

And this one just switching between TSLA and TLT on the same signal.
Twice more productive then Tesla itself.

Clone Algorithm
12
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57c395a59b24a80ff9dbdfe4
There was a runtime error.