| | |
| | | from third_data.third_blocks_manager import CodeThirdBlocksManager, SOURCE_TYPE_KPL, BlockMapManager |
| | | from trade import trade_manager, l2_trade_util, trade_data_manager, trade_constant |
| | | import l2_data_util as l2_data_util_old |
| | | from trade.buy_money_count_setting import BuyMoneyAndCountSetting |
| | | from trade.buy_money_count_setting import BuyMoneyAndCountSetting, RadicalBuyBlockCodeCountManager |
| | | |
| | | from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \ |
| | | huaxin_trade_record_manager, huaxin_trade_order_processor, huaxin_sell_util |
| | |
| | | desc_list.append("【红名单】") |
| | | if green: |
| | | desc_list.append("【绿名单】") |
| | | |
| | | |
| | | result = {"code": 0, "data": {"code_info": (code, code_name), "desc": "".join(desc_list)}} |
| | | self.send_response(result, client_id, request_id) |
| | |
| | | data = { |
| | | "normal": BuyMoneyAndCountSetting().get_normal_buy_setting(), |
| | | "radical": BuyMoneyAndCountSetting().get_radical_buy_setting(), |
| | | "moneys":constant.AVAILABLE_BUY_MONEYS |
| | | "moneys": constant.AVAILABLE_BUY_MONEYS |
| | | } |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | | request_id) |
| | | elif ctype == "set_radical_buy_block_count_setting": |
| | | # 设置买入金额和数量 |
| | | data_str = data["data"] |
| | | setting = json.loads(data_str) |
| | | RadicalBuyBlockCodeCountManager().set_block_code_count(setting) |
| | | self.send_response({"code": 0, "data": setting, "msg": f""}, |
| | | client_id, |
| | | request_id) |
| | | elif ctype == "get_radical_buy_block_count_setting": |
| | | # 设置买入金额和数量 |
| | | data = RadicalBuyBlockCodeCountManager().get_block_code_count_settings() |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | | request_id) |
| | | |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | logger_debug.exception(e) |