Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6767259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:55:46+00:00 2026-05-26T14:55:46+00:00

I was trying to use IBrokers package with the simplest code like below: library(IBrokers)

  • 0

I was trying to use IBrokers package with the simplest code like below:

library(IBrokers)

tws <- twsConnect()

aapl.csv <- file("AAPL.csv", open="wa")

# run an infinite-loop ( <C-c> to break )
reqMktData(tws, twsSTK("AAPL"), 
        eventWrapper=eWrapper.MktData.CSV(1), 
        file=aapl.csv)

close(aapl.csv)
close(tws)

I get this error:

2 1 321 Error validating request:-'oc' : 
cause - Incorrect generic tick list of 100,101,104,106,165,221,225,236. 
Legal ones for (STK)

And everything hangs…

the whole log is here:

R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-mingw32/x64 (64-bit)

> library(IBrokers)
Loading required package: xts
Loading required package: zoo

Attaching package: 'zoo'

The following object(s) are masked from 'package:base':

    as.Date, as.Date.numeric

IBrokers version 0.9-3:
Implementing API Version 9.64
This software comes with NO WARRANTY.  Not intended for production use!
See ?IBrokers for details
Warning messages:
1: package 'IBrokers' was built under R version 2.13.2
2: package 'xts' was built under R version 2.13.2
3: package 'zoo' was built under R version 2.13.2
>
> tws <- twsConnect()
>
> aapl.csv <- file("AAPL.csv", open="a")
>
> # run an infinite-loop ( <C-c> to break )
> reqMktData(tws, twsSTK("AAPL"),
+         eventWrapper=eWrapper.MktData.CSV(1),
+         file=aapl.csv)
2 -1 2104 Market data farm connection is OK:cashfarm
2 -1 2104 Market data farm connection is OK:usfarm
2 -1 2106 HMDS data farm connection is OK:ushmds2a
2 1 321 Error validating request:-'oc' : cause - Incorrect generic tick list of 100,101,104,106,165,221,225,236.  Legal ones for (STK) are: 100(Option Volume),101(Option Open Interest),104(Historical Volatility),105(Average Opt Volume),106(Option Implied Volatility),107(Close Implied Volatility),125(Bond analytic data),165(Misc. Stats),166(CScreen),225(Auction),233(RTVolume),236(inventory),258/47(Fundamentals),291(Close Implied Volatility),293(TradeCount),294(TradeRate),295(VolumeRate),318(LastRTHTrade),370(ParticipationMonitor),370(ParticipationMonitor),377(CttTickTag),377(CttTickTag),381(IB Rate),384(RfqTickRespTag),384(RfqTickRespTag),387(DMM),388(Issuer Fundamentals),391(IBWarrantImpVolCompeteTick),407(FuturesMargins),411(Real-Time Historical Volatility)

> (Command cancelled)
>
> close(aapl.csv)
> close(tws)

What am I doing wrong here? Any idea for resolution or pointer to references highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:55:47+00:00Added an answer on May 26, 2026 at 2:55 pm

    The error says that your tick list is bad. If you compare it to the valid ones it reports, you’ll see that 221 is the culprit. Thankfully, doing ?reqMktData tells us that you can specify your own tick list with the tickGenerics option. So just do something like

    > reqMktData(tws, twsSTK("AAPL"), 
             eventWrapper=eWrapper.MktData.CSV(1), 
             file=aapl.csv, tickGenerics="100,101,104,106,165,225,236")
    

    and you should be good to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying use the code shown below to plot in such a way
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
Trying to use a DataGridView like the old VB6 FlexGrid, and add the coloumns
I am relatively new to CMake, and I'm trying use the boost asio library
I'm trying use a Visual Studio 2010 setup project to package a set of
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I am trying use a Java Uploader in a ROR app (for its ease

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.