Administrator
2025-04-01 3c73469c54a73e1828d627b6956f5b818040ff52
今日辨识度/Linux编译环境
2个文件已修改
1个文件已添加
232 ■■■■■ 已修改文件
linux_env.sh 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/buy_radical/radical_buy_data_manager.py 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/current_price_process_manager.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
linux_env.sh
New file
@@ -0,0 +1,137 @@
# Linux环境下的依赖安装
Cython    0.29.32
Deprecated    1.2.13
Jinja2    3.1.2
MarkupSafe    2.1.2
Pillow    9.4.0
Polygon3    3.0.9.1
PyDispatcher    2.0.7
PyMySQL    1.0.2
PySocks    1.7.1
PyWavelets    1.3.0
PyYAML    6
Unidecode    1.3.6
aiohttp    3.8.3
aioredis    2.0.1
aiosignal    1.3.1
altgraph    0.17.3
argh    0.27.2
arrow    1.2.2
astroid    2.12.10
async-generator    1.1
async-timeout    4.0.2
asynctest    0.13.0
attrs    22.2.0
certifi    2022.6.15
cffi    1.15.1
charset-normalizer    2.1.0
click    8.1.3
cloudpickle    2.2.1
cnocr    2.2.2.1
cnstd    1.2
colorama    0.4.5
coloredlogs    15.0.1
cycler    0.11.0
dask    2022.2.0
dill    0.3.5.1
easyocr    1.6.2
exceptiongroup    1.1.0
flatbuffers    23.1.21
fonttools    4.38.0
frozenlist    1.3.3
fsspec    2023.1.0
future    0.18.2
gevent    22.10.2
gm    3.0.143
greenlet    2.0.2
grpcio    1.48.0
h11    0.14.0
humanfriendly    10
idna    3.3
imageio    2.26.0
importlib    1.0.4
importlib-metadata    4.12.0
isort    5.10.1
kiwisolver    1.4.4
lazy-object-proxy    1.7.1
lightning-utilities    0.6.0.post0
line-profiler    4.0.3
llvmlite    0.39.1
locket    1.0.0
loguru    0.6.0
matplotlib    3.5.3
mccabe    0.7.0
mpmath    1.2.1
msgpack    1.0.5
multidict    6.0.4
networkx    2.6.3
ninja    1.11.1
numba    0.56.4
numpy    1.21.6
onnx    1.13.0
onnxruntime    1.13.1
opencv-python    4.7.0.68
opencv-python-headless    4.5.4.60
outcome    1.2.0
packaging    21.3
pandas    1.3.5
partd    1.3.0
pefile    2023.2.7
pip    22.3.1
platformdirs    2.5.2
playwright    1.35.0
protobuf    3.20.3
psutil    5.9.5
pyclipper    1.3.0.post4
pycparser    2.21
pyee    9.0.4
pygame    2.1.2
pyinstaller    5.8.0
pyinstaller-hooks-contrib    2023
pylint    2.15.3
pymongo    4.2.0
pyparsing    3.0.9
pyreadline    2.1
python-bidi    0.4.2
python-dateutil    2.8.2
pytorch-lightning    1.9.0
pytz    2022.2.1
pywin32    304
pywin32-ctypes    0.2.0
pyzmq    25.1.2
redis    4.3.4
requests    2.28.1
schedule    1.1.0
scikit-image    0.19.3
scipy    1.7.3
selenium    4.8.0
setuptools    67.6.0
shapely    2.0.0
six    1.16.0
sniffio    1.3.0
sortedcontainers    2.4.0
sympy    1.10.1
threadpool    1.3.2
tifffile    2021.11.2
tkintertable    1.3.3
tomli    2.0.1
tomlkit    0.11.5
tool    0.8.0
toolz    0.12.0
torch    1.12.1
torchmetrics    0.11.0
torchvision    0.13.1
tqdm    4.64.1
trio    0.22.0
trio-websocket    0.9.2
typed-ast    1.5.4
typing-extensions    4.3.0
urllib3    1.26.11
win32-setctime    1.1.0
wrapt    1.14.1
wsproto    1.2.0
xlwt    1.3.0
yarl    1.8.2
zipp    3.8.1
zope.event    5
zope.interface    6
trade/buy_radical/radical_buy_data_manager.py
@@ -1187,26 +1187,64 @@
            if len(before_special_codes) >= 3:
                return False, f"前排辨识度>=3个({before_special_codes})"
        # 判断是净流入前排
        # in_blocks = RealTimeKplMarketData.get_top_market_jingxuan_blocks()
        # if block not in in_blocks:  # or in_blocks.index(block) >= constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL:
        #     return False, f"没有在精选净流入前{constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL}"
        # if history_index >= 4:
        #     # 判断量是否换够
        #     volume_rate = CodeVolumeManager().get_volume_rate_refer_in_5days(code)
        #     if volume_rate < 0.8:
        #         return False, f"处于首板老{history_index + 1},量比({volume_rate})<0.8"
        # 前排最多允许1个炸板
        # limit_up_timestamp = cls.__get_limit_up_timestamp(code)
        # # 获取当前的板块, 不要忽略开1的数据
        # current_index, current_before_codes_info = cls.__get_current_index(code, block, yesterday_limit_up_codes,
        #                                                                    limit_up_time=limit_up_timestamp,
        #                                                                    ignore_open_limit_up=False)
        # if history_index - current_index > 1:
        #     return False, f"前排只允许一个炸板:炸板个数-{history_index - current_index}"
        return True, f"处于首板老{history_index + 1}"
    @classmethod
    def __today_block_special_codes(cls, code, block, yesterday_limit_up_codes):
        """
        今日板块辨识度:
        板块是净流入排名前5,且板块有≥2个涨停包含目标票,自由市值≥50亿,买首板前二
        @param code:
        @param block:
        @return:
        """
        zyltgb = global_util.zyltgb_map.get(
            code)
        if not zyltgb or zyltgb < 50e8:
            return False, "自由流通小于50亿"
        # 板块是否在净流入前5
        jx_in_blocks = RealTimeKplMarketData.get_top_market_jingxuan_blocks()
        if not jx_in_blocks or block not in jx_in_blocks or jx_in_blocks.index(block) >= 5:
            return False, "尚未在净流入前5"
        # 板块包含自己至少2个涨停
        codes = LimitUpDataConstant.get_current_limit_up_block_codes(block)
        if not codes:
            return False, "当前板块尚未涨停"
        codes = set(codes)
        codes.add(code)
        if len(codes) < 2:
            return False, "板块涨停个数小于2个"
        history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block,
                                                                                                        yesterday_limit_up_codes,
                                                                                                        ignore_open_limit_up=False)
        if history_before_codes_info:
            before_codes = [x[0] for x in history_before_codes_info]
            big_zylt_count = 0
            for c in before_codes:
                zyltgb = global_util.zyltgb_map.get(
                    c)
                if zyltgb and zyltgb >= 50e8:
                    big_zylt_count += 1
            if big_zylt_count >= 2:
                return False, "前排有2个大市值票"
        return True, f"处于首板老{history_index + 1}"
    @classmethod
    def is_today_block_special_codes(cls, code, block, yesterday_limit_up_codes):
        """
        是否有今日辨识度
        @param code:
        @param block:
        @param yesterday_limit_up_codes:
        @return:
        """
        result = cls.__today_block_special_codes(code, block, yesterday_limit_up_codes)
        if result[0]:
            return True
        return False
    @classmethod
    def __get_limit_up_timestamp(cls, code):
@@ -1393,6 +1431,15 @@
                    msges.append(f"【{b}】:{result[1]}")
                fmsges.append("首封板块辨识度判断##" + ",".join(msges))
        # 今日辨识度判断
        msges = []
        for b in keys_:
            result = cls.__today_block_special_codes(code, b, yesterday_limit_up_codes)
            if result[0]:
                can_buy_blocks.add(b)
            msges.append(f"【{b}】:{result[1]}")
        fmsges.append("今日板块辨识度判断##" + ",".join(msges))
        # 新题材只买前2
        if can_buy_blocks:
            msges.clear()
trade/current_price_process_manager.py
@@ -128,6 +128,16 @@
                continue
            # 净流入 + 辨识度
            return index + 1
    # 判断今日辨识度
    try:
        for b in blocks:
            if radical_buy_data_manager.RadicalBuyBlockManager.is_today_block_special_codes(code, b, yesterday_limit_up_codes):
                if b in top_in_blocks:
                    index = top_in_blocks.index(b)
                    return index + 1
    except Exception as e:
        logger_debug.exception(e)
    return 10000