File was renamed from huaxin/client_network.py |
| | |
| | | import json |
| | | import socket |
| | | |
| | | from huaxin import socket_util |
| | | from huaxin_api import socket_util |
| | | |
| | | SERVER_IP = "127.0.0.1" |
| | | SERVER_PORT = 10008 |
File was renamed from huaxin/command_manager.py |
| | |
| | | import logging |
| | | import threading |
| | | |
| | | from huaxin import socket_util |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin_api import socket_util |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | |
| | | MSG_TYPE_HEART = "heart" |
| | | # 命令信息 |
File was renamed from huaxin/huaxin_trade_api.py |
| | |
| | | import time |
| | | |
| | | import crypt |
| | | from huaxin import socket_util |
| | | from huaxin_api import socket_util |
| | | |
| | | |
| | | class ClientSocketManager: |
File was renamed from huaxin/l1_client.py |
| | |
| | | import threading |
| | | import time |
| | | |
| | | from huaxin import socket_util |
| | | from huaxin import tool |
| | | from huaxin import xmdapi |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin_api import socket_util |
| | | from huaxin_api import tool |
| | | from huaxin_api import xmdapi |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | |
| | | level1_data_dict = { |
| | | |
File was renamed from huaxin/l2_client.py |
| | |
| | | import threading |
| | | import time |
| | | |
| | | from huaxin import command_manager |
| | | from huaxin import constant |
| | | from huaxin import l2_data_manager |
| | | from huaxin import lev2mdapi |
| | | from huaxin.command_manager import L2ActionCallback |
| | | from huaxin.mylog import logger_l2_orderdetail, logger_l2_transaction, logger_l2_subscript |
| | | from huaxin_api import command_manager |
| | | from huaxin_api import constant |
| | | from huaxin_api import l2_data_manager |
| | | from huaxin_api import lev2mdapi |
| | | from huaxin_api.command_manager import L2ActionCallback |
| | | from huaxin_api.mylog import logger_l2_orderdetail, logger_l2_transaction, logger_l2_subscript |
| | | |
| | | Front_Address = "tcp://10.0.1.101:6900" |
| | | Multicast_Address = "udp://224.224.2.19:7889" |
File was renamed from huaxin/l2_data_manager.py |
| | |
| | | import random |
| | | import threading |
| | | import time |
| | | from huaxin import socket_util |
| | | from huaxin_api import socket_util |
| | | |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin.mylog import logger_l2_error, logger_l2_upload |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | from huaxin_api.mylog import logger_l2_error, logger_l2_upload |
| | | |
| | | # 活动时间 |
| | | order_detail_upload_active_time_dict = {} |
File was renamed from huaxin/socket_util.py |
| | |
| | | # 添加数据头 |
| | | import json |
| | | |
| | | from huaxin import crypt |
| | | from huaxin_api import crypt |
| | | |
| | | |
| | | def load_header(data_bytes): |
File was renamed from huaxin/trade_client.py |
| | |
| | | import threading |
| | | import time |
| | | |
| | | from huaxin import command_manager |
| | | from huaxin import constant |
| | | from huaxin import socket_util |
| | | from huaxin import traderapi |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin.log import logger |
| | | from huaxin_api import command_manager |
| | | from huaxin_api import constant |
| | | from huaxin_api import socket_util |
| | | from huaxin_api import traderapi |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | from huaxin_api.log import logger |
| | | |
| | | # 正式账号 |
| | | from huaxin.mylog import logger_trade_debug |
| | | from huaxin_api.mylog import logger_trade_debug |
| | | |
| | | UserID = '388000013349' |
| | | # 登陆密码 |
| | |
| | | import multiprocessing |
| | | |
| | | from db import redis_manager_delegate as redis_manager |
| | | import huaxin_api.trade_client |
| | | import huaxin_api.l2_client |
| | | import huaxin_api.l1_client |
| | | |
| | | from server import * |
| | | |
| | | # 交易服务 |
| | | from third_data import data_server |
| | | from trade.huaxin import trade_server, trade_api_server |
| | | from huaxin import trade_client,l2_client,l1_client |
| | | # from huaxin_api import trade_client, l2_client, l1_client |
| | | |
| | | |
| | | def createTradeServer(pipe_server, pipe_trade, pipe_l1): |
| | |
| | | serverProcess = multiprocessing.Process(target=createServer, args=(pss_server,)) |
| | | serverProcess.start() |
| | | # 交易进程与L2进程 |
| | | tradeProcess = multiprocessing.Process(target=trade_client.run, args=(ptl2_trade, pst_trade)) |
| | | l2Process = multiprocessing.Process(target=l2_client.run, args=(ptl2_l2,)) |
| | | tradeProcess = multiprocessing.Process(target=huaxin_api.trade_client.run, args=(ptl2_trade, pst_trade)) |
| | | l2Process = multiprocessing.Process(target=huaxin_api.l2_client.run, args=(ptl2_l2,)) |
| | | tradeProcess.start() |
| | | l2Process.start() |
| | | # L1订阅数据 |
| | | l1_client.run_async(pl1t_l1) |
| | | huaxin_api.l1_client.run_async(pl1t_l1) |
| | | # 将tradeServer作为主进程 |
| | | createTradeServer(pss_strategy, pst_strategy, pl1t_trade) |
| | |
| | | import time |
| | | |
| | | # 心跳信息 |
| | | from huaxin import socket_util |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin_api import socket_util |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | from utils import middle_api_protocol |
| | | |
| | | MSG_TYPE_HEART = "heart" |
| | |
| | | from code_attribute import gpcode_manager |
| | | from db import mysql_data_delegate as mysql_data, redis_manager_delegate as redis_manager |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from huaxin.client_network import SendResponseSkManager |
| | | from huaxin_api.client_network import SendResponseSkManager |
| | | from l2 import l2_data_manager_new, l2_log, code_price_manager, l2_data_util, l2_data_manager, transaction_progress |
| | | from l2.cancel_buy_strategy import HourCancelBigNumComputer, LCancelBigNumComputer, DCancelBigNumComputer |
| | | from l2.huaxin import huaxin_target_codes_manager |