开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: OCA Order Examples


 

After working on this further, my main issue seems to be with the contract field in the placeOrder for the OCA. When checking via relevant prints, the list doesn't seem to contain the full contract details. Relevant code pasted below.

? ? ? ? ocaContract = [stock1contract, stock2contract, stock3contract]
? ? ? ? ocaOrders = [stock1limitorder, stock2limitorder, stock3limitorder]
? ? ? ? OneCancelsAll("TestOCA_", ocaOrders, 2)? ? ??
? ? ? ? for o in ocaOrders:
? ? ? ? ? ? self.placeOrder(orderId, Contract(), o)? ??
? ? ? ? ? ??print(Contract(), Order())
? ? ? ? ? ? print("printing o: ", o)



def OneCancelsAll(ocaGroup, ocaOrders, ocaType):
? ? for o in ocaOrders:
? ? ? ? o.ocaGroup = ocaGroup
? ? ? ? o.ocaType = ocaType
?
? ? return ocaOrders


Join [email protected] to automatically receive all group messages.