| | |
| | | import multiprocessing |
| | | |
| | | import l2_code_operate |
| | | import l2_trade_factor |
| | | import redis_manager |
| | | import mongo_data |
| | | import server |
| | |
| | | |
| | | def createServer(pipe): |
| | | print("create SocketServer") |
| | | # 初始化参数 |
| | | global_util.init() |
| | | laddr = "", 9001 |
| | | tcpserver = MyThreadingTCPServer(laddr, MyBaseRequestHandle, pipe=pipe) # 注意:参数是MyBaseRequestHandle |
| | | # tcpserver.handle_request() # 只接受一个客户端连接 |
| | |
| | | |
| | | def sync_target_codes(): |
| | | server.sync_target_codes_to_ths() |
| | | print(result) |
| | | |
| | | def click(): |
| | | text.delete('1.0', END) |
| | |
| | | time.sleep(1) |
| | | |
| | | def refresh_data(): |
| | | print("refresh-l2-data") |
| | | for client_id in code_sv_map: |
| | | ip = data_process.getActiveClientIP(client_id) |
| | | ths_dead=data_process.getTHSState(client_id) |
| | |
| | | |
| | | showinfo("提示", "导出完成") |
| | | |
| | | def compute_m(code): |
| | | m = l2_trade_factor.L2TradeFactorUtil.compute_m_value(code) |
| | | showinfo("提示", "{}".format(m)) |
| | | |
| | | frame = Frame(root, {"height": 280, "width": 300, "bg": "#DDDDDD"}) |
| | | frame.grid(row=2, column=2, rowspan=2, pady=5) |
| | |
| | | btn = Button(frame, text="导出L2原始数据", command=lambda: export_l2_data_origin(code.get())) |
| | | btn.place(x=220, y=100) |
| | | |
| | | btn = Button(frame, text="获取m值", command=lambda: compute_m(code.get())) |
| | | btn.place(x=10, y=120) |
| | | |
| | | # 交易按钮 |
| | | btn = Button(frame, textvariable=btntext, command=startJueJinGui) |
| | | btn.place(x=10, y=150) |