| | |
| | | threshold_money = threshold_money_origin |
| | | # 目标手数 |
| | | threshold_num = round(threshold_money / (limit_up_price * 100)) |
| | | bigger_threshold_num = round(5000 / (limit_up_price)) |
| | | |
| | | # buy_single_time_seconds = L2DataUtil.get_time_as_second(total_datas[buy_single_index]["val"]["time"]) |
| | | |
| | |
| | | # threshold_num = round(threshold_money / (limit_up_price * 100)) |
| | | # 涨停买 |
| | | elif L2DataUtil.is_limit_up_price_buy(_val): |
| | | if _val['num'] < bigger_threshold_num: |
| | | continue |
| | | if l2_data_util.is_big_money(_val): |
| | | max_buy_num_set.add(i) |
| | | trigger_buy = True |
| | |
| | | def load_huaxin_active_sell_map(date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/logs/huaxin/trade/l2_active_sell.{date}.log" |
| | | fdatas = {} |
| | | if os.path.exists(path): |
| | | with open(path, 'r', encoding="utf-8") as f: |
| | | lines = f.readlines() |
| | | for line in lines: |
| | | if line: |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | time_str = data[data.find("[") + 1:data.find("]")].strip() |
| | | data = data[data.find("]") + 1:].strip() |
| | | lines = __load_file_content(path) |
| | | for line in lines: |
| | | if line: |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | time_str = data[data.find("[") + 1:data.find("]")].strip() |
| | | data = data[data.find("]") + 1:].strip() |
| | | |
| | | data = data.split("code=")[1].strip() |
| | | code = data[:data.find(" ")].strip() |
| | | data = data[data.find(" "):].strip() |
| | | data = eval(data) |
| | | l2_data = eval(data.split("#")[1]) |
| | | if code not in fdatas: |
| | | fdatas[code] = set() |
| | | fdatas[code].add(data[0]) |
| | | except: |
| | | pass |
| | | data = data.split("code=")[1].strip() |
| | | code = data[:data.find(" ")].strip() |
| | | data = data[data.find(" "):].strip() |
| | | data = eval(data) |
| | | if code not in fdatas: |
| | | fdatas[code] = set() |
| | | fdatas[code].add(data[0]) |
| | | except: |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | if __name__ == '__main__': |
| | | fdatas = load_huaxin_transaction_sell_no("600990") |
| | | fdatas = load_huaxin_active_sell_map() |
| | | print(len(fdatas)) |
| | | # print(get_h_cancel_compute_info("603912")) |
| | | |
| | |
| | | |
| | | sell_no_dict = log_export.load_huaxin_transaction_sell_no(code=code, date=date) |
| | | sell_nos = sell_no_dict.get(code) |
| | | |
| | | fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos) |
| | | active_sell_map = log_export.load_huaxin_active_sell_map(date=date) |
| | | 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) |
| | | return fdatas |
| | | |
| | | |
| | |
| | | date = tool.get_now_date_str() |
| | | sell_no_dict = log_export.load_huaxin_transaction_sell_no(code=code, date=date) |
| | | sell_nos = sell_no_dict.get(code) |
| | | fdatas = export_l2_transaction_data(code,sell_nos) |
| | | fdatas = export_l2_transaction_data(code, sell_nos) |
| | | return fdatas |
| | | |
| | | |
| | | def export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, 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]: |
| | |
| | | fdatas = [] |
| | | for data in datas: |
| | | index += 1 |
| | | if data['val']['orderNo'] in active_sell_nos: |
| | | # 过滤主动卖 |
| | | continue |
| | | trade_info = find_trade_index(data["index"]) |
| | | if not trade_info: |
| | | # 获取真实下单位置 |