Administrator
4 天以前 48fb7a00951f91bdc707e5dd2d196e5bccb752c3
api/outside_api_command_callback.py
@@ -54,7 +54,8 @@
from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \
    huaxin_trade_record_manager, huaxin_trade_order_processor, huaxin_sell_util
from trade.huaxin.huaxin_trade_record_manager import PositionManager, DealRecordManager, DelegateRecordManager
from trade.buy_radical.radical_buy_data_manager import RadicalBuyBlockManager, BeforeSubDealBigOrderManager
from trade.buy_radical.radical_buy_data_manager import RadicalBuyBlockManager, BeforeSubDealBigOrderManager, \
    TotalDealBigOrderThresholdMoneyManager
from trade.sell import sell_manager
from trade.sell.sell_rule_manager import TradeRuleManager, SellRule
from trade.trade_data_manager import RadicalBuyDealCodesManager
@@ -1319,7 +1320,9 @@
                    if volumes_data:
                        is_new_top = code_nature_analyse.is_new_top(code,
                                                                    gpcode_manager.get_limit_up_price_by_preprice(code,
                                                                                                                  volumes_data[0]["close"]),
                                                                                                                  volumes_data[
                                                                                                                      0][
                                                                                                                      "close"]),
                                                                    volumes_data)
                data = {
@@ -1390,7 +1393,8 @@
                                    "top_block_count_by_market_strong": constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG,
                                    "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
                                    "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
                                    }}
                self.send_response({"code": 0, "data": data, "msg": f""},
                                   client_id,
@@ -1414,6 +1418,9 @@
                    if radical_buy.get('buy_first_limit_up') is not None:
                        constant.CAN_BUY_FIRST_LIMIT_UP = True if radical_buy.get(
                            'buy_first_limit_up') else False
                    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
                self.send_response({"code": 0, "data": {}, "msg": f""},
                                   client_id,
@@ -1472,8 +1479,26 @@
                                   client_id,
                                   request_id)
            elif ctype == "test_cancel_order":
                # 获取相同板块的涨停代码数量
                code = data.get("code")
                trade_manager.start_cancel_buy(code, force=True)
                self.send_response({"code": 0, "data": {}},
                                   client_id,
                                   request_id)
            elif ctype == "set_total_deal_big_order_threshold_money":
                code = data.get("code")
                money = data.get("money")
                if not code or not money:
                    self.send_response({"code": 1, "data": {}, "msg": "code/money为空"},
                                       client_id,
                                       request_id)
                    return
                TotalDealBigOrderThresholdMoneyManager().set_money(code, int(money))
                self.send_response({"code": 0, "data": {}},
                                   client_id,
                                   request_id)
        except Exception as e:
            logging.exception(e)
            logger_debug.exception(e)