Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Lawrence Tang
/
stocks
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
89400317
authored
May 25, 2021
by
Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Barrier
parent
9f3880c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
.gitignore
correlation_test_all.py
.gitignore
View file @
89400317
historical_stock_prices.csv
stocks/*
.idea/*
\ No newline at end of file
correlation_test_all.py
View file @
89400317
...
...
@@ -48,12 +48,13 @@ def main():
av_gain_dict
[
i
[
"ticker"
]]
+=
float
(
i
[
"open"
])
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
count_dict
[
i
[
"ticker"
]]
+=
1
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
=
LEN_PREV
:
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
LEN_PREV
:
prev_price_dict
[
i
[
"ticker"
]]
.
pop
(
0
)
prev_price_dict
[
i
[
"ticker"
]]
.
append
(
float
(
i
[
"open"
]))
for
i
in
av_gain_turn_dict
:
writer
.
writerow
([
i
,
av_gain_pos_dict
[
i
]
/
count_pos_dict
[
i
],
av_gain_turn_dict
[
i
]
/
count_turn_dict
[
i
],
av_gain_dict
[
i
]
/
count_dict
[
i
]])
if
count_pos_dict
[
i
]
>
0
and
count_turn_dict
[
i
]
>
0
and
count_dict
[
i
]
>
0
:
writer
.
writerow
([
i
,
av_gain_pos_dict
[
i
]
/
count_pos_dict
[
i
],
av_gain_turn_dict
[
i
]
/
count_turn_dict
[
i
],
av_gain_dict
[
i
]
/
count_dict
[
i
]])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment