| | |
| | | name = gpcode_manager.get_code_name(code) |
| | | datas.append(f"{name}:{code}") |
| | | return_str = json.dumps({"code": 0, "data": datas}) |
| | | elif type == 501: |
| | | data = json.loads(_str) |
| | | is_open = data["data"]["open"] |
| | | if is_open: |
| | | trade_manager.TradeStateManager.open_buy() |
| | | else: |
| | | trade_manager.TradeStateManager.close_buy() |
| | | return_str = json.dumps({"code": 0, "msg": ("开启成功" if is_open else "关闭成功")}) |
| | | |
| | | sk.send(return_str.encode()) |
| | | |
| | |
| | | print(cid, pid) |
| | | |
| | | if __name__ == "__main__": |
| | | codes = ["603655"] |
| | | codes = ["000719"] |
| | | for code in codes: |
| | | try: |
| | | global_data_loader.load_zyltgb() |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price(code)) |
| | | limit_up_price = float("11.13") # float(gpcode_manager.get_limit_up_price(code)) |
| | | volumes_data = juejin.get_volumns_by_code(code, 150) |
| | | volumes_data = volumes_data[1:] |
| | | volumes = juejin.parse_max_volume(volumes_data[:60], |
| | | code_nature_analyse.is_new_top(gpcode_manager.get_limit_up_price(code), |
| | | code_nature_analyse.is_new_top(limit_up_price, |
| | | volumes_data[:60])) |
| | | logger_first_code_record.info("{} 获取到首板60天最大量:{}", code, volumes) |
| | | code_volumn_manager.set_histry_volumn(code, volumes[0], volumes[1], volumes[2]) |
| | | # 判断K线形态 |
| | | is_has_k_format, msg = code_nature_analyse.is_has_k_format( |
| | | gpcode_manager.get_limit_up_price(code), volumes_data) |
| | | if not is_has_k_format: |
| | | logger_first_code_record.info("{}首板K线形态不好,{}", code, msg) |
| | | # 加入禁止交易代码 |
| | | l2_trade_util.forbidden_trade(code) |
| | | k_format = code_nature_analyse.get_k_format( |
| | | limit_up_price, volumes_data) |
| | | print(k_format) |
| | | |
| | | code_nature_analyse.set_record_datas(code, |
| | | gpcode_manager.get_limit_up_price(code), |