| | |
| | | |
| | | import constant |
| | | from db.redis_manager import RedisManager |
| | | from log_module.log import logger_juejin_trade |
| | | from log_module.log import logger_juejin_trade, hx_logger_trade_debug |
| | | from trade.huaxin import huaxin_trade_api |
| | | from utils import tool, huaxin_util |
| | | from l2 import huaxin |
| | |
| | | try: |
| | | result = huaxin_trade_api.order(1, code, count, price) |
| | | print("华鑫下单耗时", time.time() - start_time) |
| | | logger_juejin_trade.info(f"{code}:下单耗时{round(time.time() - start_time, 3)}s") |
| | | hx_logger_trade_debug.info(f"{code}:下单耗时{round(time.time() - start_time, 3)}s") |
| | | except Exception as e: |
| | | if str(e).find("超时") >= 0: |
| | | # 此处出现超时,需要通过读取委托列表来设置订单信息 |
| | | pass |
| | | hx_logger_trade_debug.error(f"{code}:下单结果反馈出错-{str(e)}") |
| | | else: |
| | | raise e |
| | | |