admin
2025-03-03 56f1a4db492a1b86a718503c0fad79ee7e54139f
data_server.py
@@ -6,7 +6,7 @@
from http.server import BaseHTTPRequestHandler
import urllib.parse as urlparse
from log_module.log import hx_logger_l2_transaction
from log_module.log import hx_logger_l2_transaction, logger_debug
from strategy import data_cache
from trade import huaxin_trade_api, huaxin_trade_data_update
from trade.huaxin_trade_record_manager import DelegateRecordManager, DealRecordManager, MoneyManager, PositionManager
@@ -83,6 +83,7 @@
            fdatas = []
            for code in codes:
                data = data_cache.latest_code_market_info_dict.get(code)
                logger_debug.info(f"获取L1行情接口:{code}-{data}")
                if data:
                    fdatas.append(data)
            response_data = json.dumps({"code": 0, "data": fdatas})
@@ -145,7 +146,7 @@
                    price = tool.get_buy_max_price(current_price)
                    price = min(price, tool.get_limit_up_price(code,pre_price))
                else:
                    price = round(params.get("price"), 2)  # 价格
                    price = round(float(params.get("price")), 2)  # 价格
                result = huaxin_trade_api.order(1, code, volume, price, blocking=True)
                result_str = json.dumps(result)
            elif url.path == "/sell":