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
eb3a946d
authored
May 24, 2021
by
Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6bdf9009
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
correlation_test_all.py
correlation_test_all.py
View file @
eb3a946d
...
...
@@ -36,15 +36,15 @@ def main():
av_gain_dict
[
i
[
"ticker"
]]
=
0
count_dict
[
i
[
"ticker"
]]
=
0
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
LEN_PREV
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
>
0
:
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
=
LEN_PREV
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
>
0
:
av_gain_pos_dict
[
i
[
"ticker"
]]
+=
float
(
i
[
"open"
])
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
count_pos_dict
[
i
[
"ticker"
]]
+=
1
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
LEN_PREV
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
>
0
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
3
]
<
0
:
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
=
LEN_PREV
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
>
0
and
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
2
]
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
3
]
<
0
:
av_gain_turn_dict
[
i
[
"ticker"
]]
+=
float
(
i
[
"open"
])
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
count_turn_dict
[
i
[
"ticker"
]]
+=
1
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
LEN_PREV
and
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
0
:
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
=
LEN_PREV
and
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
0
:
av_gain_dict
[
i
[
"ticker"
]]
+=
float
(
i
[
"open"
])
-
prev_price_dict
[
i
[
"ticker"
]][
LEN_PREV
-
1
]
count_dict
[
i
[
"ticker"
]]
+=
1
...
...
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