EVAlgoTrade

📢 Tip: You can click the YouTube or GitHub icons in the top-right corner to watch a short explanation of the strategy and see the source code for this analysis.

Welcome to EVAlgoTrade

TSLA (Tesla) and RIVN (Rivian) are both considered electric vehicle (EV) manufacturers. But are they truly comparable? Rivian is a straightforward EV company — focused solely on producing electric vehicles. Tesla, on the other hand, is more complex. While it manufactures EVs, it’s also heavily influenced by its CEO, Elon Musk, who brings unpredictability and attention that affect its stock beyond fundamentals. This raises a key question: can we really treat TSLA as just another EV manufacturer? So, what is the opportunity?

Look at the statistics from past three years:

                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  close   R-squared:                       0.029
Model:                            OLS   Adj. R-squared:                  0.027
Method:                 Least Squares   F-statistic:                     22.17
Date:                                   Prob (F-statistic):           2.97e-06
Time:                                   Log-Likelihood:                -371.88
No. Observations:                 753   AIC:                             747.8
Df Residuals:                     751   BIC:                             757.0
Df Model:                           1                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const          1.4184      0.305      4.652      0.000       0.820       2.017
close          0.2638      0.056      4.709      0.000       0.154       0.374
==============================================================================
Omnibus:                      397.076   Durbin-Watson:                   0.013
Prob(Omnibus):                  0.000   Jarque-Bera (JB):               53.740
Skew:                           0.306   Prob(JB):                     2.14e-12
Kurtosis:                       1.843   Cond. No.                         119.
==============================================================================

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.

Cointegration test result:
========================================
Test Statistic: -2.4426285226999096
p-value: 0.30493998944930345

These results suggest that TSLA and RIVN do not share a strong long-term statistical relationship — they’re almost not cointegrated. That means their prices don’t tend to move together over time, unlike traditional pair trading candidates.

Strategy Overview

This creates an opportunity for a “reversed” pair trading strategy, built on the assumption that any short-term correlation between them is likely temporary and will break down.

  1. Short-term signal direction
    • If TSLA and RIVN prices become closely correlated in the short term, we interpret this as a mispricing opportunity.
  2. Positioning for divergence
    • We bet on the two stocks reverting to their independent paths.
    • Long TSLA, since it tends to recover thanks to the “Elon factor” and broader investor sentiment.
    • Short RIVN, which is more purely tied to EV fundamentals and lacks the same speculative upside.
  3. We exit when
    • The short-term relationship fades (as expected).
    • Or a predefined time threshold is reached, indicating the opportunity has likely passed.