| | |
| | | import json |
| | | import logging |
| | | import socket |
| | | import time |
| | | |
| | | from code_attribute import global_data_loader, code_volumn_manager, first_target_code_data_processor |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | |
| | | |
| | | @classmethod |
| | | def push(cls, datas): |
| | | cls.__get_redis().lpush(cls.__L2_CODE_KEY, json.dumps(datas)) |
| | | cls.__get_redis().lpush(cls.__L2_CODE_KEY, json.dumps((int(time.time()), datas))) |
| | | |
| | | @classmethod |
| | | def pop(cls): |
| | |
| | | if code in global_util.zyltgb_map: |
| | | zyltgb = global_util.zyltgb_map[code] |
| | | # 量的单位为手(不是股) |
| | | fitem = {"code": code, "price": d[1], "volume": d[3] // (10000*100), "volumeUnit": 1, "time": "00:00:00", |
| | | fitem = {"code": code, "price": d[1], "volume": d[3] // (10000 * 100), "volumeUnit": 1, "time": "00:00:00", |
| | | "zyltgb": zyltgb // 10000, "zyltgbUnit": 1} |
| | | flist.append(fitem) |
| | | print("首板代码数量", len(flist)) |