cae724f751e1ccc797ec6457af5f11ad8a2f24f2..f48ecf11b3402d045cbf2a665a990a635f539afd
2025-05-28 admin
删除多余日志
f48ecf 对比 | 目录
2025-05-28 admin
修复 当前有意购买统计的 BUG
591415 对比 | 目录
2025-05-28 admin
修复 当前有意购买统计的 BUG
eaef1b 对比 | 目录
5个文件已修改
27 ■■■■■ 已修改文件
log_module/log_export.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/basic_methods.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/kpl_data_manager.py 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/log_export.py
@@ -52,7 +52,7 @@
    __log_file_contents[md5] = (time.time(), contents)
    return contents
# 加载板块强度日志
def load_market_sift_plate(date=tool.get_now_date_str()):
    """
     获取精选流入的成分股
@@ -76,6 +76,7 @@
    return fdatas
# 加载个股强度日志
def load_kpl_market_stock_heat(date=tool.get_now_date_str()):
    """
     获取精选流入的成分股
main.py
@@ -193,9 +193,10 @@
    # 实时L2买1成交量
    def OnRealTimeBuy1Info(self, code, buy1_info):
        pass
        # buy1_info: [买1时间,买1价格, 原始买1量, 实时买1量]
        # 最终的买1为: 原始买1量+实时买1量
        async_log_util.info(logger_debug, f"OnRealTimeBuy1Info:{code}-{buy1_info}")
        # async_log_util.info(logger_debug, f"OnRealTimeBuy1Info:{code}-{buy1_info}")
        # L1DataProcessor.excute_sell_rule(code, buy1_info[3], buy1_info[1], "l2-real")
strategy/basic_methods.py
@@ -211,7 +211,7 @@
# 充分交易量公式 用于计算日内涨幅段理论的安全交易量值
def sufficient_volume(current_volume, yesterday_volume, today_growth):
    if today_growth > 0:
        if current_volume > yesterday_volume * 0.8 * today_growth:
        if current_volume > yesterday_volume * 0.5 * today_growth:
            return True
        else:
            return False
strategy/buying_strategy.py
@@ -315,7 +315,7 @@
                                        logger_info(f"重复相交概念==={intersection_plate}")
                                    # 调用充分交易量函数
                                    sufficient_volume = basic_methods.sufficient_volume(current_volume, k_line_data[0]['volume'], today_growth)
                                    logger_info(f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{round(current_volume/k_line_data[0]['volume'], 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                    logger_info(f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{round(current_volume/k_line_data[0]['volume']/100, 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                    logger_info(f"【有概念】(涨停列表中包含自身概念 且 不是唯一包含概念不可用) !最新价: {current_price},,当日当时涨幅:{today_growth}%。")
                                    # 有概念有强度视界
                                    if strength_list_have_it is True:
@@ -384,8 +384,11 @@
                                            logger_info(
                                                f"【不利】当日成交量小于昨日成交量的{ratios}倍!不买!!公司名称:{k_line_data[0]['sec_name']},当日当时总成交量:{current_volume},最新价: {current_price}")
                                            return
                                        data_cache.willing_buy_list.add_buy_code(k_line_data[0]['sec_name'])
                                        data_cache.willing_buy_list.append(k_line_data[0]['sec_name'])
                                        logger_info(f"当前有意购买:{k_line_data[0]['sec_name']},有意购买列表:{data_cache.willing_buy_list}")
                                        if data_cache.have_plate_buy_times >= 1 and k_line_data[0]['sec_name'] not in data_cache.willing_buy_list:
                                            logger_info(
                                                f"【不利】有概念买入已经 1 次,且未曾进入过有意购买列表!不买了!!公司名称:{k_line_data[0]['sec_name']},")
                                        if len(intersection_plate) > 0:
                                            logger_info(
                                                f"【不利】同概念只买一次,不买了,公司名称:{k_line_data[0]['sec_name']},重复相交概念==={intersection_plate}")
@@ -553,7 +556,7 @@
                                                                                            k_line_data[0]['volume'],
                                                                                            today_growth)
                                        logger_info(
                                            f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                            f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{round(current_volume/k_line_data[0]['volume']/100, 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                        if last_volume_to_growth_ratio < 1:
                                            logger_info(
                                                f"【有强度 有小量换大涨幅】瞬时量幅比< 1 !瞬时量幅比:{round(last_volume_to_growth_ratio, 2)}%,最新价: {current_price},瞬时涨幅:{round(tick_growth, 2)}%,当日当时涨幅:{today_growth}%,当前时间:{current_created_at}。")
strategy/kpl_data_manager.py
@@ -27,8 +27,11 @@
        self.__load_data()
    def __filter_origin_data(self, data):
        return (data[0], [x[1] for x in data[1][0]],
                {p: [xx for xx in data[1][1][p]] for p in data[1][1]})
        """
        :param data: 格式:(时间,[数据,])
        :return:
        """
        return data
    def add_log(self, in_plates_info, plate_codes_info):
        oringin_data = (tool.get_now_time_str(), in_plates_info, plate_codes_info)
@@ -74,4 +77,5 @@
if __name__ == '__main__':
    KPLMarketStockHeatLogManager()
    KPLMarketsSiftPlateLogManager().load_data()
    # KPLMarketStockHeatLogManager()