Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes several changes to improve flow #13

Open
wants to merge 45 commits into
base: 5-Post
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
29ef30b
Includes several changes to improve flow
neutropolis Jun 7, 2024
2fe16e9
Address Christian's suggestions
neutropolis Jun 10, 2024
4eae809
Update PostPairsTrading.md
neutropolis Jun 10, 2024
df6fd68
Update PostPairsTrading.md
neutropolis Jun 10, 2024
24c40fc
Update PostPairsTrading.md
neutropolis Jun 10, 2024
8eee997
Update PostPairsTrading.md
neutropolis Jun 10, 2024
5f5d91a
Update PostPairsTrading.md
neutropolis Jun 10, 2024
27f719c
Update PostPairsTrading.md
neutropolis Jun 10, 2024
4eedcee
Update PostPairsTrading.md
neutropolis Jun 10, 2024
575786a
Update PostPairsTrading.md
neutropolis Jun 10, 2024
a8c23af
Minor change to Tick introduction and new illustrations
nipsn Jun 10, 2024
43db9d6
ML model refactor and some minor changes
chraberturas Jun 10, 2024
0ab2ce1
minor tweaks
nipsn Jun 11, 2024
6de9863
My revision (til step 1, included)
neutropolis Jun 13, 2024
d50c65a
Minor changes
neutropolis Jun 13, 2024
f5bc8a2
unique syms
nipsn Jun 14, 2024
1fddb78
Minor changes on last sections
neutropolis Jun 14, 2024
8d3f0a2
Merge branch 'neutropolis/5-Post' of github.com:hablapps/pairstrading…
neutropolis Jun 14, 2024
348fed4
refactored matrix/pvalues code
chraberturas Jun 14, 2024
2ca7900
Merge branch 'neutropolis/5-Post' of https://github.com/hablapps/pair…
chraberturas Jun 14, 2024
e2f1c59
very picky minor change
nipsn Jun 14, 2024
2991690
My last changes on this revision
neutropolis Jun 14, 2024
b50cef7
pvalues code and explaination refactored and title
chraberturas Jun 14, 2024
2f5d63b
done some tasks
nipsn Jun 17, 2024
75c4273
new diagrams
nipsn Jun 26, 2024
6ef1087
spreads calculation refactored
chraberturas Jun 26, 2024
9e9554b
replaced linear regression image
chraberturas Jun 26, 2024
fc803d1
ms diagram
nipsn Jun 26, 2024
610a24f
Updates introduction and first section
neutropolis Jun 27, 2024
7015745
Update PostPairsTrading.md
neutropolis Jun 27, 2024
244a805
Fixes link
neutropolis Jun 27, 2024
d836d31
Updates real-time section
neutropolis Jun 27, 2024
15825f9
adf test refactored into cointegration test
chraberturas Jun 27, 2024
fb70c2e
Minor changes after re-reading article
neutropolis Jun 28, 2024
9939ce5
Updates conclusions
neutropolis Jun 28, 2024
58ae84f
Supplies several references
neutropolis Jun 28, 2024
22e5039
adressed coint task and math latex flavour
chraberturas Jun 28, 2024
84e6565
Merge branch 'neutropolis/5-Post' of https://github.com/hablapps/pair…
chraberturas Jun 28, 2024
cd274ce
(Hopefully) my final changes
neutropolis Jun 28, 2024
512dfab
Merge branch 'neutropolis/5-Post' of github.com:hablapps/pairstrading…
neutropolis Jun 28, 2024
eb12368
tacit programming comment
chraberturas Jun 28, 2024
ca34a55
added Jesus in acknowledgements
chraberturas Jun 28, 2024
7552ca5
Update PostPairsTrading.md
neutropolis Jun 28, 2024
9a88eab
Minor changes (Javier's feedback)
neutropolis Jul 1, 2024
758de2b
adressed Javier tasks
chraberturas Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ADF.q
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ rs:{([]sym:x;close:first((5#" "),"F";csv) 0:`$":data/stocks/",string[x],".csv")}
t: `sym xgroup raze rs each syms

// We apply our cointegration function on every pair of symbols form our crossedList
matrix: fcoint .' 0f^neg[trange]#''@\:[;`close](@/:[t]')syms cross syms
u:ps where (<).' ps:syms cross syms
matrix: fcoint .' 0f^neg[trange]#''@\:[;`close](@/:[t]')u

// We create a p-values matrix from the ADF test results and set values above the diagonal to 1
pvalues: ones (count[syms]*til count syms)_matrix
pvalues: m,'not null reverse m:-1 rotate sums[til count[syms]] _ reverse matrix

show pvalues


pyhm:.pykx.import[`seaborn]`:heatmap

pyhm[pvalues;`xticklabels pykw syms;`yticklabels pykw syms;`cmap pykw `RdYlGn_r]
pyhm[pvalues;`xticklabels pykw reverse syms;`yticklabels pykw reverse syms;`cmap pykw `RdYlGn_r]

pyshow:.pykx.import[`matplotlib.pyplot]`:show

Expand Down
316 changes: 170 additions & 146 deletions PostPairsTrading.md

Large diffs are not rendered by default.

Binary file removed resources/ADFgif.gif
Binary file not shown.
Binary file modified resources/cointegration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/general-architecture-bottom.png
Binary file not shown.
Binary file added resources/general-architecture-ms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/general-architecture-rpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/general-architecture-top.png
Binary file not shown.
Binary file modified resources/general-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/heatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/linear_regression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/tfg18.png
Binary file not shown.