| | |
| | | import time |
| | | |
| | | import constant |
| | | from cancel_strategy.s_l_h_cancel_strategy import HourCancelBigNumComputer |
| | | from cancel_strategy.s_l_h_cancel_strategy import LCancelBigNumComputer, LCancelRateManager |
| | | from cancel_strategy.s_l_h_cancel_strategy import SCancelBigNumComputer |
| | | from code_attribute import gpcode_manager |
| | | from l2 import l2_data_util, l2_data_manager, transaction_progress |
| | | from l2.cancel_buy_strategy import FCancelBigNumComputer, LCancelBigNumComputer, LCancelRateManager, \ |
| | | GCancelBigNumComputer, SCancelBigNumComputer, HourCancelBigNumComputer, NewGCancelBigNumComputer |
| | | from l2.cancel_buy_strategy import FCancelBigNumComputer, \ |
| | | NewGCancelBigNumComputer, \ |
| | | NBCancelBigNumComputer |
| | | from l2.huaxin import l2_huaxin_util |
| | | from l2.l2_data_manager import OrderBeginPosInfo |
| | | from l2.l2_data_manager_new import L2TradeDataProcessor |
| | | from l2.l2_data_util import L2DataUtil |
| | | from l2.l2_transaction_data_manager import HuaXinBuyOrderManager, HuaXinSellOrderStatisticManager, BigOrderDealManager |
| | | from log_module import async_log_util |
| | | from log_module.log import hx_logger_l2_debug, logger_l2_trade_buy_queue, logger_debug, hx_logger_l2_upload |
| | | from trade import current_price_process_manager |
| | | from trade.deal_big_money_manager import DealOrderNoManager |
| | | import concurrent.futures |
| | | |
| | | from utils import tool |
| | |
| | | @classmethod |
| | | def process_huaxin_transaction_datas(cls, code, datas): |
| | | __start_time = time.time() |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if limit_up_price: |
| | | limit_up_price = round(float(limit_up_price), 2) |
| | | # 设置成交价 |
| | | current_price_process_manager.set_trade_price(code, datas[-1][1]) |
| | | try: |
| | | current_price_process_manager.set_trade_price(code, datas[-1][1], l2_huaxin_util.convert_time( datas[-1][3]), limit_up_price) |
| | | except: |
| | | pass |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | use_time_list = [] |
| | | try: |
| | |
| | | |
| | | big_sell_order_info = None |
| | | try: |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if limit_up_price: |
| | | limit_up_price = round(float(limit_up_price), 2) |
| | | |
| | | # 统计卖单 |
| | | big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas, limit_up_price) |
| | | |
| | |
| | | need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code, big_sell_order_info, |
| | | order_begin_pos) |
| | | # 判断时间是否与本地时间相差5s以上 |
| | | if tool.trade_time_sub(tool.get_now_time_str(), l2_huaxin_util.convert_time(datas[-1][3])) >= 5: |
| | | need_cancel, cancel_msg = True, f"成交时间与本地时间相差5S以上,{l2_huaxin_util.convert_time(datas[-1][3])}" |
| | | if tool.trade_time_sub(tool.get_now_time_str(), l2_huaxin_util.convert_time(datas[-1][3])) > 10: |
| | | need_cancel, cancel_msg = True, f"成交时间与本地时间相差10S以上,{l2_huaxin_util.convert_time(datas[-1][3])}" |
| | | |
| | | if need_cancel: |
| | | L2TradeDataProcessor.cancel_buy(code, cancel_msg) |
| | |
| | | cancel_result = FCancelBigNumComputer().need_cancel_for_deal_fast(code, buy_progress_index) |
| | | if cancel_result[0]: |
| | | L2TradeDataProcessor.cancel_buy(code, f"F撤:{cancel_result[1]}") |
| | | # if not cancel_result[0]: |
| | | # try: |
| | | # cancel_result = NBCancelBigNumComputer().need_cancel(code, buy_progress_index) |
| | | # if cancel_result[0]: |
| | | # L2TradeDataProcessor.cancel_buy(code, f"大市值无大单撤:{cancel_result[1]}") |
| | | # except: |
| | | # pass |
| | | |
| | | if not cancel_result[0] and buy_progress_index_changed: |
| | | try: |
| | | cancel_result = FCancelBigNumComputer().need_cancel_for_w(code) |
| | | if cancel_result[0]: |
| | | L2TradeDataProcessor.cancel_buy(code, f"W撤:{cancel_result[1]}") |
| | | except: |
| | | pass |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | SCancelBigNumComputer().set_transaction_index(code, order_begin_pos.buy_single_index, |
| | | buy_progress_index) |