| | |
| | | self.l2_data_upload_manager.add_l2_order_detail(item, 0) |
| | | |
| | | def OnRtnNGTSTick(self, pTick): |
| | | logger_debug.info(f"OnRtnNGTSTick: {pTick}") |
| | | # logger_debug.info(f"OnRtnNGTSTick: {pTick}") |
| | | # 输出逐笔成交数据 |
| | | try: |
| | | if pTick['TickType'] == b'T': |
| | |
| | | |
| | | def __run_recv_queue_trade(queue: multiprocessing.Queue): |
| | | def __cancel_order(code, order_ref): |
| | | # 2s没成交就撤单 |
| | | time.sleep(2) |
| | | # 2s/3s没成交就撤单 |
| | | if tool.is_sh_code(code): |
| | | time.sleep(3) |
| | | else: |
| | | time.sleep(2) |
| | | order_: HuaxinOrderEntity = TradeResultProcessor.get_huaxin_order_by_order_ref(order_ref) |
| | | if order_ is not None: |
| | | if huaxin_util.is_can_cancel(order_.orderStatus): |
| | |
| | | if r.buy1_volume >= buy1_volume: |
| | | # 量价触发 |
| | | can_excute = True |
| | | async_log_util.info(logger_trade, f"触发卖规则:量触发{buy1_volume}/{r.buy1_volume}") |
| | | async_log_util.info(logger_trade, f"触发卖规则({code}-{d}):量触发{buy1_volume}/{r.buy1_volume}") |
| | | else: |
| | | can_excute = True |
| | | async_log_util.info(logger_trade, f"触发卖规则:价格触发{buy1_price}/{r.buy1_price}") |
| | | async_log_util.info(logger_trade, f"触发卖规则({code}-{d}):价格触发{buy1_price}/{r.buy1_price}") |
| | | # 价格触发 |
| | | # 获取价格类型 |
| | | if not can_excute: |