Options

About 14 min

Get Options Expiration Date

Description

Get the Expiration date for option. Maximum number of options per request is 30

Argument

ArgumentTypeRequiredDescription
symbolsarrayYessymbols of underlying assets, Maximum number of symbols is 30 per request
marketstringYesUS,HK

ResponseTigerOpenAPI.Quote.Response.OptionExpirationResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionExpirationResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionExpirationItem> Data { get; set; }

  }
}

Use OptionExpirationResponse.Data to access the data. This property will return a OptionExpirationItemobject, where TigerOpenAPI.Quote.Response.OptionExpirationItem has the following attributes:

NameTypeDescription
symbolstringStock ticker symbol
countintnumber of expiration dates available
datesarrayExpiration date. format:'YYYY-MM-DD', Example: 2024-06-28
timestampsarrayExpiration date in millisecond timestamp, such as 1544763600000
periodTagsarrayOption period tag, "m" is the monthly option, "w" is the weekly option

use the corresponding get method, such as OptionExpirationItem.Symbol to access relevant data fields, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionExpirationResponse?> GetOptionExpirationAsync(QuoteClient quoteClient)
  {
    TigerRequest<OptionExpirationResponse> request = new TigerRequest<OptionExpirationResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_EXPIRATION,
      ModelValue = new OptionExpirationModel()
      {
        Symbols = new List<string> { "AAPL" },
        Market = Market.US
        //Symbols = new List<string> { "PAI.HK" },
        //Market = Market.HK
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data": [
        {
            "symbol": "AAPL",
            "count": 19,
            "dates": [
                "2024-06-28",
                "2024-07-05",
                "2024-07-12",
                "2024-07-19",
                "2024-07-26",
                "2024-08-02",
                "2024-08-16",
                "2024-09-20",
                "2024-10-18",
                "2024-11-15",
                "2024-12-20",
                "2025-01-17",
                "2025-03-21",
                "2025-06-20",
                "2025-09-19",
                "2025-12-19",
                "2026-01-16",
                "2026-06-18",
                "2026-12-18"
            ],
            "timestamps": [
                1719547200000,
                1720152000000,
                1720756800000,
                1721361600000,
                1721966400000,
                1722571200000,
                1723780800000,
                1726804800000,
                1729224000000,
                1731646800000,
                1734670800000,
                1737090000000,
                1742529600000,
                1750392000000,
                1758254400000,
                1766120400000,
                1768539600000,
                1781755200000,
                1797570000000
            ],
            "periodTags": [
                "w",
                "w",
                "w",
                "m",
                "w",
                "w",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "m",
                "w",
                "m"
            ]
        }
    ],
    "code": 0,
    "message": "success",
    "timestamp": 1719405873603,
    "sign": "utNCKc73HQ0ikC4LINiUGVUgPm5LypCndq1CVSSNNc+cD9yoCG/euWaNaQx5it92jNaKsizolCsxcijZZEDGvliSuUhBNeu33/0FP7vOrKTietkHO6UQnBvUJoEc5oe6J3B7TdNC2xjN3t0jYRbI8Doi5q5EXMWQYt0/GrpEvFs="
}

Get Option Chain

Description

Get option chain. The returned Greek letters are the last updated data of the previous trading day, and you can use Option indicator calculation to calculate the latest value in the intraday

Argument

ArgumentTypeRequiredDescription
symbolstringYesTicker symbol of underlying asset
expirylongYesExpiration date in millisecond timestamp. maximum number of symbol-expiry combination being quoted is 30
marketstringYesUS, HK

Filtering parameters:

ArgumentTypeRequiredDescription
implied_volatilitydoubleNoImplied volatility
in_the_moneybooleanNoIf the contract is in the money
open_interestintNoopen interest
deltadoubleNodelta
gammadoubleNogamma
thetadoubleNotheta
vegadoubleNovega
rhodoubleNorho

ResponseTigerOpenAPI.Quote.Response.OptionChainResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionChainResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionChainItem> Data { get; set; }
  }
}

Use OptionChainResponse.Data to access returned data. This method will return a OptionChainItem object, whereTigerOpenAPI.Quote.Response.OptionChainItem has the following attributes:

NameTypeDescription
symbolstringTicker symbol of the underlying asset
expirylongExpiration date of the contract
itemsList<OptionRealTimeQuoteGroup>a list of items, that contains OptionRealTimeQuoteGroup object. Contains actual data

OptionRealTimeQuoteGroup has the following attributes:

NameTypeDescription
putOptionRealTimeQuoteput option contract
callOptionRealTimeQuotecall option contract

OptionRealTimeQuote object has the following attributes:

NameTypeDescription
identifierstringoption identifier, Example:AAPL210115C00095000
strikedoublestrike price
rightstringPUT/CALL
askPricedoubleask price
askSizeintask size
bidPricedoublebid price
bidSizeintbid size
lastTimestamplongTime when last trade is made, such as: 1543343800698
latestPricedoublelast price
multiplierdoublemultiplier, 100 for U.S. options
openInterestintopen interest
preClosedoubleclose price of the last trading day
volumelongvolume
impliedVoldoubleimplied volatility
deltadoubledelta
gammadoublegamma
thetadoubletheta
vegadoublevega
rhodoublerho

Use the properties, such asOptionRealTimeQuote.Identifier to access data,or use JsonConvert.SerializeObject() method to convert data to a string

Example

  static async Task<OptionChainResponse?> GetOptionChainAsync(QuoteClient quoteClient)
  {
    TigerRequest<OptionChainResponse> request = new TigerRequest<OptionChainResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_CHAIN,
      ModelValue = new OptionChainV3Model()
      {
        Market = Market.US,
        OptionBasic = new List<OptionChainModel>()
        {
          new OptionChainModel() {
            Symbol = "AAPL",
            Expiry = DateUtil.ConvertTimestamp("2024-07-26", CustomTimeZone.NY_ZONE)
          }
        },
        OptionFilter = new OptionChainFilterModel()
        {
          InTheMoney = true,
          ImpliedVolatility = new Range<Double>(0.1537, 0.8282),
          OpenInterest = new Range<int>(10, 50000),
          Greeks = new Greeks()
          {
            Delta = new Range<Double>(-0.8, 0.6),
            Gamma = new Range<double>(0.024, 0.3),
            Vega = new Range<double>(0.019, 0.343),
            Theta = new Range<double>(-0.1, 0.1),
            Rho = new Range<double>(-0.096, 0.101)
          }
        }

        //Market = Market.HK,
        //OptionBasic = new List<OptionChainModel>()
        //{
        //  new OptionChainModel() {
        //    Symbol = "PAI.HK",
        //    Expiry = DateUtil.ConvertTimestamp("2024-06-27", CustomTimeZone.NY_ZONE)
        //  }
        //},
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data": [
        {
            "symbol": "AAPL",
            "expiry": 1721966400000,
            "items": [
                {
                    "put": null,
                    "call": {
                        "identifier": "AAPL  240726C00210000",
                        "strike": "210.0",
                        "right": "call",
                        "askPrice": 6.1,
                        "askSize": 93,
                        "bidPrice": 5.8,
                        "bidSize": 502,
                        "latestPrice": 6.32,
                        "preClose": 4.8,
                        "volume": 4,
                        "openInterest": 2766,
                        "multiplier": 100,
                        "lastTimestamp": 1719408640494,
                        "impliedVol": 0.197337,
                        "delta": 0.507864,
                        "gamma": 0.033127,
                        "theta": -0.090114,
                        "vega": 0.242641,
                        "rho": 0.086166
                    }
                },
                {
                    "put": {
                        "identifier": "AAPL  240726P00215000",
                        "strike": "215.0",
                        "right": "put",
                        "askPrice": 6.6,
                        "askSize": 118,
                        "bidPrice": 6.25,
                        "bidSize": 169,
                        "latestPrice": 7.8,
                        "preClose": 7.8,
                        "volume": 0,
                        "openInterest": 1222,
                        "multiplier": 100,
                        "lastTimestamp": 1719345365800,
                        "impliedVol": 0.18012,
                        "delta": -0.686314,
                        "gamma": 0.03523,
                        "theta": -0.048649,
                        "vega": 0.21153,
                        "rho": -0.084955
                    },
                    "call": null
                }
            ]
        }
    ],
    "code": 0,
    "message": "success",
    "timestamp": 1719408676252,
    "sign": "qwhAWEAw/z2TH9kZd/VKIxafBUUdJGY0KWB9KjbybrgsQtMrNN7sWdVOgv5GxcV0kLeMHQYiF6m/lBQ1nb8+yNnHlg9UIaceOz1QmV4IVf5PwHcevIwadiVY7caHW9QLYgR2Jzmseq+pu1OurhRApevJJcNpQW04reauM0dtgOY="
}

Get Option Briefs

Description

Get Option Realtime Quotes.The parameter batch limit is 30

Argument

ArgumentTypeRequiredDescription
marketstringyesUS, HK
option_basicList<OptionCommonModel>yesList of the four elements of options. max size is 30

OptionCommonModel 's structure is as follows:

ArgumentTypeRequiredDescription
symbolstringyesTicker symbol of the underlying assets
rightstringyesCALL/PUT
expirylongyesOption expiration date, millisecond timestamp
strikestringyesstrike price

ResponseTigerOpenAPI.Quote.Response.OptionBriefResponsesourceopen in new window

has the following structure:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionBriefResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionBriefItem> Data { get; set; }
  }
}

Use TigerResponse.Data to access the data returned from the server. This method will return a OptionBriefItem object, where TigerOpenAPI.Quote.Response.OptionBriefItem has the following attributes:

ArgumentTypeDescription
symbolstringticker symbol of the underlying asset
strikestringstrike price
rightstringPUT/CALL
expirylongexpiration time, in millisecond timestamp
bidPricedoublebid price
bidSizeintbid size
askPricedoubleask price
askSizeintask size
latestPricedoublelast price
timestamplongTime when last trade is made
volumelongtrade volume
highdoublehigh price
lowdoublelow price
opendoubleopening price
preClosedoubleclose price of the last trading day
openInterestintopen intrest
changedoubleprice change
multiplierintmultiplier, 100 for U.S. options
ratesBondsdoubleretes bonds
volatilitystringhistorical volatility

To access the data, use properties such as OptionBriefItem.Symbo, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionBriefResponse?> GetOptionBriefV2Async(QuoteClient quoteClient)
  {
    TigerRequest<OptionBriefResponse> request = new TigerRequest<OptionBriefResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_BRIEF,
      ModelValue = new OptionBasicModel()
      {
        Market = Market.US,
        OptionBasic = new List<OptionCommonModel>()
          {
            new OptionCommonModel() {
              Symbol = "AAPL",
              Right = "CALL",
              Strike = "160.0",
              Expiry = DateUtil.ConvertTimestamp("2024-06-28", CustomTimeZone.NY_ZONE)
            }
          }
        //Market = Market.HK,
        //OptionBasic = new List<OptionCommonModel>()
        //{
        //  new OptionCommonModel() {
        //    Symbol = "TCH.HK",
        //    Right = "CALL",
        //    Strike = "370.0",
        //    Expiry = DateUtil.ConvertTimestamp("2024-06-27", CustomTimeZone.HK_ZONE)
        //  }
        //}
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data": [
        {
            "identifier": "AAPL  240628C00160000",
            "symbol": "AAPL",
            "strike": "160.0",
            "right": "call",
            "expiry": 1719547200000,
            "askPrice": 55.2,
            "askSize": 64,
            "bidPrice": 53.55,
            "bidSize": 68,
            "latestPrice": 51.9,
            "preClose": 51.15,
            "volume": 10,
            "high": 51.93,
            "low": 51.88,
            "open": 51.88,
            "openInterest": 20,
            "change": 0.75,
            "multiplier": 100,
            "volatility": "30.95%",
            "ratesBonds": 0.051339,
            "timestamp": 1719409873221
        }
    ],
    "code": 0,
    "message": "success",
    "timestamp": 1719417365466,
    "sign": "TAjVoq4HRzmvX8wx4GLcecd3y4qTQyEqO/QyrbZPnIsKI5fLEIbxXZHcSE+0F1u27ijC4Ct0txcupN7/6gHwQYw8Ca+SK1PrRJmLtzsbQyBaY1kbxQiWNHhvkmL6F/1shK2Gp3/WUcwPz7ZfqbAdmRlacuj7A+cWuRL9EO+lBYI="
}

Get option bars

Description

Get option bars.The parameter batch limit is 30

Argument

ArgumentTypeRequiredDescription
marketstringyesUS, HK only
option_queryList<OptionKlineModel>yesthe list of the Option K-line query condition. max size is 30

OptionKlineModel 's structure is as follows:

ArgumentTypeRequiredDescription
symbolstringyesTicker symbol of the underlying assets
rightstringyesCALL/PUT
expirylongyesOption expiration date, millisecond timestamp
strikestringyesstrike price
begin_timelongyesBegin time, millisecond timestamp
end_timelongyesEnd time, millisecond timestamp
periodstringnoK line period, possible values are: day, 1min, 5min, 30min, 60min
limitintnoThe maximum number of bars returned. Default value is 300. Maximum is 1200
sort_dirstringnoSort Direction, include SortDir_Ascend and SortDir_Descend, enum:sort direction

ResponseTigerOpenAPI.Quote.Response.OptionKlineResponsesourceopen in new window

Structured as below:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionKlineResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionKlineItem> Data { get; set; }
  }
}

Use OptionKlineResponse.Data property to access the returned data. This method will return OptionKlineItem object, whereTigerOpenAPI.Quote.Response.OptionKlineItem has the following attributes:

NameTypeDescription
symbolstringticker symbol of the underlying asse
periodstringperiod
rightstringCALL/PUT
strikestringstrike price
expirylongOption expiration date, millisecond timestamp
itemsList<OptionKlinePoint>a list that contains OptionKlinePoint. OptionKlinePoint is an array that contains bar data. Data included are listed as below

OptionKlinePoint object has the following attributes:

NameTypeDescription
highdoublehigh price
lowdoublelow price
opendoubleopen price
closedoubleclose price
timelongstart time of a bar, in millisecond timestamp
volumeinttrading volume within a bar
openInterestintopen interest

To access the data, use the properties such as OptionKlinePoint.Volume, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionKlineResponse?> GetOptionKLineV2Async(QuoteClient quoteClient)
  {
    TigerRequest<OptionKlineResponse> request = new TigerRequest<OptionKlineResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_KLINE,
      ModelValue = new OptionKlineV2Model()
      {
        Market = Market.US,
        OptionQuery = new List<OptionKlineModel>()
        {
          new OptionKlineModel() {
            Symbol = "AAPL", Right = "CALL", Strike = "170.0",
            Expiry = DateUtil.ConvertTimestamp("2024-06-28", CustomTimeZone.NY_ZONE),
            BeginTime = DateUtil.ConvertTimestamp("2024-06-24", CustomTimeZone.NY_ZONE),
            EndTime = DateUtil.ConvertTimestamp("2024-06-26", CustomTimeZone.NY_ZONE),
            Period = OptionKType.min60.Value,
            SortDir = SortDir.SortDir_Descend,
            Limit = 10
          }
        }
        //Market = Market.HK,
        //OptionQuery = new List<OptionKlineModel>()
        //{
        //  new OptionKlineModel() {
        //    Symbol = "TCH.HK", Right = "CALL", Strike = "370.0",
        //    Expiry = DateUtil.ConvertTimestamp("2024-06-27", CustomTimeZone.HK_ZONE),
        //    BeginTime = DateUtil.ConvertTimestamp("2024-05-22", CustomTimeZone.HK_ZONE),
        //    EndTime = DateUtil.ConvertTimestamp("2024-05-24", CustomTimeZone.HK_ZONE),
        //    Period = OptionKType.min60.Value,
        //    Limit = 300
        //  }
        //}
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data": [
        {
            "symbol": "AAPL",
            "strike": "170.0",
            "right": "CALL",
            "expiry": 1719547200000,
            "period": "60min",
            "items": [
                {
                    "openInterest": 0,
                    "open": 40.29,
                    "high": 40.29,
                    "low": 40.29,
                    "close": 40.29,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719343800000
                },
                {
                    "openInterest": 0,
                    "open": 40.29,
                    "high": 40.29,
                    "low": 40.29,
                    "close": 40.29,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719340200000
                },
                {
                    "openInterest": 0,
                    "open": 40.29,
                    "high": 40.29,
                    "low": 40.29,
                    "close": 40.29,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719336600000
                },
                {
                    "openInterest": 0,
                    "open": 40.29,
                    "high": 40.29,
                    "low": 40.29,
                    "close": 40.29,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719333000000
                },
                {
                    "openInterest": 0,
                    "open": 39.68,
                    "high": 40.29,
                    "low": 39.68,
                    "close": 40.29,
                    "volume": 26,
                    "amount": "NaN",
                    "time": 1719329400000
                },
                {
                    "openInterest": 0,
                    "open": 39.68,
                    "high": 39.68,
                    "low": 39.68,
                    "close": 39.68,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719325800000
                },
                {
                    "openInterest": 0,
                    "open": 39.01,
                    "high": 39.97,
                    "low": 39.01,
                    "close": 39.68,
                    "volume": 4,
                    "amount": "NaN",
                    "time": 1719322200000
                },
                {
                    "openInterest": 0,
                    "open": 39.01,
                    "high": 39.01,
                    "low": 39.01,
                    "close": 39.01,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719257400000
                },
                {
                    "openInterest": 0,
                    "open": 38.02,
                    "high": 39.68,
                    "low": 38.02,
                    "close": 39.01,
                    "volume": 4,
                    "amount": "NaN",
                    "time": 1719253800000
                },
                {
                    "openInterest": 0,
                    "open": 38.02,
                    "high": 38.02,
                    "low": 38.02,
                    "close": 38.02,
                    "volume": 0,
                    "amount": "NaN",
                    "time": 1719250200000
                }
            ]
        }
    ],
    "code": 0,
    "message": "success",
    "timestamp": 1719420174285,
    "sign": "Of/xzjYFjp/2BGyWf/kNEWV2GKSTie+OFBEoDjKxbSQH8bld9ffgi4Tg4UpDAVn/XDKm2LeiHLjolp7GGJKfVE0pHoy32zlxuw4qlLyv5FIUoZvKmikLDufOrmLvCKtQhymyp186ZZrDAaFWTMXTzG8cfClsKKUnuJybO/0+SaU="
}

Get Option Trade Ticks

Description

Get trade tick data for options.The parameter batch limit is 30

Argument

ArgumentTypeRequiredDescription
symbolstringyesTicker symbol of the underlying assets
rightstringyescall/put
expirylongyesExpiration date in millisecond timestamp
strikestringyesstrike price

ResponseTigerOpenAPI.Quote.Response.OptionTradeTickResponsesourceopen in new window

has the following structure:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionTradeTickResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionTradeTickItem> Data { get; set; }
  }
}

Half an hour before the opening of the market, you can get all the data of the previous trading day, and after the opening of the market, you can get the data of the current day.

Use OptionTradeTickResponse.Data property to access the returned data. This method will return a list of OptionTradeTickItem object, where TigerOpenAPI.Quote.Response.OptionTradeTickItem has the following attributes:

NameTypeDescription
symbolstringTicker symbol of underlying asset
expirylongExpiration date in millisecond timestamp. maximum number of symbol-expiry combination being quoted is 30
strikestringstrike price
rightstringPUT/CALL
itemsList<TradeTickPoint>List of TradeTickPoint object. Each TradeTickPoint corresponds to a trade tick

TradeTickPoint has the following attributes:

NameTypeArgument
pricedoubletransaction price
timelongtransaction time
volumelongtrade volume

To access the data, use the properties such as TradeTickPoint.Price, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionTradeTickResponse?> GetOptionTradeTickAsync(QuoteClient quoteClient)
  {
    TigerRequest<OptionTradeTickResponse> request = new TigerRequest<OptionTradeTickResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_TRADE_TICK,
      ModelValue = new BatchApiModel<OptionCommonModel>()
      {
        Items = new List<OptionCommonModel>()
        {
          new OptionCommonModel() { Symbol = "AAPL", Right = "PUT", Strike = "100.0",
            Expiry = DateUtil.ConvertTimestamp("2023-03-17", CustomTimeZone.NY_ZONE)}
        }
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "expiry":1679025600000,
            "strike":"100.0",
            "right":"put",
            "items":[
                {
                    "price":0.01,
                    "time":1677853806520,
                    "volume":5
                },
                {
                    "price":0.01,
                    "time":1677853807374,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677853820498,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677853865354,
                    "volume":2
                },
                {
                    "price":0.01,
                    "time":1677854154278,
                    "volume":100
                },
                {
                    "price":0.02,
                    "time":1677854599439,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677857196976,
                    "volume":3
                },
                {
                    "price":0.01,
                    "time":1677857351667,
                    "volume":5
                },
                {
                    "price":0.01,
                    "time":1677857720152,
                    "volume":5
                },
                {
                    "price":0.01,
                    "time":1677859305126,
                    "volume":4
                },
                {
                    "price":0.01,
                    "time":1677861301232,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677861593507,
                    "volume":3
                },
                {
                    "price":0.01,
                    "time":1677862023653,
                    "volume":5
                },
                {
                    "price":0.01,
                    "time":1677867442539,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677868578216,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677868660689,
                    "volume":1
                },
                {
                    "price":0.01,
                    "time":1677877019442,
                    "volume":10
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678107119497,
    "sign":"e3MV4FY+ddej+PZjeVSsxEzWJaIOg9jDQF7Zf38XTsAxrmpkDB7vGtTSHeM68klYZcqjTddn+fe4RWnf3ilQE5XEquiNlyBR5BaOPnmBJ2cP0PTy+4KS7oo9KxFeNjkOxnj1MoVq03+F0ex52vJDxBUxIcMA6TxxN2PMaJ33YFQ="
}

Get Option Depth Quote

Description

Get depth data of options.The parameter batch limit is 30

Argument

ArgumentTypeRequiredDescription
marketstringyesUS only
option_basicList<OptionCommonModel>yesList of the four elements of options. max size is 30

OptionCommonModel 's structure is as follows:

Argumenttyperequireddescription
symbolstringyesstock code
rightstringyesLook long or short (CALL/PUT)
expirylongyesexpiry time (the value in milliseconds corresponding to 0:00 of New York time in the United States)
strikestringyesstrike price

ResponseTigerOpenAPI.Quote.Response.OptionDepthResponsesourceopen in new window

has the following structure:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionDepthResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionDepthItem> Data { get; set; }
  }
}

The returned data is the real-time quotes of 17 options exchanges during the trading session.

Use OptionDepthResponse.Data property to access the returned data. This method will return a list of OptionDepthItem object, where TigerOpenAPI.Quote.Response.OptionDepthItem has the following attributes:

NameTypeDescription
symbolstringunderlying stock code
expirylongexpiry time
strikestringstrike price
rightstringPUT or CALL
timestamplongdata timestamp
askList<OptionDepthOrderBook>OptionDepthOrderBook object list, each OptionDepthOrderBook object corresponds to a ask order data from options exchange
bidList<OptionDepthOrderBook>OptionDepthOrderBook object list, each OptionDepthOrderBook object corresponds to a bid order data from options exchange

The OptionDepthOrderBook has the following attributes:

nametypedescription
pricedoubleorder price
codestringOptions Exchange Code
timestamplongexchange timestamp
volumeintorder volume

To access the data, use the properties such as OptionDepthOrderBook.Price, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionDepthResponse?> GetOptionDepthAsync(QuoteClient quoteClient)
  {
    TigerRequest<OptionDepthResponse> request = new TigerRequest<OptionDepthResponse>()
    {
      ApiMethodName = QuoteApiService.OPTION_DEPTH,
      ModelValue = new OptionBasicModel()
      {
        Market = Market.US,
        OptionBasic = new List<OptionCommonModel>()
        {
          new OptionCommonModel() {
            Symbol = "AAPL",
            Right = "PUT",
            Strike = "210.0",
            Expiry = DateUtil.ConvertTimestamp("2024-06-28", CustomTimeZone.NY_ZONE)
          }
        }
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
	"data": [{
		"symbol": null,
		"expiry": 1719547200000,
		"strike": "210.0",
		"right": "PUT",
		"timestamp": 1719345602509,
		"ask": [{
			"price": 2.15,
			"code": "BX",
			"timestamp": 1719345599997,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.16,
			"code": "EDGX",
			"timestamp": 1719345599683,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.2,
			"code": "MPRL",
			"timestamp": 1719345599915,
			"volume": 4,
			"count": 0
		},
		{
			"price": 2.23,
			"code": "BOX",
			"timestamp": 1719345599997,
			"volume": 19,
			"count": 0
		},
		{
			"price": 2.23,
			"code": "ARCA",
			"timestamp": 1719345600003,
			"volume": 5,
			"count": 0
		},
		{
			"price": 2.23,
			"code": "AMEX",
			"timestamp": 1719345600003,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.34,
			"code": "BZX",
			"timestamp": 1719345599973,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.34,
			"code": "CBOE",
			"timestamp": 1719345599915,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.35,
			"code": "NSDQ",
			"timestamp": 1719345599943,
			"volume": 13,
			"count": 0
		},
		{
			"price": 2.35,
			"code": "GEM",
			"timestamp": 1719345599973,
			"volume": 5,
			"count": 0
		},
		{
			"price": 2.39,
			"code": "MIAX",
			"timestamp": 1719345599991,
			"volume": 6,
			"count": 0
		},
		{
			"price": 2.39,
			"code": "EMLD",
			"timestamp": 1719345600003,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.95,
			"code": "ISE",
			"timestamp": 1719345599997,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.95,
			"code": "PHLX",
			"timestamp": 1719345599985,
			"volume": 1,
			"count": 0
		},
		{
			"price": 4.2,
			"code": "C2",
			"timestamp": 1719345599997,
			"volume": 1,
			"count": 0
		},
		{
			"price": 5.0,
			"code": "MCRY",
			"timestamp": 1719345599883,
			"volume": 2,
			"count": 0
		},
		{
			"price": 0.0,
			"code": "MEMX",
			"timestamp": 1719345602509,
			"volume": 0,
			"count": 0
		}],
		"bid": [{
			"price": 2.14,
			"code": "MPRL",
			"timestamp": 1719345599915,
			"volume": 216,
			"count": 0
		},
		{
			"price": 2.14,
			"code": "NSDQ",
			"timestamp": 1719345599943,
			"volume": 26,
			"count": 0
		},
		{
			"price": 2.14,
			"code": "BOX",
			"timestamp": 1719345599997,
			"volume": 21,
			"count": 0
		},
		{
			"price": 2.14,
			"code": "MIAX",
			"timestamp": 1719345599991,
			"volume": 6,
			"count": 0
		},
		{
			"price": 2.14,
			"code": "ISE",
			"timestamp": 1719345599997,
			"volume": 2,
			"count": 0
		},
		{
			"price": 2.13,
			"code": "BZX",
			"timestamp": 1719345599973,
			"volume": 51,
			"count": 0
		},
		{
			"price": 2.13,
			"code": "AMEX",
			"timestamp": 1719345600003,
			"volume": 1,
			"count": 0
		},
		{
			"price": 2.11,
			"code": "BX",
			"timestamp": 1719345599997,
			"volume": 30,
			"count": 0
		},
		{
			"price": 2.04,
			"code": "CBOE",
			"timestamp": 1719345599915,
			"volume": 9,
			"count": 0
		},
		{
			"price": 2.04,
			"code": "ARCA",
			"timestamp": 1719345600003,
			"volume": 4,
			"count": 0
		},
		{
			"price": 2.03,
			"code": "PHLX",
			"timestamp": 1719345599985,
			"volume": 3,
			"count": 0
		},
		{
			"price": 2.03,
			"code": "EMLD",
			"timestamp": 1719345600003,
			"volume": 2,
			"count": 0
		},
		{
			"price": 1.8,
			"code": "EDGX",
			"timestamp": 1719345599683,
			"volume": 14,
			"count": 0
		},
		{
			"price": 1.04,
			"code": "C2",
			"timestamp": 1719345599997,
			"volume": 18,
			"count": 0
		},
		{
			"price": 1.04,
			"code": "GEM",
			"timestamp": 1719345599973,
			"volume": 1,
			"count": 0
		},
		{
			"price": 0.1,
			"code": "MCRY",
			"timestamp": 1719345599883,
			"volume": 1,
			"count": 0
		},
		{
			"price": 0.0,
			"code": "MEMX",
			"timestamp": 1719345602509,
			"volume": 0,
			"count": 0
		}]
	}],
	"code": 0,
	"message": "success",
	"timestamp": 1719394567997,
	"sign": "piYFgsldPci3TUrKUMHojkLr3PC3Ehx5lq89L6fR2MtIe+7ed+ZCiFEuO6rAvb4UKdIKRt51ZQDqTUayqmFPO0kbjwn+fK0/XcgZ9a2U939gezkkzhzZ/1xfxx55uvsyehP5TYxt541IX3nZYHmKTbrviy7mI5KJPURDBqlx6yk="
}

Get HK Option Symbol

Description

Get the symbol list of Hong Kong stock options. Only supports Hong Kong market

Argument

ArgumentTypeRequiredDescription
marketstringyesHK only
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

ResponseTigerOpenAPI.Quote.Response.OptionSymbolResponsesourceopen in new window

has the following structure:

namespace TigerOpenAPI.Quote.Response
{
  public class OptionSymbolResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<OptionSymbolItem> Data { get; set; }
  }
}

Returns the symbol codes and underlying symbol codes of all options in the Hong Kong market

Use OptionSymbolResponse.Data property to access the returned data. This method will return a list of OptionSymbolItem object, where TigerOpenAPI.Quote.Response.OptionSymbolItem has the following attributes:

NameTypeDescription
symbolstringoption symbol
namestringname
underlyingSymbolstringunderlying stock code

To access the data, use the properties such as OptionSymbolItem.Symbol, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<OptionSymbolResponse?> GetHKOptionSymbolsAsync(QuoteClient quoteClient)
  {
    TigerRequest<OptionSymbolResponse> request = new TigerRequest<OptionSymbolResponse>()
    {
      ApiMethodName = QuoteApiService.ALL_HK_OPTION_SYMBOLS,
      ModelValue = new OptionModel()
      {
        Market = Market.HK,
        Lang = Language.en_US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{"data":[{"symbol":"ALC.HK","name":"ALC","underlyingSymbol":"02600"},{"symbol":"CRG.HK","name":"CRG","underlyingSymbol":"00390"},{"symbol":"PAI.HK","name":"PAI","underlyingSymbol":"02318"},{"symbol":"XCC.HK","name":"XCC","underlyingSymbol":"00939"},{"symbol":"XTW.HK","name":"XTW","underlyingSymbol":"00788"},{"symbol":"SHL.HK","name":"SHL","underlyingSymbol":"00968"},{"symbol":"GHL.HK","name":"GHL","underlyingSymbol":"00868"},{"symbol":"HEX.HK","name":"HEX","underlyingSymbol":"00388"},{"symbol":"ACC.HK","name":"ACC","underlyingSymbol":"00914"},{"symbol":"STC.HK","name":"STC","underlyingSymbol":"02888"},{"symbol":"VNK.HK","name":"VNK","underlyingSymbol":"02202"},{"symbol":"CLI.HK","name":"CLI","underlyingSymbol":"02628"},{"symbol":"LNK.HK","name":"LNK","underlyingSymbol":"00823"},{"symbol":"SMC.HK","name":"SMC","underlyingSymbol":"00981"},{"symbol":"BEA.HK","name":"BEA","underlyingSymbol":"00023"},{"symbol":"TRP.HK","name":"TRP","underlyingSymbol":"09961"},{"symbol":"GWM.HK","name":"GWM","underlyingSymbol":"02333"},{"symbol":"NBM.HK","name":"NBM","underlyingSymbol":"03323"},{"symbol":"ANA.HK","name":"ANA","underlyingSymbol":"02020"},{"symbol":"CMB.HK","name":"CMB","underlyingSymbol":"03968"},{"symbol":"HNP.HK","name":"HNP","underlyingSymbol":"00902"},{"symbol":"HEH.HK","name":"HEH","underlyingSymbol":"00006"},{"symbol":"MET.HK","name":"MET","underlyingSymbol":"03690"},{"symbol":"SHZ.HK","name":"SHZ","underlyingSymbol":"02313"},{"symbol":"SNP.HK","name":"SNP","underlyingSymbol":"01099"},{"symbol":"INB.HK","name":"INB","underlyingSymbol":"01801"},{"symbol":"CRL.HK","name":"CRL","underlyingSymbol":"01109"},{"symbol":"ALH.HK","name":"ALH","underlyingSymbol":"00241"},{"symbol":"AAC.HK","name":"AAC","underlyingSymbol":"02018"},{"symbol":"WWC.HK","name":"WWC","underlyingSymbol":"00151"},{"symbol":"CTB.HK","name":"CTB","underlyingSymbol":"00998"},{"symbol":"NWD.HK","name":"NWD","underlyingSymbol":"00017"},{"symbol":"HSB.HK","name":"HSB","underlyingSymbol":"00011"},{"symbol":"LEN.HK","name":"LEN","underlyingSymbol":"00992"},{"symbol":"COS.HK","name":"COS","underlyingSymbol":"01919"},{"symbol":"HDO.HK","name":"HDO","underlyingSymbol":"06862"},{"symbol":"BOC.HK","name":"BOC","underlyingSymbol":"02388"},{"symbol":"CSA.HK","name":"CSA","underlyingSymbol":"02822"},{"symbol":"XAB.HK","name":"XAB","underlyingSymbol":"01288"},{"symbol":"CKH.HK","name":"CKH","underlyingSymbol":"00001"},{"symbol":"MIU.HK","name":"MIU","underlyingSymbol":"01810"},{"symbol":"AIR.HK","name":"AIR","underlyingSymbol":"00753"},{"symbol":"CKP.HK","name":"CKP","underlyingSymbol":"01113"},{"symbol":"CHU.HK","name":"CHU","underlyingSymbol":"00762"},{"symbol":"GLI.HK","name":"GLI","underlyingSymbol":"01772"},{"symbol":"LNI.HK","name":"LNI","underlyingSymbol":"02331"},{"symbol":"LAU.HK","name":"LAU","underlyingSymbol":"02015"},{"symbol":"BYD.HK","name":"BYD","underlyingSymbol":"01211"},{"symbol":"ZSH.HK","name":"ZSH","underlyingSymbol":"00881"},{"symbol":"CGN.HK","name":"CGN","underlyingSymbol":"01816"},{"symbol":"MOL.HK","name":"MOL","underlyingSymbol":"03993"},{"symbol":"CPA.HK","name":"CPA","underlyingSymbol":"00293"},{"symbol":"KLE.HK","name":"KLE","underlyingSymbol":"00135"},{"symbol":"CPI.HK","name":"CPI","underlyingSymbol":"02601"},{"symbol":"CTC.HK","name":"CTC","underlyingSymbol":"00728"},{"symbol":"MTR.HK","name":"MTR","underlyingSymbol":"00066"},{"symbol":"PEC.HK","name":"PEC","underlyingSymbol":"00857"},{"symbol":"PEN.HK","name":"PEN","underlyingSymbol":"09868"},{"symbol":"MEN.HK","name":"MEN","underlyingSymbol":"02319"},{"symbol":"TCH.HK","name":"TCH","underlyingSymbol":"00700"},{"symbol":"SUN.HK","name":"SUN","underlyingSymbol":"01918"},{"symbol":"PHT.HK","name":"PHT","underlyingSymbol":"01833"},{"symbol":"CTS.HK","name":"CTS","underlyingSymbol":"06030"},{"symbol":"BCM.HK","name":"BCM","underlyingSymbol":"03328"},{"symbol":"A50.HK","name":"A50","underlyingSymbol":"02823"},{"symbol":"RFP.HK","name":"RFP","underlyingSymbol":"02777"},{"symbol":"COL.HK","name":"COL","underlyingSymbol":"00688"},{"symbol":"CDA.HK","name":"CDA","underlyingSymbol":"01359"},{"symbol":"BYE.HK","name":"BYE","underlyingSymbol":"00285"},{"symbol":"JDH.HK","name":"JDH","underlyingSymbol":"06618"},{"symbol":"CCE.HK","name":"CCE","underlyingSymbol":"01898"},{"symbol":"CRC.HK","name":"CRC","underlyingSymbol":"01186"},{"symbol":"HCF.HK","name":"HCF","underlyingSymbol":"02828"},{"symbol":"HKG.HK","name":"HKG","underlyingSymbol":"00003"},{"symbol":"XBC.HK","name":"XBC","underlyingSymbol":"03988"},{"symbol":"XPB.HK","name":"XPB","underlyingSymbol":"01658"},{"symbol":"WEB.HK","name":"WEB","underlyingSymbol":"09898"},{"symbol":"GAH.HK","name":"GAH","underlyingSymbol":"00175"},{"symbol":"CPC.HK","name":"CPC","underlyingSymbol":"00386"},{"symbol":"EVG.HK","name":"EVG","underlyingSymbol":"03333"},{"symbol":"PIC.HK","name":"PIC","underlyingSymbol":"02328"},{"symbol":"SAN.HK","name":"SAN","underlyingSymbol":"01928"},{"symbol":"BUD.HK","name":"BUD","underlyingSymbol":"01876"},{"symbol":"HKB.HK","name":"HKB","underlyingSymbol":"00005"},{"symbol":"MGM.HK","name":"MGM","underlyingSymbol":"02282"},{"symbol":"CHT.HK","name":"CHT","underlyingSymbol":"00941"},{"symbol":"PIN.HK","name":"PIN","underlyingSymbol":"01339"},{"symbol":"XIC.HK","name":"XIC","underlyingSymbol":"01398"},{"symbol":"GAC.HK","name":"GAC","underlyingSymbol":"02238"},{"symbol":"KDS.HK","name":"KDS","underlyingSymbol":"00268"},{"symbol":"COG.HK","name":"COG","underlyingSymbol":"02007"},{"symbol":"SBO.HK","name":"SBO","underlyingSymbol":"01177"},{"symbol":"WHL.HK","name":"WHL","underlyingSymbol":"00004"},{"symbol":"CSE.HK","name":"CSE","underlyingSymbol":"01088"},{"symbol":"SET.HK","name":"SET","underlyingSymbol":"00020"},{"symbol":"SWA.HK","name":"SWA","underlyingSymbol":"00019"},{"symbol":"ZJM.HK","name":"ZJM","underlyingSymbol":"02899"},{"symbol":"MSB.HK","name":"MSB","underlyingSymbol":"01988"},{"symbol":"GLX.HK","name":"GLX","underlyingSymbol":"00027"},{"symbol":"DFM.HK","name":"DFM","underlyingSymbol":"00489"},{"symbol":"CIT.HK","name":"CIT","underlyingSymbol":"00267"},{"symbol":"CNC.HK","name":"CNC","underlyingSymbol":"00883"},{"symbol":"BIU.HK","name":"BIU","underlyingSymbol":"09888"},{"symbol":"CCC.HK","name":"CCC","underlyingSymbol":"01800"},{"symbol":"HGN.HK","name":"HGN","underlyingSymbol":"01044"},{"symbol":"NTE.HK","name":"NTE","underlyingSymbol":"09999"},{"symbol":"SNO.HK","name":"SNO","underlyingSymbol":"02382"},{"symbol":"TRF.HK","name":"TRF","underlyingSymbol":"02800"},{"symbol":"HAI.HK","name":"HAI","underlyingSymbol":"06837"},{"symbol":"WHG.HK","name":"WHG","underlyingSymbol":"00288"},{"symbol":"HLD.HK","name":"HLD","underlyingSymbol":"00012"},{"symbol":"CSP.HK","name":"CSP","underlyingSymbol":"01093"},{"symbol":"KSO.HK","name":"KSO","underlyingSymbol":"03888"},{"symbol":"YZC.HK","name":"YZC","underlyingSymbol":"01171"},{"symbol":"SHK.HK","name":"SHK","underlyingSymbol":"00016"},{"symbol":"JXC.HK","name":"JXC","underlyingSymbol":"00358"},{"symbol":"ALB.HK","name":"ALB","underlyingSymbol":"09988"},{"symbol":"BLI.HK","name":"BLI","underlyingSymbol":"09626"},{"symbol":"CLP.HK","name":"CLP","underlyingSymbol":"00002"},{"symbol":"ZAO.HK","name":"ZAO","underlyingSymbol":"06060"},{"symbol":"JDC.HK","name":"JDC","underlyingSymbol":"09618"},{"symbol":"NFU.HK","name":"NFU","underlyingSymbol":"09633"},{"symbol":"AIA.HK","name":"AIA","underlyingSymbol":"01299"},{"symbol":"KST.HK","name":"KST","underlyingSymbol":"01024"},{"symbol":"NCL.HK","name":"NCL","underlyingSymbol":"01336"},{"symbol":"TIC.HK","name":"TIC","underlyingSymbol":"00669"},{"symbol":"WXB.HK","name":"WXB","underlyingSymbol":"02269"},{"symbol":"AMC.HK","name":"AMC","underlyingSymbol":"03188"}],"code":0,"message":"success","timestamp":1719403742527,"sign":"E7n8MHnVK6rY6N4kPqI7VaErBLIvqVSjukki00zabPmq1o42/pvv2k6IQXOWX8PomddpOhneeHY4J9INaiGIPG9nRHP1pYwFPUxdjd4mvLGk9Ynyf8lBNO+7ZL+dT7kd0YXgzk8dq5xfNIU4TbmelIAA6oK9YTNZs9zQpsmLjv0="}

Option indicator calculation

description

Calculation of various indicators for selected options

parameter

ParameterTypeRequiredDescription
clientobjectyesSDK QuoteClient
symbolstringyesstock code
rightstringyesLong or short (CALL/PUT)
strikestringyesstrike price
expirylongyesexpiry time (the value in milliseconds corresponding to 0:00 of New York time in the United States)
underlyingSymbolstringnounderlying symbol(if null or empty, defaults to the same value as 'symbol')

return

nametypedescription
deltadoubleGreek letter delta
gammadoubleGreek letter gamma
thetadoubleGreek letter theta
vegadoubleGreek letter vega
insideValuedoubleIntrinsic value
timeValuedoubletime value
leveragedoubleleverage
openInterestintopen interest
historyVolatilitydoublehistorical volatility, a percentage value
premiumRatedoublepremium rate, percentage value
profitRatedoubleBuy profit rate, percentage value
volatilitydoubleimplied volatility, a percentage value

example

OptionFundamentals? optionFundamentals = OptionCalcUtil.GetOptionFundamentals(
          quoteClient, "TSLA", "CALL", "255.0", "2023-08-11");
ApiLogger.Info("response:" + JsonConvert.SerializeObject(optionFundamentals));

response

{
    "delta":0.5035072708197293,
    "gamma":0.02147811316468654,
    "theta":-0.3935812692492685,
    "vega":0.16664060027998048,
    "rho":3.263976913948943,
    "predictedValue":0,
    "timeValue":6.975,
    "premiumRate":3.09511628822164, //percentage format, expressed as 3.095%
    "profitRate":34.57023177182204, //percentage format, expressed as 34.57%
    "volatility":44.464111328125,  //percentage format, expressed as 44.46%
    "leverage":18.343545890752896,
    "insideValue":0,
    "historyVolatility":48.78, //percentage format, expressed as 48.78%
    "openInterest":614
}
Last update: