| | |
| | | code_list_type = data["code_list_type"] |
| | | operate = data["operate"] |
| | | code = data.get("code") |
| | | if code and not tool.is_can_buy_code(code): |
| | | raise Exception(f"不是可以交易的代码:{code}") |
| | | # if code and not tool.is_can_buy_code(code): |
| | | # raise Exception(f"不是可以交易的代码:{code}") |
| | | fresult = {"code": 0} |
| | | if code_list_type == outside_api_command_manager.CODE_LIST_WANT: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | |
| | | result = {"code": 0, "data": {"account_available_money": account_available_money, "delegates": fdatas, "rate_of_increase_step": constant.L_DOWN_RATE_INCREASE_STEP}} |
| | | result = {"code": 0, "data": {"account_available_money": account_available_money, "delegates": fdatas, |
| | | "rate_of_increase_step": constant.L_DOWN_RATE_INCREASE_STEP}} |
| | | self.send_response(result, client_id, request_id) |
| | | elif ctype == "get_delegated_buy_code_infos_v2": |
| | | account_available_money = trade_data_manager.AccountMoneyManager().get_available_money_cache() |
| | |
| | | async_log_util.info(logger_debug, f"统计实撤用时:{code} - {use_time}") |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | fdata["volume_info"] = code_volumn_manager.CodeVolumeManager().get_volume_rate(code, |
| | | with_info=True) |
| | | fdatas.append(fdata) |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | |
| | | "buy_first_limit_up": 1 if constant.CAN_BUY_FIRST_LIMIT_UP else 0, |
| | | "can_auto_add_white": 1 if constant.CAN_AUTO_ADD_WHITE else 0, |
| | | "can_auto_add_want_buy_codes": 1 if constant.CAN_AUTO_ADD_WANT_BUY_CODES else 0, |
| | | "can_auto_l_down_rate_change": 1 if constant.CAN_AUTO_L_DOWN_RATE_CHANGE else 0 |
| | | "can_auto_l_down_rate_change": 1 if constant.CAN_AUTO_L_DOWN_RATE_CHANGE else 0, |
| | | "auto_add_want_buy_codes_time_ranges": constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES |
| | | }} |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | |
| | | constant.CAN_AUTO_L_DOWN_RATE_CHANGE = True if radical_buy.get( |
| | | 'can_auto_l_down_rate_change') else False |
| | | |
| | | |
| | | if radical_buy.get('auto_add_want_buy_codes_time_ranges') is not None: |
| | | time_ranges = radical_buy.get('auto_add_want_buy_codes_time_ranges') |
| | | constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES = ( |
| | | time_ranges.split(",")[0], time_ranges.split(",")[1]) |
| | | |
| | | self.send_response({"code": 0, "data": {}, "msg": f""}, |
| | | client_id, |
| | |
| | | self.send_response({"code": 0, "data": {}}, |
| | | client_id, |
| | | request_id) |
| | | elif ctype == "remove_l_down_rate": |
| | | # 删除L后撤单比例 |
| | | code = data.get("code") |
| | | CancelRateHumanSettingManager().remove_l_down(code) |
| | | trade_record_log_util.add_common_msg(code, "删除L后预设比例") |
| | | self.send_response({"code": 0, "data": {}}, |
| | | client_id, |
| | | request_id) |
| | | |
| | | elif ctype == "get_continue_buy_info": |
| | | # 设置L后撤单比例 |