| | |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | | from code_attribute.code_l1_data_manager import L1DataManager |
| | | from code_attribute.gpcode_manager import CodePrePriceManager, CodesNameManager, WantBuyCodesManager, \ |
| | | HumanRemoveForbiddenManager, HumanForbiddenManager |
| | | HumanRemoveForbiddenManager, HumanForbiddenManager, CodesContinueBuyMoneyManager |
| | | from db import mysql_data_delegate as mysql_data, redis_manager_delegate as redis_manager |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from huaxin_client import l1_subscript_codes_manager |
| | |
| | | from trade.sell import sell_manager |
| | | from trade.sell.sell_rule_manager import TradeRuleManager, SellRule |
| | | from trade.trade_data_manager import RadicalBuyDealCodesManager |
| | | from trade.trade_manager import TradeTargetCodeModeManager, AutoCancelSellModeManager, CodesContinueBuyMoneyManager, \ |
| | | from trade.trade_manager import TradeTargetCodeModeManager, AutoCancelSellModeManager, \ |
| | | CodesTradeStateManager |
| | | from settings.trade_setting import MarketSituationManager, TradeBlockBuyModeManager |
| | | from utils import socket_util, data_export_util, tool, huaxin_util, output_util, global_util, init_data_util |
| | |
| | | elif code_list_type == outside_api_command_manager.CODE_LIST_BLACK: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | | # 先手动撤单 |
| | | try: |
| | | l2_data_manager_new.L2TradeDataProcessor.cancel_buy(code, "手动拉黑", |
| | | cancel_type=trade_constant.CANCEL_TYPE_HUMAN) |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | # try: |
| | | # l2_data_manager_new.L2TradeDataProcessor.cancel_buy(code, "手动拉黑", |
| | | # cancel_type=trade_constant.CANCEL_TYPE_HUMAN) |
| | | # except Exception as e: |
| | | # logger_debug.exception(e) |
| | | l2_trade_util.forbidden_trade(code, msg="手动加入 trade_server", force=True) |
| | | WantBuyCodesManager().remove_code(code) |
| | | HumanRemoveForbiddenManager().remove_code(code) |
| | |
| | | "ignore_block_in_money_market_strong": constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG, |
| | | "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_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 |
| | | }} |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | |
| | | if radical_buy.get('can_auto_add_want_buy_codes') is not None: |
| | | constant.CAN_AUTO_ADD_WANT_BUY_CODES = True if radical_buy.get( |
| | | 'can_auto_add_want_buy_codes') else False |
| | | |
| | | if radical_buy.get('can_auto_l_down_rate_change') is not None: |
| | | constant.CAN_AUTO_L_DOWN_RATE_CHANGE = True if radical_buy.get( |
| | | 'can_auto_l_down_rate_change') else False |
| | | |
| | | |
| | | |
| | | self.send_response({"code": 0, "data": {}, "msg": f""}, |
| | | client_id, |
| | |
| | | # if rate < old_rate: |
| | | # 改小才能重新囊括 |
| | | trade_record_log_util.add_common_msg(code, "L后重新囊括", msg=f"修改撤单比例: {old_rate}->{rate}") |
| | | LCancelBigNumComputer().re_compute_l_down_watch_indexes(code, is_force=True) |
| | | LCancelBigNumComputer().re_compute_l_down_watch_indexes(code, is_force=True, is_human=True) |
| | | |
| | | 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后撤单比例 |