Skip to content

Commit 9f025d5

Browse files
committed
fixed a mistake in the pairs trading lecture
1 parent f5445c5 commit 9f025d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@
978978
"source": [
979979
"# Get the spread between the 2 stocks\n",
980980
"# Calculate rolling beta coefficient\n",
981-
"rolling_beta = pd.ols(y=S1, x=S2, window_type='rolling', window=30)\n",
981+
"rolling_beta = pd.ols(y=S2, x=S1, window_type='rolling', window=30)\n",
982982
"spread = S2 - rolling_beta.beta['x'] * S1\n",
983983
"spread.name = 'spread'\n",
984984
"\n",

0 commit comments

Comments
 (0)