strategy/basic_methods.py
@@ -88,6 +88,7 @@
        if last_price != 0:
            growth = (price - last_price) / last_price * 100  # 计算涨幅百分比
            return growth
    finally:
        history_price[symbol] = price
        # print(f"price======={price}")
@@ -184,7 +185,7 @@
def secure_volume(now_date_time):
    # 定义时间段的开始和结束时间(使用字符串格式)
    time_slots = [
        (("09:30:00", "09:30:30"), 0.05),
        (("09:30:00", "09:30:30"), 0.04),
        (("09:30:30", "09:31:00"), 0.08),
        (("09:31:00", "09:31:30"), 0.1),
        (("09:31:30", "09:32:00"), 0.15),
@@ -207,9 +208,14 @@
    return 0
# 示例使用
# now = datetime.now()
# print(f"secure_volume(now)=={secure_volume(now)}")
# 充分交易量公式 用于计算日内涨幅段理论的安全交易量值
def sufficient_volume(current_volume, yesterday_volume, today_growth):
    if today_growth > 0:
        if current_volume > yesterday_volume * 0.8 * today_growth:
            return True
        else:
            return False
# 计算 委买和委卖的比例函数(获取买盘强度数据)【掘金数据结构】
def buying_and_selling_ratio(current_quotes):