比如参数种的 stop、lock、net 这三个参数 是干嘛用的呢?
def send_order(
self,
strategy: CtaTemplate,
direction: Direction,
offset: Offset,
price: float,
volume: float,
stop: bool,
lock: bool,
net: bool
):
"""
"""
contract = self.main_engine.get_contract(strategy.vt_symbol)
if not contract:
self.write_log(f"委托失败,找不到合约:{strategy.vt_symbol}", strategy)
return ""
# Round order price and volume to nearest incremental value
price = round_to(price, contract.pricetick)
volume = round_to(volume, contract.min_volume)
if stop:
if contract.stop_supported:
return self.send_server_stop_order(
strategy, contract, direction, offset, price, volume, lock, net
)
else:
return self.send_local_stop_order(
strategy, direction, offset, price, volume, lock, net
)
else:
return self.send_limit_order(
strategy, contract, direction, offset, price, volume, lock, net
)