| | |
| | | |
| | | if code_nature_analyse.is_up_too_high_in_10d_with_limit_up(volumes_data): |
| | | # 判断是否太高 |
| | | l2_trade_util.forbidden_trade(code, "股价长得太高") |
| | | l2_trade_util.forbidden_trade(code, "股价长得太高(5天内有3个涨停)") |
| | | HighIncreaseCodeManager().add_code(code) |
| | | |
| | | if code_nature_analyse.is_up_too_high_in_120d(volumes_data): |
| | |
| | | break |
| | | |
| | | # ------------------计算H下----------------------- |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if not limit_up_price: |
| | | return |
| | | # 计算结束位置 |
| | | total_num = 0 |
| | | # 获取m值数据 |
| | | thresh_hold_money = Buy1PriceManager().get_latest_buy1_money(code) |
| | | thresh_hold_money = thresh_hold_money |
| | | thresh_hold_num = thresh_hold_money // (float(gpcode_manager.get_limit_up_price(code)) * 100) |
| | | thresh_hold_num = thresh_hold_money // (float(limit_up_price) * 100) |
| | | end_index = real_place_order_index + 1 |
| | | watch_indexes = set() |
| | | for i in range(real_place_order_index + 1, total_datas[-1]["index"]): |
| | |
| | | fdatas = [] |
| | | lines = __load_file_content(path) |
| | | for line in lines: |
| | | data_index = line.find(f"{code}") |
| | | data_index = line.find(f"{code}#") |
| | | if data_index > 0: |
| | | line = line.split(" - ")[1] |
| | | time_str = line[line.find("[") + 1:line.find("[") + 9] |
| | |
| | | def is_too_high(datas): |
| | | limit_up_price = round(datas[0]["close"] * 1.1, 2) |
| | | datas.reverse() |
| | | is_new_high = code_nature_analyse.is_price_too_high_in_days(datas, limit_up_price) |
| | | is_new_high = code_nature_analyse.is_up_too_high_in_10d_with_limit_up(datas) |
| | | return is_new_high |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code_str = "000536,000625,000628,000670,000766,000829,001311,001331,002189,002275,002331,002341,002363,002406,002416,002655,002691,002848,002861,002885,002906,002917,002962,300217,300462,300552,301111,301215,301372,600107,600178,600222,600288,600513,600698,600960,601777,603029,603286,603297,603569,605020,688314,688789" |
| | | code_str = "600148" |
| | | codes = code_str.split(",") |
| | | for code in codes: |
| | | if code.find("00") != 0 and code.find("60") != 0: |
| | | continue |
| | | try: |
| | | datas = init_data_util.get_volumns_by_code(code, 120) |
| | | datas = datas[3:] |
| | | datas = datas[0:] |
| | | result = is_too_high(datas) |
| | | if result: |
| | | print(code, result) |
| | |
| | | |
| | | def export_l2_excel(code, date=None): |
| | | # 获取L2的数据 |
| | | local_today_datas = log_export.load_l2_from_log(date) |
| | | datas = local_today_datas[code] |
| | | datas = datas[-2000:] |
| | | # 获取L2处理位置信息 |
| | | process_indexs = log_export.get_l2_process_position(code, date) |
| | | trade_indexs = log_export.get_l2_trade_position(code, date) |
| | | real_position_indexes = log_export.get_real_place_order_positions(code, date) |
| | | deal_list = log_export.load_huaxin_deal_record(code) |
| | | deal_list_dict = {} |
| | | for d in deal_list: |
| | | deal_list_dict[d[0]] = d |
| | | fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict) |
| | | fdatas = get_l2_datas(code) |
| | | __save_l2_datas(code, fdatas) |
| | | |
| | | |
| | |
| | | deal_list = log_export.load_huaxin_deal_record(code) |
| | | deal_list_dict = {} |
| | | for d in deal_list: |
| | | deal_list_dict[d[0]] = d |
| | | |
| | | deal_list_dict[str(d[0])] = d |
| | | fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict) |
| | | return fdatas |
| | | |
| | |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | else: |
| | | if int(data["val"].get("orderNo")) in deal_list_dict: |
| | | cancel_info = l2_huaxin_util.convert_time(deal_list_dict[int(data["val"].get("orderNo"))][3], |
| | | deal_info = deal_list_dict.get(str(data["val"].get("orderNo"))) |
| | | if deal_info: |
| | | cancel_info = l2_huaxin_util.convert_time(deal_info[3], |
| | | with_ms=True) |
| | | format_data.append(cancel_info) |
| | | cancel_order_info = None |
| | |
| | | |
| | | if __name__ == "__main__": |
| | | try: |
| | | export_l2_excel("000536") |
| | | export_l2_excel("002036") |
| | | except Exception as e: |
| | | logging.exception(e) |