MCPcopy Create free account
hub / github.com/FinStep-AI/ContestTrade / get_trigger_time

Function get_trigger_time

cli/utils.py:10–32  ·  view source on GitHub ↗

提示用户输入触发时间

()

Source from the content-addressed store, hash-verified

8console = Console()
9
10def get_trigger_time() -> str:
11 """提示用户输入触发时间"""
12 now = datetime.now()
13 time_options = [
14 f"A股当前时间 ({now.strftime('%Y-%m-%d %H:%M:%S')})",
15 # f"今天美股盘前 ({now.strftime('%Y-%m-%d')} 15:30:00,夏令时美东时间03:30:00)",
16 # f"今天美股盘前 ({now.strftime('%Y-%m-%d')} 16:30:00,冬令时美东时间04:30:00)"
17 ]
18
19 time_choice = questionary.select(
20 "选择触发时间:(其他时间请期待后续版本)",
21 choices=time_options,
22 style=questionary.Style([
23 ("text", "fg:white"),
24 ("highlighted", "fg:green bold"),
25 ("pointer", "fg:green"),
26 ])
27 ).ask()
28
29 if time_choice == time_options[0]:
30 return f"{now.strftime('%Y-%m-%d %H:%M:%S')}"
31 else:
32 return f"{now.strftime('%Y-%m-%d %H:%M:%S')}"
33
34def validate_tushare_connection():
35 """验证Tushare连接"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected