Skip to content

Commit

Permalink
Merge pull request hackingthemarkets#1 from mkorenkov/master
Browse files Browse the repository at this point in the history
/snapshot endpoint fixed
  • Loading branch information
hackingthemarkets authored Aug 10, 2020
2 parents 5c1e10c + c502300 commit 2747eab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
@app.route('/snapshot')
def snapshot():
with open('datasets/symbols.csv') as f:
symbols = f.read().splitlines()
for symbol in symbols:
for line in f:
if "," not in line:
continue
symbol = line.split(",")[0]
data = yf.download(symbol, start="2020-01-01", end="2020-08-01")
data.to_csv('datasets/daily/{}.csv'.format(symbol))

Expand Down Expand Up @@ -47,4 +49,4 @@ def index():
except Exception as e:
print('failed on filename: ', filename)

return render_template('index.html', candlestick_patterns=candlestick_patterns, stocks=stocks, pattern=pattern)
return render_template('index.html', candlestick_patterns=candlestick_patterns, stocks=stocks, pattern=pattern)

0 comments on commit 2747eab

Please sign in to comment.