diff --git a/notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb b/notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb index 805838dc..e00047bc 100644 --- a/notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb +++ b/notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb @@ -978,7 +978,7 @@ "source": [ "# Get the spread between the 2 stocks\n", "# Calculate rolling beta coefficient\n", - "rolling_beta = pd.ols(y=S1, x=S2, window_type='rolling', window=30)\n", + "rolling_beta = pd.ols(y=S2, x=S1, window_type='rolling', window=30)\n", "spread = S2 - rolling_beta.beta['x'] * S1\n", "spread.name = 'spread'\n", "\n",