1.有概念逻辑分支 修改 【不利】进入次数参数
2.充分交易量公式 优化 计算公式
3.修改下单最低价格
3个文件已修改
22 ■■■■ 已修改文件
strategy/basic_methods.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/order_methods.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/basic_methods.py
@@ -210,8 +210,8 @@
# 充分交易量公式 用于计算日内涨幅段理论的安全交易量值
def sufficient_volume(current_volume, yesterday_volume, today_growth):
    if today_growth > 0 and round(current_volume / yesterday_volume / 100, 2) >= 0.01:
        if current_volume > yesterday_volume * 0.5 * (today_growth/100):
    if today_growth > 0 and round(current_volume / yesterday_volume, 2) >= 0.01:
        if current_volume > yesterday_volume * (today_growth/10):
            return True
        else:
            return False
strategy/buying_strategy.py
@@ -351,7 +351,7 @@
                                        # 调用充分交易量函数
                                        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'] / 100, 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                            f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{(current_volume / k_line_data[0]['volume'])}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                        # elif k_line_data[0]['attribute'] == 'up_down' and k_line_data[0]['today_volume_shape'] == 'increases_down':
                                        #     logger_info(f"【不利】昨日高开低走 且 放量下跌,不买!!")
                                        if k_line_data[0]['attribute'] == 'down_down' and k_line_data[0]['today_volume_shape'] == 'increases_down':
@@ -386,13 +386,13 @@
                                            logger_info(
                                                f"【不利】当日成交量小于昨日成交量的{ratios}倍!不买!!公司名称:{k_line_data[0]['sec_name']},当日当时总成交量:{current_volume},最新价: {current_price}")
                                            return
                                        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}")
                                        willing_buy_times = basic_methods.count_willing_buy_times(k_line_data[0]['sec_name'])
                                        if data_cache.have_plate_buy_times >= 1 and willing_buy_times < 2:
                                            logger_info(
                                                f"【不利】有概念买入已经 1 次,且进入有意购买列表次数<2,不买了!!公司名称:{k_line_data[0]['sec_name']},")
                                            return
                                        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}")
                                                f"【不利因素】有概念买入已经 1 次,且进入有意购买列表次数<2,不买了!!公司名称:{k_line_data[0]['sec_name']},")
                                        #     return
                                        if len(intersection_plate) > 0:
                                            logger_info(
                                                f"【不利】同概念只买一次,不买了,公司名称:{k_line_data[0]['sec_name']},重复相交概念==={intersection_plate}")
@@ -477,9 +477,9 @@
                                                logger_info(f"【不利】昨日跌停!不买!!")
                                                return
                                            # 调用充分交易量函数
                                            sufficient_volume = basic_methods.sufficient_volume(current_volume,k_line_data[0]['volume'],today_growth)
                                            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'] / 100, 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                                f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{(current_volume / k_line_data[0]['volume'])}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                            if k_line_data[0]['attribute'] == 'up_down' and k_line_data[0]['today_volume_shape'] == 'increases_down':
                                                logger_info(f"【不利】昨日高开低走 且 放量下跌,不买!!")
                                                return
@@ -588,7 +588,7 @@
                                                # 调用充分交易量函数
                                                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'] / 100, 2)}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                                    f"【{k_line_data[0]['sec_name']}】当日当时量是否相对涨幅充足?===【{sufficient_volume}】 !当时与昨日成交率占比:{(current_volume / k_line_data[0]['volume'])}%,当日当时总成交量:{round(current_volume / 10000, 2)}万,昨日的总成交量{round(k_line_data[0]['volume'] / 10000, 2)}万,当日当时涨幅:{today_growth}%。")
                                                # if k_line_data[0]['attribute'] == 'up_down' and k_line_data[0]['today_volume_shape'] == 'increases_down':
                                                #     logger_info(
                                                #         f"【不利】昨日高开低走 且 放量下跌,不买!!")
strategy/order_methods.py
@@ -33,7 +33,7 @@
        logger.info(f"在交易方法函数处 关闭了 自动买")
        return
    # 限制交易标的的单价范围
    if current_price < 3 or current_price > 30:
    if current_price < 2.5 or current_price > 30:
        # 当前单价超出预设限制
        logger.info(f"当前标的个股【{sec_name}】单价超出预设限制!预设值3 < current_price < 30,当前最新价{current_price}")
        return