Selling all positions
Ziyi Liew last edited by
My algo currently makes multiple buys (self.buy()) but when a sell/stop is hit, the positions are sold separately at different times (using self.sell()). How can I sell all the open positions at once in one order?
tianjixuetu last edited by
@Ziyi-Liew maybe you can implement it by yourself,I don't know it has this function.But you can use a for-loop
for data in self.datas: size=self.getposition(data).size if size!=0: self.close(data)
this for loop will close all your position.