| | |
| | | position_codes = set() |
| | | # TODO 测试 |
| | | position_codes.add("113565") |
| | | position_codes.add("601921") |
| | | need_update_codes = [] |
| | | for d in datas: |
| | | if d["prePosition"] > 0 and tool.is_can_sell_code(d["securityID"]): |
| | |
| | | class MyL2DataCallback(L2DataCallBack): |
| | | |
| | | def OnL2Order(self, code, origin_datas, timestamp): |
| | | if tool.is_cb_code(code): |
| | | return |
| | | # 保存L2数据 |
| | | datas = None |
| | | try: |
| | |
| | | origin_datas.clear() |
| | | |
| | | def OnL2Transaction(self, code, datas): |
| | | async_log_util.info(hx_logger_l2_transaction, f"{code}#{datas}") |
| | | # async_log_util.info(hx_logger_l2_transaction, f"{code}#{datas}") |
| | | if datas: |
| | | # 获取最近的成交价 |
| | | price, time_str = datas[-1][1], l2_huaxin_util.convert_time(datas[-1][3]) |