| | |
| | | for d in datas: |
| | | if gpcode_manager.BuyOpenLimitUpCodeManager().is_in_cache(d[0]): |
| | | # 09:19:50 到 09:20:00判断是否要撤单 |
| | | if int("091950") <= tool.get_now_time_as_int() < int("092000"): |
| | | if int("091950") <= int(d[9].replace(":", "")) < int("092000"): |
| | | async_log_util.info(logger_debug, f"排1撤单:{d}") |
| | | if d[8]*d[5] < 1e8: |
| | | code = d[0] |
| | |
| | | if current_delegates: |
| | | for c in current_delegates: |
| | | huaxin_trade_api.cancel_order(1, code, c["orderSysID"]) |
| | | |
| | | |
| | | # 获取L1现价 |
| | | @classmethod |
| | |
| | | pass |
| | | |
| | | |
| | | def __subscript_fixed_codes_l2(): |
| | | """ |
| | | 订阅固定代码的L2数据 |
| | | @return: |
| | | """ |
| | | codes = gpcode_manager.BuyOpenLimitUpCodeManager().get_codes() |
| | | add_datas = [] |
| | | for code in codes: |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | if not limit_up_price: |
| | | init_data_util.re_set_price_pre(code) |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | min_volume = int(round(50 * 10000 / limit_up_price)) |
| | | # 传递笼子价 |
| | | add_datas.append( |
| | | # (代码, 最小量, 涨停价,影子订单价格,买量, 特殊价格) |
| | | (code, min_volume, limit_up_price, round(tool.get_shadow_price(limit_up_price), 2), |
| | | tool.get_buy_volume(limit_up_price), |
| | | [tool.get_buy_volume_by_money(limit_up_price, x) for x in constant.AVAILABLE_BUY_MONEYS])) |
| | | huaxin_target_codes_manager.HuaXinL2SubscriptCodesManager.push(add_datas, 0) |
| | | |
| | | |
| | | # 做一些初始化的操作 |
| | | def __init(): |
| | | def run_pending(): |
| | | schedule.every().day.at("15:10:00").do(zyltgb_util.update_all_zylt_volumes) |
| | | schedule.every().day.at("01:25:01").do(__test_pre_place_order) |
| | | schedule.every().day.at("01:02:00").do(__test_pre_place_order) |
| | | schedule.every().day.at("09:10:00").do(__subscript_fixed_codes_l2) |
| | | schedule.every().day.at("08:00:01").do(history_k_data_manager.update_history_k_bars) |
| | | schedule.every().day.at("08:30:01").do(history_k_data_manager.update_history_k_bars) |
| | | schedule.every().day.at("09:00:01").do(history_k_data_manager.update_history_k_bars) |