• Ask a question
  • Spaces
    • TT® Platform
    • Autospreader®
    • Autotrader™
    • Charting & Analytics
    • Options
    • ADL®
      • ADL Samples
    • RTD
    • APIs
      • TT .NET SDK
      • TT API & XT API
      • TT REST API
    • Cryptocurrencies
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges
  • Sign in
  • Home /
  • APIs /
  • TT .NET SDK /
avatar image
0
Question by jmargiotta · Jun 17, 2019 at 02:45 PM · TT.NET.SDKStrategiesOptions

Option Strategies

I am trying to do an InstrumentLookup on an option strategy I can see already "created" in the TT Desktop GUI in uatCert environment:

Exchange: CME
Type: Strategy
Product: OZN
Instrument: OZN Jul19 125.5 Straddle

... but I get an "Instrument not found" event message. I do not have this problem for Futures and Options productType. Any suggestions?

Comment
Add comment
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

10 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by trishmessina · Jun 18, 2019 at 01:05 PM

@jmargiotta Again, it is on the todo list.
Have you tried using the InstrumentCatalog and/or InstrumentCatalogSubscription class? This will download the entire product at which point you could code up a search of the catalog for an instrument that already exists instead of looking for the one single instrument. Then, if you use the InstrumentCatalogSubscription is will trigger a callback when a new instrument is created (changed or deleted) via the OnData event. The event will inform you about what happened and give you the instrument(s) affected. You would care about ProductDataEvent.InstrumentCreated. If the characteristics of the instrument match what you are looking for, you would have the instrument.
So while we do not have the do the strategy creation from the SDK yet, we do have the ability to let you know when something is created from some other source. Thanks for your input and please let me know if you have any other questions or ideas for instrument searching.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by trishmessina · Jun 17, 2019 at 08:29 PM

@jmargiotta Are you specifying 'OZN Jul19 125.5 Straddle' as the alias and OptionStrategy as the product type?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jmargiotta · Jun 17, 2019 at 09:03 PM

Ah no was just using "Strategy" as that is what the field is named on the Desktop GUI. "OptionStrategy" works fine for my example.

However, this raises a second question for me- is it possible to do an InstrumentLookup on the CME using only a Globex Code? For example, a 10y Treasury Future is simple enough to deduce and map manually; it's just "ZNM9". But the straddle given above has a Globex Code of "UD:T$: ST 0617960489". In fact, any User Defined Security has a Globex Code that is only a hash. If this is not possible, what is the best way to do a mapping to the alias required if the UDS is created outside of the TT .NET API? For example, if I wanted to subscribe to an Iron Condor how would I know the exact alias the API is looking for?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by trishmessina · Jun 17, 2019 at 09:17 PM

@jmargiotta No we currently do not support lookup by the contract's exchange name. Are you saying you know the Globex Code for the user defined strategy when it is created ("UD:T$: ST 0617960489") and want to use that value rather then the alias?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jmargiotta · Jun 18, 2019 at 11:53 AM

@trishmessina yes that's exactly right. My alternative is to guess at TT's alias for every type of UDS given its characteristics. Eventually I can build a library for each OptionStrategy that does the same mapping as TT, but obviously it would be much easier if I could use a unique identifier like a hash. Is it possible to do a lookup by some other OptionStrategy characteristics or do I always have to go through the TT alias?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by trishmessina · Jun 18, 2019 at 12:40 PM

@jmargiotta Searching is on out todo list as we do recognize it can be difficult to find an instrument in the hundred of thousands of instruments out there.
Out of curiosity, how you will know the hash programmatically? If you don't know, couldn't you do the same with the TT alias?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jmargiotta · Jun 18, 2019 at 12:47 PM

@trishmessina CME Direct has an API which returns Globex Code (but is only in beta and currently lacking in other functionality I require). Is there a way to create strategies from scratch in the .NET API the same way it's done on the Desktop GUI? I assume this would return an Instrument object which can then be passed along.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jmargiotta · Jun 18, 2019 at 01:13 PM

@trishmessina InstrumentCatalog was on my list of things to try, though you can see why looking up a security by hash would be far preferable. Thanks for your help!

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jmargiotta · Jun 18, 2019 at 01:58 PM

@trishmessina actually one last quick question- what does the UInt64 overload on InstrumentKey correspond to?

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by trishmessina · Jun 18, 2019 at 02:01 PM

@jmargiotta It is the TT assigned unique id for an instrument - its the value by which we internally reference the instrument. It is assigned when TT first loads the instrument into our product data server and remains assigned forever.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Community

Ask questions and share ideas about the TT® and X_TRADER® platforms.

First time here? See our Getting Started Guide and FAQs.

Follow

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Option Strategy Creation 3 Answers

Price of a product in real time with TT.NET SDK example 4 Answers

Can I subscribe to the same instrument via two applications with two different app keys? 1 Answer

Trade Subscription Product Filter 1 Answer

Site Order Key for each order 2 Answers

Trading Technologies Home - Legal - Privacy - Contact

© 2017 Trading Technologies International, Inc. All rights reserved.

Powered by AnswerHub

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • TT® Platform
  • Autospreader®
  • Autotrader™
  • Charting & Analytics
  • Options
  • ADL®
    • ADL Samples
  • RTD
  • APIs
    • TT .NET SDK
    • TT API & XT API
    • TT REST API
  • Cryptocurrencies
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges