-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (24 loc) · 1.27 KB
/
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
29
30
31
32
33
34
35
36
37
import logging
from connectors.binance import BinanceClient
from connectors.bitmex import BitmexClient
from interface.root_component import Root
# Create and configure the logger object
logger = logging.getLogger()
logger.setLevel(logging.DEBUG) # Overall minimum logging level
stream_handler = logging.StreamHandler() # Configure the logging messages displayed in the Terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s')
stream_handler.setFormatter(formatter)
stream_handler.setLevel(logging.INFO) # Minimum logging level for the StreamHandler
file_handler = logging.FileHandler('info.log') # Configure the logging messages written to a file
file_handler.setFormatter(formatter)
file_handler.setLevel(logging.DEBUG) # Minimum logging level for the FileHandler
logger.addHandler(stream_handler)
logger.addHandler(file_handler)
if __name__ == '__main__': # Execute the following code only when executing main.py (not when importing it)
#Enter APIs of your accounts on binance and bitmex
binance = BinanceClient("",
"",
testnet=True, futures=True)
bitmex = BitmexClient("", "", testnet=True)
root = Root(binance, bitmex)
root.mainloop()