| | |
| | | elif url.path == "/get_l_cancel_datas": |
| | | # 最新的l撤数据 |
| | | ps_dict = dict([(k, v[0]) for k, v in parse_qs(url.query).items()]) |
| | | logger_debug.info(f"l撤数据:{ps_dict}") |
| | | code = ps_dict['code'] |
| | | buy_single_index = ps_dict.get('buy_single_index') |
| | | records = code_info_output.load_trade_record_cancel_watch_indexes(code) |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | run("0.0.0.0", 9004) |
| | | code = "002676" |
| | | buy_single_index = 716 |
| | | records = code_info_output.load_trade_record_cancel_watch_indexes(code) |
| | | # 获取最新的L上与L下 |
| | | records.reverse() |
| | | up_indexes = [] |
| | | down_indexes = [] |
| | | for r in records: |
| | | if buy_single_index and buy_single_index != r[1]: |
| | | continue |
| | | if r[0] == trade_record_log_util.CancelWatchIndexesInfo.CANCEL_TYPE_L_UP: |
| | | up_indexes = r[2] |
| | | break |
| | | for r in records: |
| | | if buy_single_index and buy_single_index != r[1]: |
| | | continue |
| | | if r[0] == trade_record_log_util.CancelWatchIndexesInfo.CANCEL_TYPE_L_DOWN: |
| | | down_indexes = r[2] |
| | | break |
| | | |
| | | response_data = json.dumps( |
| | | {"code": 0, "data": {"up": up_indexes, "down": down_indexes}}) |