Author |
Topic: OECAPICOM::IOrderDraftPtr Contract (5 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
MDe las heras Posts: 3 Joined: Mar 05, 2013 |
Hi,
About send orders. When i want to send a new order, i must to put a determinate contrac inside OECAPICOM::IOrderDraftPtr, but, Do I should get the contract information before send the order? Can I send a new orden to 'ESZ3' sending only this instrument code? OECAPI()->RequestContracts(OECAPI()->BaseContracts->FindBySymbol("ES")); Regards Miguel angel De las heras |
||||
MDe las heras Posts: 3 Joined: Mar 05, 2013 |
i've seen the solution.
OECAPICOM::IContractPtr contract = OECAPI()->Contracts->Item("ESH4"); Regards. Miguel angel De las heras |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hi. There is a chance that OECAPI()->Contracts->Item("ESH4") will return NULL. OECAPI loads on start only previously traded contracts (for example, if you have a position or an order with such contract). A better way is to lookup a symbol via OECAPI()->SymbolLookup(..) method. Code sample can be found in CppCOMSample
Victor Vins Lead Software Developer |
||||
MDe las heras Posts: 3 Joined: Mar 05, 2013 |
Thanks for your answer.
I've seen the sample in your ccp, and I have a small problem. Maybe, i know your answer, but i would like read your reply: "If i want to send a new order to a deteminate contract (i don't have any order or position. This is my first operation), Should i do the search and find the contract before new order's sending?" Regards. Miguel angel De las heras |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
This is correct.
Victor Vins Lead Software Developer |
||||