| | |
| | | from trade import trade_manager, trade_huaxin |
| | | |
| | | from trade.huaxin import huaxin_trade_api as trade_api, huaxin_trade_api, huaxin_trade_record_manager |
| | | from utils import socket_util, tool, huaxin_util |
| | | from utils import socket_util, tool, huaxin_util, data_export_util |
| | | |
| | | trade_data_request_queue = queue.Queue() |
| | | |
| | |
| | | fresults.append((code, code_name)) |
| | | return_str = json.dumps( |
| | | {"code": 0, "data": {"count": len(fresults), "list": fresults}, "msg": ""}) |
| | | elif type_ == "export_l2_data": |
| | | # 导出L2数据 |
| | | code = data_json["data"]["code"] |
| | | try: |
| | | data_export_util.export_l2_excel(code) |
| | | return_str = json.dumps( |
| | | {"code": 0, "data": {}, "msg": ""}) |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | return_str = json.dumps( |
| | | {"code": 1, "msg": str(e)}) |
| | | # 查询委托列表 |
| | | elif type_ == 'test': |
| | | # 卖出 |
| | |
| | | buy_progress_index = None |
| | | for d in datas: |
| | | buy_no = d[6] |
| | | if buy_no in buyno_map: |
| | | if buyno_map and buy_no in buyno_map: |
| | | hx_logger_l2_transaction.info(f"{code}成交进度:{buyno_map[buy_no]}") |
| | | buy_progress_index = buyno_map[buy_no]["index"] |
| | | |