Administrator
2024-04-19 69326ac0e494b819016f28862c9822c7155d0fd8
test/test_sell.py
@@ -2,6 +2,7 @@
from l2.l2_data_manager import OrderBeginPosInfo
from l2.l2_transaction_data_manager import HuaXinSellOrderStatisticManager
from l2 import l2_data_util, cancel_buy_strategy
from l2.place_order_single_data_manager import L2TradeSingleDataProcessor
from log_module import log_export, async_log_util
from utils import tool
@@ -68,7 +69,7 @@
    for data in datas:
        for d in data:
            if d[6] == 24975654:
                print(d[1]*d[2], d)
                print(d[1] * d[2], d)
            type = -1
            if d[7] > d[6]:
@@ -148,13 +149,26 @@
        # print(i, sum([x[1] * x[2] for x in big_sell_order_info[1]]), big_sell_order_info)
def test_process_transaction_datas():
    data_map = log_export.load_huaxin_transaction_map(date="2024-04-17")
    code = "002376"
    datas = data_map.get(code)
    l2_data_util.load_l2_data(code)
    L2TradeSingleDataProcessor.add_l2_delegate_limit_up_sell(code, {"val": {"orderNo": 123123}, "index": 123})
    for data in datas:
        L2TradeSingleDataProcessor.process_passive_limit_up_sell_data(code, data, 5.78)
if __name__ == '__main__':
    # s
    real_order_time_ms = "09:30:47" + ".{0:0>3}".format(220)
    big_sell_order_info = [1809599, [[7351750, 208000, 8.7, (11042670, 527268), (11042670, 527275)]]]
    max_money = 0
    for x in big_sell_order_info[1]:
        deal_time = l2_huaxin_util.convert_time(x[4][0], with_ms=True)
        if real_order_time_ms:
            if tool.trade_time_sub_with_ms(deal_time, real_order_time_ms) >= 0:
                print("123123")
    # real_order_time_ms = "09:30:47" + ".{0:0>3}".format(220)
    # big_sell_order_info = [1809599, [[7351750, 208000, 8.7, (11042670, 527268), (11042670, 527275)]]]
    # max_money = 0
    # for x in big_sell_order_info[1]:
    #     deal_time = l2_huaxin_util.convert_time(x[4][0], with_ms=True)
    #     if real_order_time_ms:
    #         if tool.trade_time_sub_with_ms(deal_time, real_order_time_ms) >= 0:
    #             print("123123")
    test_process_transaction_datas()