| | |
| | | # 即将成交 |
| | | from code_attribute import gpcode_manager |
| | | from l2 import l2_data_source_util, l2_data_util |
| | | import l2 |
| | | import l2_data_util |
| | | from l2.l2_data_util import L2DataUtil |
| | | from log_module import async_log_util |
| | | from log_module.log import logger_kp_msg |
| | |
| | | |
| | | # 即将成交 |
| | | def almost_deal(code, real_order_index, trade_index): |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | total_datas = l2.l2_data_util.local_today_datas.get(code) |
| | | if trade_index > real_order_index: |
| | | return |
| | | # 下单3s过后再提醒 |
| | |
| | | continue |
| | | if val["num"] * float(val["price"]) < 5000: |
| | | continue |
| | | left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, |
| | | i, |
| | | total_datas, |
| | | l2_data_util.local_today_canceled_buyno_map.get( |
| | | code)) |
| | | left_count = l2.l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, |
| | | i, |
| | | total_datas, |
| | | l2.l2_data_util.local_today_canceled_buyno_map.get( |
| | | code)) |
| | | if left_count > 0: |
| | | total_left_count += left_count |
| | | total_left_money += val["num"] * left_count * float(val["price"]) * 100 |
| | |
| | | if total_left_count <= 10: |
| | | push_msg_manager.push_order_almost_deal(code, code_name, real_order_index, f"剩余:{total_left_count}笔", |
| | | ctype="count") |
| | | async_log_util.info(logger_kp_msg, f"{code}即将成交:trade_index-{trade_index},real_order_index-{real_order_index},剩余:{total_left_count}笔,结尾:{total_datas[-1]['index']}") |
| | | async_log_util.info(logger_kp_msg, |
| | | f"{code}即将成交:trade_index-{trade_index},real_order_index-{real_order_index},剩余:{total_left_count}笔,结尾:{total_datas[-1]['index']}") |
| | | |
| | | elif total_left_money < 1500 * 10000: |
| | | push_msg_manager.push_order_almost_deal(code, code_name, real_order_index, |
| | |
| | | def follow_not_enough(code, buy_exec_index, real_order_index): |
| | | if buy_exec_index > real_order_index: |
| | | return |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | total_datas = l2.l2_data_util.local_today_datas.get(code) |
| | | # 下单3s过后再提醒 |
| | | if tool.trade_time_sub(total_datas[-1]["val"]["time"], total_datas[buy_exec_index]["val"]["time"]) <= 5: |
| | | return |
| | |
| | | if not l2_data_util.is_big_money(val): |
| | | continue |
| | | |
| | | canceled_data = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code, |
| | | i, |
| | | total_datas, |
| | | l2_data_util.local_today_canceled_buyno_map.get( |
| | | code)) |
| | | canceled_data = l2.l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code, |
| | | i, |
| | | total_datas, |
| | | l2.l2_data_util.local_today_canceled_buyno_map.get( |
| | | code)) |
| | | if not canceled_data: |
| | | real_place_order_after_count += 1 |
| | | real_place_order_after_money += val["num"] * float(val["price"]) * 100 |