Skip to content
Prev 14331 / 15274 Next

Fteching options data using package IBrokers and interactivebrokers

On Sun, 25 Jun 2017, amol gupta writes:
Use 'twsContract' and specify only the local symbol, the
exchange, the currency and the security type:

   require("IBrokers")
   c <- twsContract(local = 'HDFC17JUN1780CE', sectype = "OPT",
                    currency = 'INR', exch = 'NSE',
                    include_expired = 1,
                    conId = "", symbol = "", primary = "", expiry = "", 
                    strike = "", right = "", multiplier = "",
                    combo_legs_desc = "", comboleg = "", secIdType = "",
                    secId = "")
   
   tws <- twsConnect()
   reqContractDetails(tws, c)

   ## List of 18
   ##  $ version       : chr "8"
   ##  $ contract      :List of 16
   ##   ..$ conId          : chr "271618757"
   ##   ..$ symbol         : chr "HDFC"
   ##   ..$ sectype        : chr "OPT"
   ##   ..$ exch           : chr "NSE"
   ## [....]

See also
https://github.com/enricoschumann/IButils#finding-the-contract-specification
Message-ID: <87k23zg8ad.fsf@enricoschumann.net>
In-Reply-To: <CAO7kh0Erq09A---+LkCWXdAxeFWZiMNnQJqa0EXpLRdxTzQp+Q@mail.gmail.com> (amol gupta's message of "Sun, 25 Jun 2017 13:39:43 +0530")