| | |
| | | |
| | | import constant |
| | | from code_atrribute import gpcode_manager |
| | | from code_atrribute.gpcode_manager import CodesNameManager |
| | | from code_atrribute.history_k_data_util import HistoryKDatasUtils |
| | | from huaxin_client.client_network import SendResponseSkManager |
| | | from huaxin_client.l2_data_transform_protocol import L2DataCallBack |
| | |
| | | fdata["available"] = d["availablePosition"] |
| | | fdata["cost_price"] = round(float(d["historyPosPrice"]), 2) |
| | | break |
| | | if fdata['total'] <= 0: |
| | | # 没有持仓,需要获取代码名称 |
| | | name = CodesNameManager.get_code_name(code) |
| | | if not name: |
| | | threading.Thread(target=lambda: CodesNameManager.request_code_name(code), daemon=True).start() |
| | | if name: |
| | | fdata["code_info"] = (code, name) |
| | | |
| | | # 有现价就获取现价 |
| | | current_price = L1DataProcessor.get_l1_current_price(code) |
| | | pre_close_price = gpcode_manager.get_price_pre_cache(code) |