add zt_open_hands
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
from dataclasses import dataclass
|
||||
import math
|
||||
|
||||
from libs.calc import calc_buy_volume, calculate_min_profit_rate
|
||||
from libs.calc import calculate_min_profit_rate
|
||||
from libs.grid_take_profit import GridState
|
||||
from sdk import OP_BUY, OP_SELL, PositionItem, Tick
|
||||
from libs.state import State
|
||||
@@ -190,7 +190,7 @@ def handle_loss(
|
||||
if runtime.orders.busy(stock_code, "BUY"):
|
||||
return TradeDecision(False, "买入委托处理中")
|
||||
|
||||
volume = calc_buy_volume(tick.last_price, runtime.account_cfg.buy_value)
|
||||
volume = runtime.account_cfg.zt_open_hands * 100
|
||||
amount = tick.last_price * volume
|
||||
if volume <= 0 or amount > available:
|
||||
return TradeDecision(False, "本轮可用资金不足")
|
||||
|
||||
Reference in New Issue
Block a user