From 2fefd3b6136f8f383b12c8c66eb5e906cbeade85 Mon Sep 17 00:00:00 2001 From: lin Date: Sat, 14 Nov 2020 22:20:24 +0800 Subject: [PATCH] no_ui demo --- example/no_ui.py | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/example/no_ui.py b/example/no_ui.py index 2304549..443a388 100644 --- a/example/no_ui.py +++ b/example/no_ui.py @@ -21,36 +21,13 @@ "key": "", "secret": "", "会话数": 3, - "服务器": ["TESTNET", "REAL"], - "合约模式": ["反向", "正向"], + "服务器": "REAL", + "合约模式": "正向", "代理地址": "", "代理端口": 0, } -# Chinese futures market trading period (day/night) -DAY_START = time(8, 45) -DAY_END = time(14, 29) - -NIGHT_START = time(20, 45) -NIGHT_END = time(2, 45) - - -def check_trading_period(): - """""" - current_time = datetime.now().time() - - trading = False - if ( - (current_time >= DAY_START and current_time <= DAY_END) - or (current_time >= NIGHT_START) - or (current_time <= NIGHT_END) - ): - trading = True - - return trading - - def run(): """ Running in the child process. @@ -85,12 +62,5 @@ def run(): while True: sleep(10) - trading = check_trading_period() - if not trading: - print("关闭进程") - main_engine.close() - sys.exit(0) - - if __name__ == "__main__": run()