-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbulk-import.py
More file actions
42 lines (30 loc) · 790 Bytes
/
bulk-import.py
File metadata and controls
42 lines (30 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import itertools
import threading
import time
import sys
from config import config
from jesse import research
exchange = config['exchange']
start_date = config['import_start_date']
pairs = config['pairs']
current_pair = ''
done = False
def animate():
for c in itertools.cycle(['', '.', '..', '...']):
if done:
break
sys.stdout.write('\rImporting ' + current_pair + c)
sys.stdout.flush()
time.sleep(0.5)
sys.stdout.write('\rDone!')
t = threading.Thread(target=animate)
t.start()
for pair in pairs:
current_pair = pair
try:
research.import_candles(exchange, pair, start_date, show_progressbar=False)
except Exception as e:
print("An exception occurred")
print(e)
continue
done = True