Skip to content

Commit

Permalink
fix: shidenggui#468 Update judgment conditions to avoid program crashes
Browse files Browse the repository at this point in the history
the condition branch I just modified have a bug when program is in univisal_ths-joinquant mode. bug details references shidenggui#468,  so I update judgment conditions to avoid program crashes
  • Loading branch information
stairclimber authored Jan 19, 2024
1 parent dbb1665 commit f8448a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion easytrader/follower.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _execute_trade_cmd(

# check price
price = trade_cmd["price"]
if not self._is_number(price) or price <= 0:
if not (self._is_number(price) and price > 0):
logger.warning(
"策略 [%s] 指令(股票: %s 动作: %s 数量: %s 价格: %s)超时,指令产生时间: %s 当前时间: %s, 价格无效 , 被丢弃",
trade_cmd["strategy_name"],
Expand Down

0 comments on commit f8448a7

Please sign in to comment.