说明 / 示例
# 28)以市价单方式止损/止盈 stoploss_marketprice()
用法: stoploss_marketprice(mode,accountid,stockcode,stopprice,volume,orderderction)
释义: 以市价单方式止损/止盈
参数:
mode:int,止损:0,止盈:1
accountid:string,账号
stockcode:string,需要止损的品种,代码.市场格式(600000.SH,IF2003.IF)
stopprice:double,止损点
volume:int,止损单的下单量,不填写时候默认平该品种全仓
orderderction:string,买卖方向,期货止损时候必须填写”short”对应平空,”long”对应平多,品种为股票时填写””
示例:
```py
def handlebar(ContextInfo):
stoploss_marketprice(0,'10455','IF2003.IF',3000.12,1,"long")
```