i am implementing a martingale strategy. in which i open multiple limit orders and after one order reaches to a specfic profit i want to closs all the remaining limit orders and the open order can any one help me please

self.oList.insert(positioninList,["SELL",limitOrderTicket,openprice/limitprice,tp target])

if(len(self.oList)>0):
for x in range(len(self.oList)):
if(x[0]=="BUY"):
if(x[1].OrderStatus==OrderStatus.Filled) and data[self.syl].Price>=self.olist[3]:
self.Transactions.CancelOpenOrders(self.syl)
self.Liquidate(self.syl)
self.oList=[]
if(x[0]=="SELL"):
if(x[1].OrderStatus==OrderStatus.Filled) and data[self.syl].Price<=self.olist[3]:
self.Transactions.CancelOpenOrders(self.syl)
self.Liquidate(self.syl)
self.oList=[]

 

Author