Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are not getting the local correct. The correct format uses a field six characters wide (OSI spec), and you are trying 5 and 4, respectively.</p> <p>You aren't required to use local of course, but that requires more details across different args then.</p> <pre><code>&gt; reqContractDetails(ibg, twsOPT("AAPL 110820C00390000")) [[1]] List of 18 $ version : chr "6" $ contract :List of 16 ..$ conId : chr "86896934" ..$ symbol : chr "AAPL" ..$ sectype : chr "OPT" ..$ exch : chr "SMART" ..$ primary : chr "" ..$ expiry : chr "20110819" ..$ strike : chr "390.0" ..$ currency : chr "USD" ..$ right : chr "C" ..$ local : chr "AAPL 110820C00390000" ..$ multiplier : chr "100" ..$ combo_legs_desc: chr "" ..$ comboleg : chr "" ..$ include_expired: chr "" ..$ secIdType : chr "" ..$ secId : chr "" ..- attr(*, "class")= chr "twsContract" $ marketName : chr "AAPL" $ tradingClass : chr "AAPL" $ conId : chr "86896934" $ minTick : chr "0.01" $ orderTypes : chr [1:44] "ACTIVETIM" "ADJUST" "ALERT" "ALGO" ... $ validExchanges: chr [1:12] "SMART" "AMEX" "BATS" "BOX" ... $ priceMagnifier: chr "1" $ underConId : chr "265598" $ longName : chr "APPLE INC" $ contractMonth : chr "201108" $ industry : chr "Technology" $ category : chr "Computers" $ subcategory : chr "Computers" $ timeZoneId : chr "EST" $ tradingHours : chr "20110817:0930-1600;20110818:0930-1600" $ liquidHours : chr "20110817:0930-1600;20110818:0930-1600" </code></pre> <p>You can either extract the contract using as.twsContract:</p> <pre><code>as.twsContract(reqContractDetails(ibg, twsOPT("AAPL 110820C00390000"))) </code></pre> <p>Or just call the reqMktData request as is:</p> <pre><code>reqMktData(ibg, twsOPT("AAPL 110820C00390000")) ## OR reqMktData(ibg, twsOPT("",symbol="AAPL",right="C", strike="390", expiry="201108")) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload