| | |
| | | import json |
| | | import logging |
| | | import os |
| | | import threading |
| | | |
| | | from api.outside_api_command_manager import ActionCallback |
| | |
| | | fdata["real_time_data"] = RealTimeEnvInfo().to_dict() |
| | | # 历史数据 |
| | | fdata["history_data"] = {} |
| | | print("获取环境", os.getpid()) |
| | | if need_hsitory_data: |
| | | if tool.get_now_time_str() < '16:00:00': |
| | | # 如果在16:00之前采用当前日期 |
| | |
| | | import http |
| | | import json |
| | | import logging |
| | | import os |
| | | import socketserver |
| | | from http.server import BaseHTTPRequestHandler |
| | | |
| | |
| | | strategy_manager.low_suction_strtegy.add_big_orders(params) |
| | | # logger_debug.info("upload_big_order_datas:{}", f"{params}") |
| | | RealTimeEnvInfo().big_order_update_time = tool.get_now_time_str() |
| | | print("获取到大单", os.getpid()) |
| | | result_str = json.dumps({"code": 0}) |
| | | elif url.path == "/upload_block_in_datas": |
| | | # 接收板块流入数据 |
| | |
| | | elif url.path == "/get_codes_by_jx_plates": |
| | | # 根据精选板块获取代码 |
| | | plates = ps_dict.get("plates") |
| | | date = ps_dict.get("date") |
| | | plates = set(json.loads(plates)) |
| | | sql = " select code, jx_blocks from kpl_code_blocks where " + " and ".join( |
| | | sql = f" select code, jx_blocks from kpl_code_blocks where day = '{date}' and " + " and ".join( |
| | | [f"jx_blocks like '%{p}%'" for p in plates]) |
| | | datas = Mysqldb().select_all(sql) |
| | | fdatas = [(x[0], "、".join([ f"<red>{dd}</red>" if dd in plates else dd for dd in json.loads(x[1])])) for x in datas if len(set(json.loads(x[1])) & plates) == len(plates)] |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(get_history_k_bars("2025-06-04")) |
| | | RealTimeEnvInfo().kpl_current_limit_up = tool.get_now_time_str() |
| | | print(RealTimeEnvInfo().to_dict()) |
| | |
| | | days = ["2025-05-12", "2025-05-13", "2025-05-14", "2025-05-15", "2025-05-16", "2025-05-19", "2025-05-20", |
| | | "2025-05-21", "2025-05-22", "2025-05-23", "2025-05-26", "2025-05-27", "2025-05-28", "2025-05-29", |
| | | "2025-05-30", "2025-06-03", "2025-06-04", "2025-06-05", "2025-06-06", "2025-06-09", "2025-06-10", |
| | | "2025-06-11", "2025-06-12", "2025-06-13", "2025-06-16"] |
| | | "2025-06-11", "2025-06-12", "2025-06-13", "2025-06-16", "2025-06-17"] |
| | | |
| | | # days = ["2025-06-13"] |
| | | |