Closed olafsep01 closed 12 years ago
Hi Olaf, could you try the latest master. You should be able to add combo legs using the ComboLegList class now
contract.comboLegs = ComboLegList([leg1, leg2])
Let me know if it works ok
Hi Kieran, thanks. I have tested it in 2.7 and it works flawless.
Were you able to send the order successfully?
I am unable to add a comboLeg to a contract:
make comboLeg: leg1 = ComboLeg() leg1.conId = conId leg1.ratio = 1 leg1.action = "BUY" leg1.exchange = "FTA" leg1.openClose = 0 leg1.shortSaleSlot = 0 leg1.designatedLocation = ""
contract = Contract() contract.symbol = "EOE" # abitrary value only combo orders contract.secType = "BAG" # BAG is the security type for COMBO order contract.exchange = "FTA"; contract.currency = "EUR"; contract.comboLegs = ???? <- here I want to add leg1.
In the C++ manual of IB in "Placing a Combination Order": contract.comboLegs = addAllLegs; //including combo order in contract object.
My C++ knowledge is very limited, but I understand comboLegs is a Vector. But I do not know how to translate this to python.