Commit 6bdf9009 by Lawrence

Fix bug

parent e7532e0a
Showing with 2 additions and 2 deletions
......@@ -26,7 +26,7 @@ def main():
count_dict = {}
for i in reader:
if not i["ticker"] in prev_price_dict:
prev_price_dict[i["ticker"]] = []
av_gain_turn_dict[i["ticker"]] = 0
......@@ -53,7 +53,7 @@ def main():
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_dict[i], av_gain_turn_dict[i] / count_turn_dict[i], av_gain_dict[i] / count_dict[i]])
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]])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment