Skip to content

Commit

Permalink
When running from project root download the files to the testdata fol…
Browse files Browse the repository at this point in the history
…der instead of cwd
  • Loading branch information
shusso committed Oct 26, 2017
1 parent e09505b commit 752520c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion freqtrade/tests/testdata/download_backtest_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
from urllib.request import urlopen

CURRENCIES = ["ok", "neo", "dash", "etc", "eth", "snt"]
OUTPUT_DIR = 'freqtrade/tests/testdata/'

for cur in CURRENCIES:
url1 = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-'
url = url1+cur+'&tickInterval=fiveMin'
x = urlopen(url)
json_data = x.read()
json_str = str(json_data, 'utf-8')
with open('btc-'+cur+'.json', 'w') as file:
output = OUTPUT_DIR + 'btc-'+cur+'.json'
with open(output, 'w') as file:
file.write(json_str)

0 comments on commit 752520c

Please sign in to comment.