Administrator
2023-07-12 3f0211152de66d278e59eebb5565e3111a47b490
华鑫适配
4个文件已修改
25 ■■■■■ 已修改文件
constant.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_api_server.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/trade_manager.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py
@@ -124,7 +124,8 @@
########华鑫配置########
if not is_windows():
    BUY_MONEY_PER_CODE = 4000
    # 下单1手
    BUY_MONEY_PER_CODE = 100
    L2_SOURCE_TYPE = L2_SOURCE_TYPE_HUAXIN
    JUEJIN_LOCAL_API = False
    TRADE_WAY = TRADE_WAY_HUAXIN
trade/huaxin/trade_api_server.py
@@ -160,6 +160,10 @@
                                return_str = json.dumps({"code": 1, "msg": "未处于可撤单状态"})
                        else:
                            return_str = json.dumps({"code": 1, "msg": "请上传代码"})
                        # 更新委托列表
                        trade_data_request_queue.put_nowait({"type": "delegate_list"})
                        # 更新资金
                        trade_data_request_queue.put_nowait({"type": "money"})
                        break
                    elif type_ == 'sell':
trade/huaxin/trade_server.py
@@ -5,18 +5,15 @@
import random
import socket
import socketserver
import threading
import time
import constant
from code_attribute import gpcode_manager
from l2 import l2_data_manager_new, l2_log, code_price_manager
from l2.huaxin import huaxin_target_codes_manager
from log_module.log import hx_logger_l2_upload, hx_logger_contact_debug, hx_logger_trade_callback, \
    hx_logger_l2_orderdetail, hx_logger_l2_transaction, hx_logger_trade_debug, hx_logger_l2_market_data
    hx_logger_l2_orderdetail, hx_logger_l2_transaction, hx_logger_l2_market_data
from trade.huaxin import huaxin_trade_api as trade_api, huaxin_trade_api, huaxin_trade_record_manager
from utils import socket_util
from trade.huaxin import huaxin_trade_api as trade_api, trade_api_server
trade_data_request_queue = queue.Queue()
@@ -140,9 +137,9 @@
                        hx_logger_trade_callback.info(data_json)
                        sk.sendall(json.dumps({"code": 0}).encode(encoding='utf-8'))
                        # 重新请求委托列表与资金
                        trade_data_request_queue.put_nowait({"type": "delegate_list"})
                        trade_data_request_queue.put_nowait({"type": "money"})
                        trade_data_request_queue.put_nowait({"type": "deal_list"})
                        trade_api_server.trade_data_request_queue.put_nowait({"type": "delegate_list"})
                        trade_api_server.trade_data_request_queue.put_nowait({"type": "money"})
                        trade_api_server.trade_data_request_queue.put_nowait({"type": "deal_list"})
                        # print("响应结果:", data_json['data'])
                    elif data_json["type"] == "l2_order":
                        # L2逐笔委托
trade/trade_manager.py
@@ -351,6 +351,9 @@
    try:
        if constant.API_TRADE_ENABLE:
            count = (constant.BUY_MONEY_PER_CODE // int(round(float(price) * 100))) * 100
            # 最低下单1手
            if count < 100:
                count = 100
            if constant.TRADE_WAY == constant.TRADE_WAY_JUEJIN:
                trade_juejin.order_volume(code, price, count)
            elif constant.TRADE_WAY == constant.TRADE_WAY_HUAXIN: