| | |
| | | def __cancel_not_deal_order(self, code, order_ref, timeout=3): |
| | | time.sleep(timeout) |
| | | # 撤买单 |
| | | huaxin_trade_api.cancel_order(1, code, "", orderRef=order_ref) |
| | | huaxin_trade_api.cancel_order(huaxin_trade_api.TRADE_DIRECTION_BUY, code, "", orderRef=order_ref) |
| | | |
| | | # 交易 |
| | | def OnTrade(self, client_id, request_id, data): |
| | |
| | | "pay_attention": need_pay_attention, |
| | | "trade_progress_percent": round( |
| | | total_left_num * float(limit_up_price) * 100 * 100 / buy1_money, 2), # 成交进度比例 |
| | | "limit_up_price": float(gpcode_manager.get_limit_up_price(code)), |
| | | "limit_up_price": gpcode_manager.get_limit_up_price_as_num(code), |
| | | "is_near_big_order": is_near_big_order, |
| | | "block": '', |
| | | "trade_queue": [] |