| | |
| | | if dealing_info and str(dealing_info[0]) == str(val["orderNo"]): |
| | | total_left_num -= dealing_info[1] // 100 |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if total_left_count <= THRESHOLD_COUNT and limit_up_price and total_left_num * float( |
| | | limit_up_price) < 300 * 100: |
| | | if total_left_count<=1 or (total_left_count <= THRESHOLD_COUNT and limit_up_price and total_left_num * float( |
| | | limit_up_price) < 300 * 100): |
| | | return True, f"剩余笔数({total_left_count})/金额({round(total_left_num * float(limit_up_price) * 100)})不足,成交进度:{trade_index},真实下单位置:{real_order_index}" |
| | | return False, f"不满足撤单条件: 成交进度-{trade_index} 真实下单位置-{real_order_index} total_left_count-{total_left_count} total_left_num-{total_left_num}" |
| | | |
| | |
| | | ps_dict = dict([(k, v[0]) for k, v in parse_qs(url.query).items()]) |
| | | code = ps_dict['code'] |
| | | date = ps_dict.get('date') |
| | | time_str = ps_dict.get('time') |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | if date: |
| | | if date or time_str: |
| | | total_datas = None |
| | | else: |
| | | date = tool.get_now_date_str() |
| | |
| | | |
| | | |
| | | # 获取L2的数据 |
| | | def get_l2_datas(code, today_datas=None, date=None): |
| | | def get_l2_datas(code, today_datas=None, date=None, max_time=None): |
| | | if date is None: |
| | | date = tool.get_now_date_str() |
| | | datas = today_datas |
| | |
| | | active_sell_set = active_sell_map.get(code) |
| | | if not active_sell_set: |
| | | active_sell_set = set() |
| | | fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, active_sell_set) |
| | | fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, |
| | | active_sell_set) |
| | | return fdatas |
| | | |
| | | |
| | |
| | | return fdatas |
| | | |
| | | |
| | | def export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, active_sell_nos): |
| | | def export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, |
| | | active_sell_nos): |
| | | def find_process_index(index): |
| | | for i in range(0, len(process_indexs)): |
| | | if process_indexs[i][0] <= index <= process_indexs[i][1]: |