Administrator
2024-01-31 1d95007ce632c2df0a50e9482358f2ab2587d182
API输出持仓成本价
1个文件已修改
3 ■■■■ 已修改文件
trade/huaxin/huaxin_trade_server.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py
@@ -1107,7 +1107,7 @@
            positions = PositionManager.latest_positions
            sell_rules_count = len(SellRuleManager().list_can_excut_rules_cache())
            fdata = {"code": code, "total": 0, "available": 0, "sell_orders": [], "sell_rules_count": sell_rules_count,
            fdata = {"code": code, "total": 0, "available": 0, "sell_orders": [], "sell_rules_count": sell_rules_count,"cost_price":0,
                     "code_info": (code, code_name), "desc": "".join(desc_list)}
            if positions:
                for d in positions:
@@ -1124,6 +1124,7 @@
                        continue
                    fdata["total"] = d["prePosition"]
                    fdata["available"] = d["availablePosition"]
                    fdata["cost_price"] = round(float(d["historyPosPrice"]), 2)
                    deal_order_system_id_infos = {}
                    # 获取已经卖的单数
                    deal_list = self.__DealRecordManager.list_sell_by_code_cache(code)