| | |
| | | from trade.huaxin.huaxin_trade_record_manager import DelegateRecordManager |
| | | from trade.order_statistic import DealAndDelegateWithBuyModeDataManager |
| | | from trade.buy_radical.radical_buy_data_manager import RadicalBuyDataManager, RadicalBuyBlockManager, \ |
| | | EveryLimitupBigDealOrderManager, RadicalCodeMarketInfoManager, RadicalBigOrderThresholdManager |
| | | EveryLimitupBigDealOrderManager, RadicalCodeMarketInfoManager, BeforeSubDealBigOrderManager |
| | | from trade.sell.sell_rule_manager import TradeRuleManager |
| | | from trade.trade_data_manager import RadicalBuyDealCodesManager |
| | | from trade.trade_manager import CodesTradeStateManager |
| | | from utils import socket_util, middle_api_protocol, tool, huaxin_util, global_util, trade_util, init_data_util |
| | | from utils import socket_util, middle_api_protocol, tool, huaxin_util, global_util, trade_util, init_data_util, \ |
| | | output_util |
| | | |
| | | trade_data_request_queue = queue.Queue(maxsize=1000) |
| | | |
| | |
| | | fresults = [] |
| | | if codes: |
| | | for code in codes: |
| | | try: |
| | | # 获取成交大单:(参考大单金额,已成交大单金额,大单要求金额) |
| | | th = BeforeSubDealBigOrderManager().get_big_order_threshold(code) |
| | | deal_big_money_info = radical_buy_data_manager.get_total_deal_big_order_info( |
| | | code, gpcode_manager.get_limit_up_price_as_num(code)) |
| | | deal_big_order_info = ( |
| | | output_util.money_desc(th), output_util.money_desc(deal_big_money_info[1]), |
| | | output_util.money_desc(deal_big_money_info[2])) |
| | | except: |
| | | deal_big_order_info = None |
| | | code_name = gpcode_manager.get_code_name(code) |
| | | fresults.append((code, code_name)) |
| | | fresults.append((code, code_name, deal_big_order_info)) |
| | | |
| | | fdata = middle_api_protocol.load_l2_subscript_codes(fresults) |
| | | middle_api_protocol.request(fdata) |
| | |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.total_datas, |
| | | latest_current_limit_up_records, |
| | | block_info.get_before_blocks_dict(), |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.get_current_limit_up_reason_codes_dict(),codes_delegate, codes_success) |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.get_current_limit_up_reason_codes_dict(), |
| | | codes_delegate, codes_success) |
| | | finally: |
| | | cls.__updating_jx_blocks_codes.discard(code_) |
| | | |
| | | |
| | | time_str = f"{data['dataTimeStamp']}" |
| | | if time_str.startswith("9"): |
| | |
| | | data["totalAskVolume"], sell_1_info, data.get("sell")) |
| | | # 炸板 |
| | | if sell_1_info and sell_1_info[1] > 0: |
| | | if RadicalBigOrderThresholdManager().is_need_update(code): |
| | | if BeforeSubDealBigOrderManager().is_need_update(code): |
| | | # 炸板更新数据 |
| | | cls.__sell_thread_pool.submit( |
| | | lambda: radical_buy_data_manager.pull_pre_deal_big_orders(code)) |
| | |
| | | if data["sell"] and len(data["sell"]) > 1 and data["sell"][1][1] > 0: |
| | | # 出现卖二 |
| | | radical_buy_strategy.clear_data(code, force=True) |
| | | |
| | | |
| | | # 设置扫入数据 |
| | | RadicalCodeMarketInfoManager().set_market_info(code, time_str, round(float(limit_up_price), 2), data["buy"][0], |