-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmain.py
executable file
·28 lines (23 loc) · 896 Bytes
/
main.py
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
#!/usr/bin/env python
# coding: UTF-8
import argparse
import signal
import time
from src.factory import BotFactory
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="This is trading script on bitmex")
parser.add_argument("--test", default=False, action="store_true")
parser.add_argument("--stub", default=False, action="store_true")
parser.add_argument("--demo", default=False, action="store_true")
parser.add_argument("--hyperopt", default=False, action="store_true")
parser.add_argument("--strategy", default="doten", required=True)
args = parser.parse_args()
# create the bot instance
bot = BotFactory.create(args)
# run the instance
bot.run()
if not args.test:
# register stopping
signal.signal(signal.SIGINT, lambda x, y: bot.stop())
while True:
time.sleep(1)