反手只开仓,不平仓

OnBar(ArrayRef<Integer> indexs) { A_GetPosition(mypos); longvolume=mypos.longCurrentVolume;//获取多头持仓 shortvolume=mypos.shortCurrentVolume; //获取空头持仓 if (longvolume==1 and shortvolume==0 and low<=averagclose) { Array<Integer> orders; Bool ret = A_SellShort(Symbol, 1, Low_limit, orders, "", ""); } }A_Buy,A_Sellshort 不能起到反手的作用吗?为啥总是只开仓,不平仓。记得回测模型里头Sellshort和buy函数是有平仓反手的作用。

那是不是得先写平仓,再开仓,分两条语句来写?

回复:是的

回复:感谢😀

不能图表是自动反手,但是a函数不行