1

Here's the very simple code, but you need Interactive Brokers' TWS to run it:

opt <- twsOption(local = '', expiry = '20121019', 
                 strike = '146', right = 'C', symbol = 'SPY')
reqMktData(tws, opt, verbose = FALSE)

Running it, you'll get a stream of SPY Oct. '12 C146 datas; my question is: how may I tell IBrokers API to return me just particular fields, like underlying price, implied volatility, Delta Greek etc. instead of that data stream?

I would need to manage those datas in formulas etc.

Thanks,

FXQuantTrader
  • 6,821
  • 3
  • 36
  • 67
Lisa Ann
  • 3,345
  • 6
  • 31
  • 42
  • 1
    See `?eWrapper` and `?twsCALLBACK` – GSee Sep 24 '12 at 15:02
  • Hi, GSee; I'm trying to understand how to use them, unfortunately `twsCALLBACK()` doesn't have any reproducible example, while I do not really understand those included in `eWrapper()`. Would it be possible to have an example of what I'm asking for? Thanks, – Lisa Ann Sep 24 '12 at 21:36
  • I'm not certain about the details with options, but you can look at the source to see examples of eWrappers ([1](http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.updateAccount.R), [2](http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.snapshot.R), [3](http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.data.R), [4](http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.MktDepth.CSV.R) and, from another package,[5](https://r-forge.r-project.org/scm/viewvc.php/pkg/twsInstrument/R/eWrapper.FXdata.R?view=markup&root=twsinstrument)) – GSee Sep 25 '12 at 14:38
  • 2
    The idea is that you create an eWrapper (`eW <- eWrapper(NULL)`), then overwrite the method you care about (which, I think will be `eW$tickOptionComputation` in your case). The [IB API docs](http://www.interactivebrokers.com/en/software/api/apiguide/tables/tick_types.htm) will be useful as well. – GSee Sep 25 '12 at 14:38
  • May I use the same of C++, too? http://www.interactivebrokers.com/php/apiUsersGuide/apiguide/c/class_ewrapper_functions.htm#XREF_60804_Class_EWrapper – Lisa Ann Sep 27 '12 at 06:49

0 Answers0