| | |
| | | |
| | | ##############################主动买,被动买################################## |
| | | # 返回主动买,被动买,不买的列表(代码, 名称, 得分, 是否涨停) |
| | | codes_score = __load_codes_scores() |
| | | # codes_score = __load_codes_scores() |
| | | params["initiative_buy_codes"] = [] |
| | | for d in codes_score[0]: |
| | | params["initiative_buy_codes"].append( |
| | | {"name": d[1], "code": d[0], "score": d[2], "limit_up": d[3], "open_limit_up": d[4]}) |
| | | # for d in codes_score[0]: |
| | | # params["initiative_buy_codes"].append( |
| | | # {"name": d[1], "code": d[0], "score": d[2], "limit_up": d[3], "open_limit_up": d[4]}) |
| | | |
| | | params["passive_buy_codes"] = [] |
| | | for d in codes_score[1]: |
| | | params["passive_buy_codes"].append( |
| | | {"name": d[1], "code": d[0], "score": d[2], "limit_up": d[3], "open_limit_up": d[4]}) |
| | | # for d in codes_score[1]: |
| | | # params["passive_buy_codes"].append( |
| | | # {"name": d[1], "code": d[0], "score": d[2], "limit_up": d[3], "open_limit_up": d[4]}) |
| | | |
| | | params["passive_buy_codes"] = params["passive_buy_codes"] |
| | | log.logger_debug.info(f"主动买,被动买耗时:{time.time() - __start_time}") |
| | |
| | | cancel_order_info = trade_info[2] |
| | | format_data.append(cancel_order_info) |
| | | format_data.append(data["val"].get("orderNo")) |
| | | fdatas.append((style_int, format_data)) |
| | | fdatas.append((style_int, trade_info, format_data)) |
| | | return fdatas |
| | | |
| | | |
| | |
| | | ws.write(0, 6, '类型') |
| | | ws.write(0, 7, '重复数量') |
| | | ws.write(0, 8, '撤单时间') |
| | | ws.write(0, 9, '订单号') |
| | | ws.write(0, 9, '备注') |
| | | ws.write(0, 10, '订单号') |
| | | index = 0 |
| | | font = xlwt.Font() |
| | | |
| | | cancel_style = xlwt.easyxf('pattern: pattern solid, fore_colour gray25') |
| | | for fdata in fdatas: |
| | | index += 1 |
| | | style_int = fdata[0] |
| | | data = fdatas[1] |
| | | trade_info = fdata[1] |
| | | data = fdata[2] |
| | | style = None |
| | | if style_int == 0: |
| | | style = xlwt.easyxf('pattern: pattern solid') |
| | | else: |
| | | style = xlwt.easyxf('pattern: pattern solid, fore_colour light_yellow') |
| | | font = xlwt.Font() |
| | | style.font = font |
| | | |
| | | if trade_info: |
| | | if trade_info[0] == 0: |
| | | font.colour_index = 53 |
| | | elif trade_info[0] == 1: |
| | | font.colour_index = 17 |
| | | elif trade_info[0] == 2: |
| | | font.colour_index = 10 |
| | | |
| | | for i in range(len(data)): |
| | | if data[i] is None: |
| | |
| | | |
| | | if __name__ == "__main__": |
| | | try: |
| | | export_l2_excel("600476") |
| | | export_l2_excel("000010") |
| | | except Exception as e: |
| | | logging.exception(e) |