[R-SIG-Finance] IBrokers: issues with combo contracts

Jeffrey Ryan jeff.a.ryan at gmail.com
Thu May 17 19:21:44 CEST 2012


I don't think I've tried this, so I may be wrong, but twsBAG isn't a real
contract, it is for the order itself.  Therefore you can't get mktData on
it.

Additionally, snapshot= isn't in the documentation for reqMktData.

Read the docs,and then see if you can get further along.  It (API and
IBrokers) is intentionally tricky to prevent wide-spread self-inflicted
harm ;-)  And 'paper account' is a good step...

Best,
Jeff

On 5/17/12 12:03 PM, "Alain Burt" <alainb978 at gmail.com> wrote:

>Hi there,
>
>I am having some troubles with the use of the IBrokers package on my IB
>paper account. I am trying to get market data and an order execution for a
>combo contract, with no success in both cases. I wonder if anyone could
>help. Here is the code I tried
>
>
>
>  ibg <- ibgConnect()
>
>
>
>leg1 <- twsComboLeg( conId = "79265697",
>
>                                   ratio = 1,
>
>                                action = "BUY",
>
>                           exchange = "SMART")
>
>
>
>leg2 <- twsComboLeg( conId = "79265687",
>
>                                   ratio = 1,
>
>                                action = "SELL",
>
>                           exchange = "SMART")
>
>
>
> reqMktData(conn = ibg, Contract = twsBAG(leg1,leg2), tickGenerics = "",
>tickerId = "1", snapshot = T)
>
>
>
> placeOrder(ibg, twsBAG(leg1,leg2), twsOrder(reqIds(ibg),"BUY",1,"MKT"))
>
>
>
>About the market data, I am not getting anything, even by setting snapshot
>= F. As for the order, it is placed but never executed. Could it be a
>problem with contract objects created by twsBAG ? Does anyone know how to
>fix these issues ?
>
>
>
>Best regards,
>
>Alain
>
>	[[alternative HTML version deleted]]
>
>_______________________________________________
>R-SIG-Finance at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>-- Subscriber-posting only. If you want to post, subscribe first.
>-- Also note that this is not the r-help list where general R questions
>should go.



More information about the R-SIG-Finance mailing list