假定股指有昨仓 buy 2手,sell 2手; 今天第一笔开仓想要 sell open 1手。 调用的self.short(). 用了锁仓模式lock=True。
结果应该是变成buy1手,sell 2手?(即 buy close 1)--我认为预期结果是这个。
还是 buy 2手,sell 3 手?(即直接sell open 1 )?
按照convert.py代码里的:
if yd_available:
req_yd = copy(req)
if self.exchange in [Exchange.SHFE, Exchange.INE]:
req_yd.offset = Offset.CLOSEYESTERDAY
else:
req_yd.offset = Offset.CLOSE
req_yd.volume = close_volume
req_list.append(req_yd)
发现最终下出去的指令是 sell close。。。为什么不是buy close?!
麻烦大侠指教,谢谢