| | |
| | | from trade import current_price_process_manager, trade_constant |
| | | import concurrent.futures |
| | | |
| | | from trade.buy_radical import radical_buy_strategy |
| | | from trade.buy_radical.radical_buy_data_manager import RadicalBuyDataManager, EveryLimitupBigDealOrderManager |
| | | from utils import tool |
| | | |
| | |
| | | buy_datas, bigger_buy_datas = HuaXinBuyOrderManager.statistic_big_buy_data(code, datas, limit_up_price) |
| | | if buy_datas: |
| | | BigOrderDealManager().add_buy_datas(code, buy_datas) |
| | | EveryLimitupBigDealOrderManager.add_big_buy_order_deal(code, [x[0] for x in buy_datas]) |
| | | active_big_buy_orders = [] |
| | | if buy_datas: |
| | | for x in buy_datas: |
| | | if x[0] > x[6]: |
| | | # (买单号, 成交金额, 最后成交时间) |
| | | active_big_buy_orders.append((x[0], x[2], x[4])) |
| | | EveryLimitupBigDealOrderManager.add_big_buy_order_deal(code, active_big_buy_orders) |
| | | try: |
| | | is_placed_order = l2_data_manager.TradePointManager.is_placed_order(order_begin_pos) |
| | | if is_placed_order: |
| | |
| | | if limit_up_price > datas[-1][1]: |
| | | # 没有涨停 |
| | | EveryLimitupBigDealOrderManager.open_limit_up(code) |
| | | radical_buy_strategy.clear_data(code) |
| | | except: |
| | | pass |
| | | |
| | |
| | | if not need_cancel: |
| | | need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code, |
| | | order_begin_pos) |
| | | cancel_type = trade_constant.CANCEL_TYPE_F |
| | | cancel_type = trade_constant.CANCEL_TYPE_P |
| | | # 判断时间是否与本地时间相差5s以上 |
| | | if tool.trade_time_sub(tool.get_now_time_str(), l2_huaxin_util.convert_time(datas[-1][3])) > 10: |
| | | now_seconds = int(tool.get_now_time_str().replace(":", "")) |
| | | if now_seconds < int("093200"): # or int("130000") <= now_seconds < int("130200"): |
| | | if now_seconds < int("093100"): # or int("130000") <= now_seconds < int("130200"): |
| | | need_cancel, cancel_msg = True, f"成交时间与本地时间相差10S以上,{l2_huaxin_util.convert_time(datas[-1][3])}" |
| | | cancel_type = trade_constant.CANCEL_TYPE_L2_DELAY |
| | | if need_cancel: |