Skip to content

reqHistoricalData for comboLeg

3 messages · Jeff Ryan, 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
#
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: