Skip to content

Commit f8448a7

Browse files
authored
fix: shidenggui#468 Update judgment conditions to avoid program crashes
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
1 parent dbb1665 commit f8448a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

easytrader/follower.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _execute_trade_cmd(
278278

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

0 commit comments

Comments
 (0)