reqHistoricalData for comboLeg

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

reqHistoricalData for comboLeg

Niklas K
Hi,

I am trying to get historical data for a comboLeg with the following code:



  tws <- twsConnect(1)
  bag <- twsBAG(    list(
    twsComboLeg( conId = "43635367", ratio = "1", action = "BUY",
exchange = "SMART"
      )
      ,
      twsComboLeg(  conId = "47207284", ratio = "1", action = "SELL",
exchange = "SMART"
      )
    )
  )
  reqHistoricalData(tws, Contract=bag, barSize='1 min', duration='2 D')




For some reason it gets stuck at:
"waiting for TWS reply on USD ..."

If someone has been successfully getting data for comboLegs from IB tws
I would be thankful for any tips.

-niklas

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: reqHistoricalData for comboLeg

Jeffrey Ryan
Hi Niklas,

I haven't been able to check, but I don't think you can use
exhange="SMART", rather it must be explicit, i.e. "CBOE".

I also don't think you can get the combo price, rather you need to request
the historical data for each leg.  Would of course love to be proved
wrong...


HTH
Jeff


On Sat, Apr 20, 2013 at 2:51 AM, Niklas K <[hidden email]> wrote:

> Hi,
>
> I am trying to get historical data for a comboLeg with the following code:
>
>
>
>  tws <- twsConnect(1)
>  bag <- twsBAG(    list(
>    twsComboLeg( conId = "43635367", ratio = "1", action = "BUY", exchange
> = "SMART"
>      )
>      ,
>      twsComboLeg(  conId = "47207284", ratio = "1", action = "SELL",
> exchange = "SMART"
>      )
>    )
>  )
>  reqHistoricalData(tws, Contract=bag, barSize='1 min', duration='2 D')
>
>
>
>
> For some reason it gets stuck at:
> "waiting for TWS reply on USD ..."
>
> If someone has been successfully getting data for comboLegs from IB tws I
> would be thankful for any tips.
>
> -niklas
>
> ______________________________**_________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<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.
>



--
Jeffrey Ryan
[hidden email]

www.lemnica.com

R/Finance 2013: Applied R in Finance
May 17, 18 Chicago, IL
www.RinFinance.com

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: reqHistoricalData for comboLeg

Niklas K
Hi,

Thanks, thats right can probably not use "SMART" there.

It appears possible to get comboLeg data from the IB API:
https://stat.ethz.ch/pipermail/r-sig-finance/2012q3/010588.html


-n



On 20.4.2013 16:13, Jeff Ryan wrote:

> Hi Niklas,
>
> I haven't been able to check, but I don't think you can use
> exhange="SMART", rather it must be explicit, i.e. "CBOE".
>
> I also don't think you can get the combo price, rather you need to
> request the historical data for each leg.  Would of course love to be
> proved wrong...
>
>
> HTH
> Jeff
>
>
> On Sat, Apr 20, 2013 at 2:51 AM, Niklas K <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     I am trying to get historical data for a comboLeg with the following
>     code:
>
>
>
>       tws <- twsConnect(1)
>       bag <- twsBAG(    list(
>         twsComboLeg( conId = "43635367", ratio = "1", action = "BUY",
>     exchange = "SMART"
>           )
>           ,
>           twsComboLeg(  conId = "47207284", ratio = "1", action =
>     "SELL", exchange = "SMART"
>           )
>         )
>       )
>       reqHistoricalData(tws, Contract=bag, barSize='1 min', duration='2 D')
>
>
>
>
>     For some reason it gets stuck at:
>     "waiting for TWS reply on USD ..."
>
>     If someone has been successfully getting data for comboLegs from IB
>     tws I would be thankful for any tips.
>
>     -niklas
>
>     _________________________________________________
>     [hidden email] <mailto:[hidden email]>
>     mailing list
>     https://stat.ethz.ch/mailman/__listinfo/r-sig-finance
>     <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.
>
>
>
>
> --
> Jeffrey Ryan
> [hidden email] <mailto:[hidden email]>
>
> www.lemnica.com <http://www.lemnica.com>
>
> R/Finance 2013: Applied R in Finance
> May 17, 18 Chicago, IL
> www.RinFinance.com <http://www.RinFinance.com>
>

_______________________________________________
[hidden email] 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.