| | |
| | | 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): |
| | |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | buy1_money = Buy1PriceManager().get_latest_buy1_money(code) |
| | | if buy1_money is None: |
| | | buy1_money = 0 |
| | | buy1_money = 1 |
| | | # 获取已经成交的大单数量 |
| | | total_big_num = 0 |
| | | total_big_count = 0 |
| | |
| | | "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": [] |
| | |
| | | # 获取大单成交列表 |
| | | code = data["code"] |
| | | data_list = BigOrderDealManager().get_total_buy_money_list(code) |
| | | bigger_money = l2_data_util_old.get_big_money_val(float(gpcode_manager.get_limit_up_price(code)), |
| | | bigger_money = l2_data_util_old.get_big_money_val(gpcode_manager.get_limit_up_price_as_num(code), |
| | | tool.is_ge_code(code)) |
| | | fdatas = [] |
| | | for d in data_list: |