TWS API Security Definitions

Discussion in 'Interactive Brokers' started by Real Money, Mar 3, 2020.

  1. Real Money

    Real Money

    Is there a rule for this? Is there something I can reference?

    I have been working around the peculiars of each security definition through trial and error, as well as question threads on ET.

    As an example, I learned (from a helpful ET member) that for ECBOT contracts there is a

    ["Security Abbreviation" <space> <space> <space> "Month" "Year"] syntax.

    Just how exactly do I get from the symbol lookup information to an actual working security definition that the api will recognize?

    The current target security is the Nikkei 225 Mini (N225M@OSE.JPN)
    [here's the info] N225M.png
     
    Last edited: Mar 3, 2020
  2. Use the Conid as starting point and get your requested data from there.
    Define a Contract with conid 333341720 and use reqContractDetails(). The parameters you are looking for will be returned by the API via contractDetails().
     
    Real Money likes this.
  3. Real Money

    Real Money

    Wow, I'm such a hack. How do I get a console that I can just test code with?

    I'm guessing Python?

    I have only used the EXCEL API so far.
     
    Last edited: Mar 3, 2020
  4. Real Money

    Real Money

    Well, anyway guys, if somebody could help me with this one, I would really appreciate it.

    I don't have any real reason to program with the API and I am a nooby programmer, so if somebody could just run the request functions and post the returns here I would really appreciate it.

    This is the only security definition I will need, I promise. :)
     
  5. Try by chance "NK225M FUT OSE.JPN 20200313 JPY" in the description field of the API function.
     
    Real Money likes this.
  6. Real Money

    Real Money

    Hi betcashrun. It still isn't working.....thanks anyway, but I gave up on it.

    The point of this was to be able to derive the futures/cash basis spread for the Nikkei 225.

    Well, I found out that you can just use the CME globex front month contract NIYH20 and spread that against the N225 Index.

    This is awesome! Now I can use all my basis spread tools at night time. :) WOW !!!

    [check it out, it leads price action] {it's a pretty smart algo} :)
    Edge.png
     
    Last edited: Mar 3, 2020
  7. "N225M FUT OSE.JPN 20200312 JPY" is better and might work.
     
  8. DaveV

    DaveV

    I have found that the best way to get the correct IB symbol is to first search in the TWS desktop app for the Symbol or name. TWS will usually prompt with the list of possible symbols. Once you have the right symbol, copy it or click on it to get the ConId.
     
  9. Or, if you prefer to search online instead of via TWS: https://www.interactivebrokers.com/en/index.php?f=463