Administrator
7 天以前 ae8d76a456b64c1c6c4ebf11b6ec33b7df217b1a
api/outside_api_command_callback.py
@@ -320,11 +320,11 @@
            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)
@@ -806,7 +806,7 @@
            current_price = L1DataManager.get_l1_current_price(code)
            if current_price:
                fdata["cost_price"] = current_price
                pre_close_price = CodePrePriceManager.get_price_pre_cache(code)
                pre_close_price = CodePrePriceManager().get_price_pre_cache(code)
                if current_price and pre_close_price:
                    rate = round((float(current_price) - float(pre_close_price)) / float(pre_close_price), 4)
                    fdata["cost_price_rate"] = rate
@@ -1438,7 +1438,8 @@
                                    "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL,
                                    "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_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
                                    }}
                self.send_response({"code": 0, "data": data, "msg": f""},
                                   client_id,
@@ -1465,6 +1466,9 @@
                    if radical_buy.get('can_auto_add_white') is not None:
                        constant.CAN_AUTO_ADD_WHITE = True if radical_buy.get(
                            'can_auto_add_white') else False
                    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
                self.send_response({"code": 0, "data": {}, "msg": f""},
                                   client_id,
@@ -1615,7 +1619,7 @@
                    result = {"code": 1, "msg": "拉取K线失败"}
                else:
                    # 更新昨日收盘价数据
                    CodePrePriceManager.set_price_pre(code, volumes_data[0]['close'], force=True)
                    CodePrePriceManager().set_price_pre(code, volumes_data[0]['close'], force=True)
                    gpcode_manager.clear_limit_up_price_cache(code)
                    limit_up_price = gpcode_manager.get_limit_up_price_as_num(code)
                    # 更新K线特征数据