{"id":8072,"date":"2025-09-04T23:21:58","date_gmt":"2025-09-05T04:21:58","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=8072"},"modified":"2025-09-04T23:23:51","modified_gmt":"2025-09-05T04:23:51","slug":"working-with-options","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-net-sdk\/subscribing-for-market-data-tt-net-sdk\/working-with-options\/","title":{"rendered":"Working with options"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">TT&#8217;s Options trading tools provide traders with all the tools they need to view and analyze option markets, identify opportunities, and assess position risk.&nbsp;<a href=\"\/trade\/aop-overview.html\">TT\u2019s Advanced Options Package<\/a>&nbsp;is an add-on that enables options analytics and other powerful tools for viewing and trading options. If you are permissioned for this feature, you can also access the&nbsp;<a href=\"\/trade\/opc-overview.html\">options chain<\/a>&nbsp;through TT .NET SDK.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"process-for-creating-options-chain-subscriptions\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#process-for-creating-options-chain-subscriptions\"><\/a>Process for creating options chain subscriptions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To create an options chain subscription and start receiving updates, you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OptionsChainSubscription.html\">OptionsChainSubscription<\/a>\u00a0object for a specific instrument.<\/li>\n\n\n\n<li>Create an event handler method to be called when options chain updates are available.<\/li>\n\n\n\n<li>Register the event handler with the\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OptionsChainSubscription.html\">OptionsChainSubscription<\/a>\u00a0instance.<\/li>\n\n\n\n<li>Call the\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OptionsChainSubscription.html#tt_net_sdk_OptionsChainSubscription_Start\">Start()<\/a>\u00a0method of the\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OptionsChainSubscription.html\">OptionsChainSubscription<\/a>\u00a0instance.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"subscribing-for-options-chains\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#subscribing-for-options-chains\"><\/a>Subscribing for options chains<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following snippet demonstrates how to instantiate an OptionsChainSubscription instance with specifying a low and high strike in the constructor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private OptionsChainSubscription m_optSub = null;\n\n\n    {\n      \/\/ \u2026\n      \/\/ Subscribe for market Data\n      m_optSub = new OptionsChainSubscription(MarketId.CME, \"LO\", \"Jun20\", \n              16M, 28M, tt_net_sdk.Dispatcher.Current);\n      m_optSub.FieldsUpdated += chain_FieldsUpdated;\n      m_optSub.Start();\n      \/\/ \u2026\n    }\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-the-subscription-event-handler\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#creating-the-subscription-event-handler\"><\/a>Creating the subscription event handler<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After the subscription starts, TT .NET SDK retrieves the options chain and invokes the event handler method you registered with the subscription. Subsequent events are then fired as the options chain changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following code snippet shows the structure of a sample options chain subscription event handler method:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void chain_FieldsUpdated(object sender, OptionsChainEventArgs e)\n    {\n      if (e.Error == null)\n      {\n        Console.WriteLine(\"{0} Received {1} update for {2} instruments\", \n                    DateTime.Now, \n                    e.Fields.UpdateDataType.ToString(), \n                    e.Fields.GetChangedInstrumentIds().Length);\n        if (e.Fields.UpdateDataType == UpdateDataType.GreekData)\n        {\n           foreach (var id in e.Fields.GetChangedInstrumentIds())\n           {\n              Instrument i = e.Fields.Instrument(id);\n              string changes = \"  instrument:  \" + i.Name + \" \";\n              foreach (FieldId fid in e.Fields.GetChangedFieldIds(id))\n                {\n                  changes = changes + fid.ToString() + \" \" + e.Fields&#91;fid, id].FormattedValue;\n                }\n              Console.WriteLine(changes);\n           }\n        }\n      }\n      else\n      {\n        if (e.Error != null)\n          {\n            Console.WriteLine(\"Unrecoverable price subscription error: {0}\", e.Error.Message);\n            Dispose();\n          }\n      }\n    }\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p class=\"wp-block-paragraph\">TT&#8217;s Options trading tools provide traders with all the tools they need to view and analyze option markets, identify opportunities, and assess position risk.&nbsp;<a href=\"\/trade\/aop-overview.html\">TT\u2019s Advanced Options Package<\/a>&nbsp;is an add-on that enables options analytics and other powerful tools for viewing and trading options. If you are permissioned for this feature, you can also access the&nbsp;<a href=\"\/trade\/opc-overview.html\">options chain<\/a>&nbsp;through TT .NET SDK.<\/p>\n<h2 class=\"wp-block-heading\" id=\"process-for-creating-options-chain-subscriptions\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#process-for-creating-options-chain-subscriptions\"><\/a>Process for creating options chain subscriptions<\/h2>\n<p class=\"wp-block-paragraph\">To create an options chain subscription and start receiving updates, you:<\/p>\n<h2 class=\"wp-block-heading\" id=\"subscribing-for-options-chains\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#subscribing-for-options-chains\"><\/a>Subscribing for options chains<\/h2>\n<p class=\"wp-block-paragraph\">The following snippet demonstrates how to instantiate an OptionsChainSubscription instance with specifying a low and high strike in the constructor.<\/p>\n<h2 class=\"wp-block-heading\" id=\"creating-the-subscription-event-handler\"><a href=\"\/tt-net-sdk\/articles\/md-working-with-options.html#creating-the-subscription-event-handler\"><\/a>Creating the subscription event handler<\/h2>\n<p class=\"wp-block-paragraph\">After the subscription starts, TT .NET SDK retrieves the options chain and invokes the event handler method you registered with the subscription. Subsequent events are then fired as the options chain changes.<\/p>\n<p class=\"wp-block-paragraph\">The following code snippet shows the structure of a sample options chain subscription event handler method:<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-net-sdk","meta":{"_acf_changed":true,"footnotes":""},"docs-category":[1605],"class_list":["post-8072","doc","type-doc","status-publish","hentry","docs-category-subscribing-for-market-data-tt-net-sdk"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8072\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=8072"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=8072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}