Skip to content

Commit

Permalink
fixed a mistake in the pairs trading lecture
Browse files Browse the repository at this point in the history
  • Loading branch information
quantopiancal committed Mar 11, 2019
1 parent f5445c5 commit 9f025d5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9f025d5

Please sign in to comment.