| | |
| | | # 最大的代码价格 |
| | | MAX_CODE_PRICE = 10 if ALL_ACTIVE_BUY else 30 |
| | | MAX_SUBSCRIPT_CODE_PRICE = 30 if ALL_ACTIVE_BUY else 30 |
| | | |
| | | # L2数据是否载入完成 |
| | | L2_DATA_IS_LOADED = False |
| | | |
| | |
| | | load_sell_no_map(local_today_sellno_map, code, local_today_datas.get(code), force) |
| | | load_canceled_buy_no_map(local_today_canceled_buyno_map, code, local_today_datas.get(code), force) |
| | | |
| | | constant.L2_DATA_IS_LOADED = True |
| | | |
| | | |
| | | # 将数据根据num-operate分类 |
| | | def load_num_operate_map(local_today_num_operate_map, code, source_datas, clear=False): |
| | |
| | | import threading |
| | | |
| | | from l2.l2_transaction_data_manager import HuaXinSellOrderStatisticManager |
| | | from log_module import log_export, async_log_util |
| | | from l2 import l2_data_util |
| | | |
| | | if __name__ == "__main__": |
| | | code = "603363" |
| | | threading.Thread(target=async_log_util.run_sync, daemon=True).start() |
| | | map_ = log_export.load_huaxin_transaction_map() |
| | | for datas in map_[code]: |
| | | total_sell_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas) |
| | | if total_sell_info[0] > 0 and total_sell_info[1]: |
| | | print(total_sell_info) |
| | | input() |
| | | codes = ["600603"] |
| | | for code in codes: |
| | | l2_data_util.load_l2_data(code) |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | latest_index = -1 |
| | | for d in total_datas: |
| | | if d["index"] - latest_index != 1: |
| | | print(d["index"], d) |
| | | latest_index = d["index"] |
| | | # print(total_datas[0]) |
| | | # print(len(total_datas)) |
| | | # print(l2_data_util.l2_data_is_normal(code)) |
| | | |
| | | # threading.Thread(target=async_log_util.run_sync, daemon=True).start() |
| | | # map_ = log_export.load_huaxin_transaction_map() |
| | | # for datas in map_[code]: |
| | | # total_sell_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas) |
| | | # if total_sell_info[0] > 0 and total_sell_info[1]: |
| | | # print(total_sell_info) |
| | | # input() |
New file |
| | |
| | | from l2 import l2_data_util |
| | | from l2.l2_transaction_data_manager import HuaXinSellOrderStatisticManager |
| | | from l2.place_order_single_data_manager import L2TradeSingleDataProcessor |
| | | from log_module import log_export |
| | | |
| | | if __name__ == '__main__': |
| | | code = "000622" |
| | | l2_data_util.load_l2_data(code) |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | L2TradeSingleDataProcessor.add_l2_delegate_limit_up_sell(code, total_datas[537]) |
| | | data_map = log_export.load_huaxin_transaction_map() |
| | | datas = data_map.get(code) |
| | | for i in range(len(datas)): |
| | | d = datas[i] |
| | | HuaXinSellOrderStatisticManager.add_transaction_datas(code, d, 3.44) |
| | | |
| | | pass |
| | |
| | | |
| | | @classmethod |
| | | def l2_order(cls, code, _datas, timestamp): |
| | | if not constant.L2_DATA_IS_LOADED: |
| | | logger_debug.info(f"{code}还未载入L2本地数据") |
| | | return |
| | | |
| | | now_time = time.time() |
| | | use_time = int((now_time - timestamp) * 1000) |
| | | thread_id = random.randint(0, 100000) |