Administrator
2024-05-30 91352dcbefb04105163ff5bcbaf1ea95b46e9fa5
大股价小市值可下单/增加大单成交列表接口/bug修复
7个文件已修改
58 ■■■■ 已修改文件
constant.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_transaction_data_manager.py 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
output/l2_output_util.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/test.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/data_server.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py
@@ -79,7 +79,6 @@
S_FAST_BIG_RATE = 0.3  # S猛砸
S_FAST_BIG_RATE_WITH_MUST_BUY = 0.6  # S猛砸加红
S_SLOW_RATE = 0.49  # S慢砸
S_SLOW_RATE_WITH_MUST_BUY = 0.79  # S慢砸加红
@@ -187,9 +186,9 @@
    TRADE_ENABLE = True
# 最大的代码价格
MAX_CODE_PRICE = 30 if ALL_ACTIVE_BUY else 30
MIN_CODE_PRICE = 1
MAX_SUBSCRIPT_CODE_PRICE = 50 if ALL_ACTIVE_BUY else 50
MAX_CODE_PRICE = 30
MIN_CODE_PRICE = 1.9
MAX_SUBSCRIPT_CODE_PRICE = 50
# L2数据是否载入完成
L2_DATA_IS_LOADED = False
l2/l2_data_manager_new.py
@@ -976,7 +976,10 @@
            pass
        else:
            # HighIncreaseCodeManager().add_code(code)
            return False, True, f"股价大于{constant.MAX_CODE_PRICE}块/小于{constant.MIN_CODE_PRICE}块"
            # 小市值高股价可买
            zyltgb = global_util.zyltgb_map.get(code)
            if zyltgb > 25e8 or float(limit_up_price) > constant.MAX_SUBSCRIPT_CODE_PRICE:
                return False, True, f"股价大于{constant.MAX_CODE_PRICE}块/小于{constant.MIN_CODE_PRICE}块"
        # place_order_count = cls.__PlaceOrderCountManager.get_place_order_count(code)
        # if place_order_count and place_order_count >= 10:
l2/l2_transaction_data_manager.py
@@ -83,6 +83,17 @@
            return 0
        return int(sum([x[2] for x in self.__total_buy_datas_dict[code]]))
    def get_total_buy_money_list(self, code):
        """
        获取大单列表
        @param code:
        @return:
        """
        if code not in self.__total_buy_datas_dict:
            return 0
        return [x[2] for x in self.__total_buy_datas_dict[code]]
    def get_total_sell_money(self, code):
        """
        获取总共的大单卖金额
output/l2_output_util.py
@@ -25,6 +25,9 @@
                                                                                                 local_today_canceled_buyno_map.get(
                                                                                                     code))
        if left_count > 0 or real_place_order_index == i:
            if dealing_info and int(dealing_info[0]) > total_datas[i]["val"]["orderNo"]:
                # 不能在正在成交位置之前
                continue
            type_ = 0
            num = val['num']
            if dealing_info and str(total_datas[i]["val"]["orderNo"]) == str(
@@ -56,7 +59,6 @@
    if trade_index is None:
        trade_index = 0
    threshold_before_count = max_count // 2
    fresults = __get_trade_queue(code, real_place_order_index, trade_index - 1, real_place_order_index,
                                 threshold_before_count, -1)
    fresults.reverse()
test/test.py
@@ -20,12 +20,13 @@
if __name__ == "__main__":
    results = JueJinHttpApi.get_exchanges_codes("SHSE,SZSE", sec_types=[8], skip_suspended=True, skip_st=True,
                                                fields="symbol, sec_type, sec_id,sec_name, underlying_symbol, delisted_date")
    fresults = []
    for r in results:
        tool.get_now_date_str()
        if int(tool.get_now_date_str('%Y%m%d')) >= int(r['delisted_date'].strftime('%Y%m%d')):
            continue
        fresults.append(r)
    print(len(fresults))
    print(25e8)
    # results = JueJinHttpApi.get_exchanges_codes("SHSE,SZSE", sec_types=[8], skip_suspended=True, skip_st=True,
    #                                             fields="symbol, sec_type, sec_id,sec_name, underlying_symbol, delisted_date")
    # fresults = []
    # for r in results:
    #     tool.get_now_date_str()
    #     if int(tool.get_now_date_str('%Y%m%d')) >= int(r['delisted_date'].strftime('%Y%m%d')):
    #         continue
    #     fresults.append(r)
    # print(len(fresults))
third_data/data_server.py
@@ -377,7 +377,7 @@
            trade_progress, is_default = transaction_progress.TradeBuyQueue().get_traded_index(code)
            # 获取正在成交, 计算成交进度
            dealing_info = HuaXinBuyOrderManager.get_dealing_order_info(code)
            percent = 0
            percent = 100
            if dealing_info:
                total_datas = l2_data_util.local_today_datas.get(code)
                if str(total_datas[trade_progress]['val']["orderNo"]) == str(dealing_info[0]):
trade/huaxin/huaxin_trade_server.py
@@ -38,7 +38,7 @@
from l2.l2_data_manager import TradePointManager, OrderBeginPosInfo
from l2.l2_data_util import L2DataUtil
from l2.l2_sell_manager import L2MarketSellManager
from l2.l2_transaction_data_manager import HuaXinBuyOrderManager
from l2.l2_transaction_data_manager import HuaXinBuyOrderManager, BigOrderDealManager
from l2.l2_transaction_data_processor import HuaXinTransactionDatasProcessor
from l2.place_order_single_data_manager import L2TradeSingleCallback, L2TradeSingleDataManager
from log_module import async_log_util, log_export
@@ -1701,6 +1701,14 @@
                real_place_order_index = SCancelBigNumComputer().get_real_place_order_index_cache(code)
                trade_queue = l2_output_util.get_trade_queue(code, real_place_order_index, count)
                self.send_response({"code": 0, "data": trade_queue}, client_id, request_id)
            elif ctype == "get_deal_big_money_list":
                # 获取大单成交列表
                code = data["code"]
                data_list = BigOrderDealManager().get_total_buy_money_list(code)
                results = [ output_util.money_desc(d) for d in data_list]
                self.send_response({"code": 0, "data": results}, client_id, request_id)
        except Exception as e:
            logging.exception(e)
            self.send_response({"code": 1, "msg": f"数据处理出错:{e}"}, client_id, request_id)