Administrator
2024-04-09 229b8edc93c135cd5931df606aabf683f1615558
修改可买入最大市值
2个文件已修改
41 ■■■■■ 已修改文件
test/test_sell.py 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/buy_condition_util.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/test_sell.py
@@ -4,6 +4,37 @@
from utils import tool
# 卖单统计
def statistic_sell_order():
    code = "000888"
    data_map = log_export.load_huaxin_transaction_map(date=tool.get_now_date_str())
    datas = data_map.get(code)
    __latest_sell_order_dict = {}
    for data in datas:
        for d in data:
            if code not in __latest_sell_order_dict:
                __latest_sell_order_dict[code] = [d[7], d[2], d[1], (d[3], d[6]), (d[3], d[6])]
            else:
                if __latest_sell_order_dict[code][0] == d[7]:
                    __latest_sell_order_dict[code][1] += d[2]
                    __latest_sell_order_dict[code][2] = d[1]
                    __latest_sell_order_dict[code][4] = (d[3], d[6])
                else:
                    info = __latest_sell_order_dict[code]
                    # 上个卖单成交完成
                    # 封存数据,计算新起点
                    # 大于50w的卖单才会保存
                    # 大于50w加入卖单
                    money = info[1] * info[2]
                    if 101328000 > info[3][0] > 101324000 and info[0] > 12265084:
                        print(money, info)
                    if money >= 500000:
                        pass
                    __latest_sell_order_dict[code] = [d[7], d[2], d[1], (d[3], d[6]), (d[3], d[6])]
def load_sell_info():
    date = tool.get_now_date_str()
    data_map = log_export.load_huaxin_transaction_map(date=date)
@@ -26,12 +57,12 @@
        d = datas[i]
        big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, d)
        if d[-1][7] >= 3911165:
            sell_infos = HuaXinSellOrderStatisticManager.get_latest_transaction_datas(code, 3910694,"09:35:27")
            print( sum([x[1]*x[2] for x in sell_infos]))
            sell_infos = HuaXinSellOrderStatisticManager.get_latest_transaction_datas(code, 3910694, "09:35:27")
            print(sum([x[1] * x[2] for x in sell_infos]))
        if big_sell_order_info[0] < 50 * 10000:
            continue
        print(i, sum([x[1] * x[2] for x in big_sell_order_info[1]]), big_sell_order_info)
if __name__ == '__main__':
    test_sell_order_info()
    statistic_sell_order()
utils/buy_condition_util.py
@@ -11,7 +11,9 @@
def get_zyltgb_threshold(market_sitation: int):
    if market_sitation == MarketSituationManager.SITUATION_GOOD:
        return 31, 100, 40, 100, 40, 80, 100
    return 5.9, 41, 8.9, 25, 8.9, 19, 80
    # return 5.9, 41, 8.9, 25, 8.9, 19, 80
    # TODO 大规模测试
    return 5.9, 2000, 8.9, 25, 8.9, 19, 2000
# 获取量比的等级获取量