| | |
| | | try: |
| | | add_code_set = set(add_code_list) |
| | | global latest_add_codes |
| | | if not latest_add_codes or tuple(latest_add_codes) != tuple(add_code_set): |
| | | if not latest_add_codes: |
| | | latest_add_codes = set() |
| | | # 判断设置的代码是否相同 |
| | | dif1 = latest_add_codes - add_code_set |
| | | dif2 = add_code_set - latest_add_codes |
| | | if dif1 or dif2: |
| | | print("设置L2代码数量:", len(add_code_set)) |
| | | latest_add_codes = add_code_set |
| | | add_datas = [] |
| | | for d in add_code_list: |
| | |
| | | limit_up_price = round(float(limit_up_price), 2) |
| | | min_volume = int(round(50 * 10000 / limit_up_price)) |
| | | add_datas.append((d, min_volume, limit_up_price)) |
| | | huaxin_target_codes_manager.push(add_datas) |
| | | huaxin_target_codes_manager.push(add_datas) |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | else: |