Futures

About 16 min

Get Futrue Exchange

Description

Get a List of Supported Future Exchanges

Argument

ArgumentTypeRequiredDescription
sec_typestringyessecurity type, Current support: "FUT": futures, "FOP": futures options; Futures options are not available
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureExchangeResponsesourceopen in new window

Structured as follows:

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

Use FutureExchangeResponse.Data to access the data. This property will return a FutureExchangeItemobject, where TigerOpenAPI.Quote.Response.FutureExchangeItem has the following attributes:

NameTypeDescription
codestringExchange code
namestringExchange name
zoneIdstringTime zone

use the corresponding properties, such as FutureExchangeItem.Code to access relevant data fields, or use the JsonConvert.SerializeObject() method to convert the data into a string

Example

  static async Task<FutureExchangeResponse?> GetFutureExchangeAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureExchangeResponse> request = new TigerRequest<FutureExchangeResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_EXCHANGE,
      ModelValue = new FutureExchangeModel()
      {
        SecType = SecType.FUT.ToString()
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "code":"CME",
            "name":"CME",
            "zoneId":"America/Chicago"
        },
        {
            "code":"NYMEX",
            "name":"NYMEX",
            "zoneId":"America/New_York"
        },
        {
            "code":"COMEX",
            "name":"COMEX",
            "zoneId":"America/New_York"
        },
        {
            "code":"SGX",
            "name":"SGX",
            "zoneId":"Singapore"
        },
        {
            "code":"HKEX",
            "name":"HKEX",
            "zoneId":"Asia/Hong_Kong"
        },
        {
            "code":"CBOT",
            "name":"CBOT",
            "zoneId":"America/Chicago"
        },
        {
            "code":"OSE",
            "name":"OSE",
            "zoneId":"Asia/Tokyo"
        },
        {
            "code":"CBOE",
            "name":"CBOE",
            "zoneId":"America/Chicago"
        },
        {
            "code":"EUREX",
            "name":"EUREX",
            "zoneId":"Europe/Berlin"
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678156845303,
    "sign":"NiuhaSKScUMdI92rpblUtp0c2KdHRID/7iG47J5YVxG2TLXcJFc36xbDNZAhhrTKAa701KJwMuFHXT04oIGz+KS8fBPoYf8R1oj9wfxoPkJo5RqjbYSZwspSlRyx+QrDo303AxruoEBr23kpKMVxIulXDdD22wd2zIBlJMctXJ8="
}

Get Futrue Contract By Code

Description

Get future contract by contract code.

Argument

ArgumentTypeRequiredDescription
contractCodestringyesfutrure contract code, e.g. ES2306
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureContractResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class FutureContractResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public FutureContractItem Data { get; set; }
  }
}

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

NameTypeDescription
typestringfuture contract type, e.g. CL
namestringfuture contract name
tradeboolis tradable
continuousboolis continuous
contractCodestringcontract code, e.g. CL2112
contractMonthstringcontract month, e.g. 202112, indicates delivery in December 2021
currencystringtrading currency
exchangestringexchange
multiplierdecimalcontract multiplier, The real value of a contract is determined by multiplying the futures price by the contract multiplier. The reasonable price of futures can be estimated by dividing the contract multiplier by the physical price.
minTickdecimalThe minimum quote unit for futures price movement, for example, if the current futures price is 2000 and minTick is 100, then the correct quote includes 2100, 2200, and 2005 does not satisfy the requirement
firstNoticeDatestringThe first notice day is the date on which physical delivery of the contract can take place, and the contract cannot be opened for long positions after the first notice day. Existing long positions will be forced to close before the first notification date (usually the first three trading days). Non-physical delivery contracts (e.g. index contracts) this field is empty
lastBiddingCloseTimelonglast bidding close time
lastTradingDatestringRefers to the last trading date of the contract expiration month. Futures contracts that have not been cleared after the last trading day must be closed through the relevant spot commodity or cash settlement, and currently the last trading day for most futures commodities is usually the settlement day. Some commodities have the same day as the first notice day and the last trading day, such as the euro For cash delivery futures, as long as the last trading time has not passed, you can open positions normally, Non-cash delivery futures are restricted from opening positions in the first three trading days according to the smaller of the last trading time and the first notice day

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

Example

  static async Task<FutureContractResponse?> GetFutureContractByContractCodeAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureContractResponse> request = new TigerRequest<FutureContractResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_CONTRACT_BY_CONTRACT_CODE,
      ModelValue = new FutureContractByConCodeModel() { ContractCode = "ES2306" }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "type":"ES",
        "name":"E-mini S&P 500 - Jun 2023",
        "ibCode":"ES",
        "contractCode":"ES2306",
        "contractMonth":"202306",
        "exchangeCode":"GLOBEX",
        "exchange":"CME",
        "multiplier":50,
        "minTick":0.25,
        "lastTradingDate":"20230616",
        "firstNoticeDate":"",
        "lastBiddingCloseTime":0,
        "currency":"USD",
        "continuous":false,
        "trade":true
    },
    "code":0,
    "message":"success",
    "timestamp":1678159174420,
    "sign":"o8+JTngP120oV1XxeLxs3/KdE5/DD9rL6Yv3wOfqXspCWBijQZvQe/ZVlKnSN3w/e5MvtckyrqJ3vY/HSWdEndfEqMOoUvRRW8pFeAts6h3nFTyq53zwNi170hdlJqwGvYs5C94I0T2KHZ+bcBMpgWfRfQiJs8kCXuInRfkjOEo="
}

Get Futrue Contract By Exchange

Description

Get future contract by Exchange.

Argument

ArgumentTypeRequiredDescription
exchangeCodestringyesexchange code, e.g. 'CME'
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureContractsResponsesourceopen in new window

Structured as follows:

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

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

NameTypeDescription
typestringfuture contract type, e.g. CL
namestringfuture contract name
tradeboolis tradable
continuousboolis continuous
contractCodestringcontract code, e.g. CL2112
contractMonthstringcontract month, e.g. 202112, indicates delivery in December 2021
currencystringtrading currency
exchangestringexchange
multiplierdecimalcontract multiplier, The real value of a contract is determined by multiplying the futures price by the contract multiplier. The reasonable price of futures can be estimated by dividing the contract multiplier by the physical price.
minTickdecimalThe minimum quote unit for futures price movement, for example, if the current futures price is 2000 and minTick is 100, then the correct quote includes 2100, 2200, and 2005 does not satisfy the requirement
firstNoticeDatestringThe first notice day is the date on which physical delivery of the contract can take place, and the contract cannot be opened for long positions after the first notice day. Existing long positions will be forced to close before the first notification date (usually the first three trading days). Non-physical delivery contracts (e.g. index contracts) this field is empty
lastBiddingCloseTimelonglast bidding close time
lastTradingDatestringRefers to the last trading date of the contract expiration month. Futures contracts that have not been cleared after the last trading day must be closed through the relevant spot commodity or cash settlement, and currently the last trading day for most futures commodities is usually the settlement day. Some commodities have the same day as the first notice day and the last trading day, such as the euro For cash delivery futures, as long as the last trading time has not passed, you can open positions normally, Non-cash delivery futures are restricted from opening positions in the first three trading days according to the smaller of the last trading time and the first notice day

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

Example

  static async Task<FutureContractsResponse?> GetFutureContractByExchangeCodeAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureContractsResponse> request = new TigerRequest<FutureContractsResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_CONTRACT_BY_EXCHANGE_CODE,
      ModelValue = new FutureContractByExchCodeModel() { ExchangeCode = "CME" }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{"data":[{"type":"MEUR","name":"E-Micro EUR/USD - main","ibCode":"M6E","contractCode":"MEURmain","contractMonth":"","exchangeCode":"GLOBEX","exchange":"CME","multiplier":12500.0,"minTick":0.0001,"lastTradingDate":"","firstNoticeDate":"","lastBiddingCloseTime":0,"currency":"USD","continuous":false,"trade":true},{"type":"MEUR","name":"E-Micro EUR/USD - Jun 2023","ibCode":"M6E","contractCode":"MEUR2306","contractMonth":"202306","exchangeCode":"GLOBEX","exchange":"CME","multiplier":12500.0,"minTick":0.0001,"lastTradingDate":"20230616","firstNoticeDate":"","lastBiddingCloseTime":0,"currency":"USD","continuous":false,"trade":true},{"type":"MEUR","name":"E-Micro EUR/USD - Mar 2023","ibCode":"M6E","contractCode":"MEUR2303","contractMonth":"202303","exchangeCode":"GLOBEX","exchange":"CME","multiplier":12500.0,"minTick":0.0001,"lastTradingDate":"20230313","firstNoticeDate":"","lastBiddingCloseTime":0,"currency":"USD","continuous":false,"trade":true},{"type":"NKD","name":"CME Nikkei/USD - Mar 2023","ibCode":"NKD","contractCode":"NKD2303","contractMonth":"202303","exchangeCode":"GLOBEX","exchange":"CME","multiplier":5.0,"minTick":5.0,"lastTradingDate":"20230309","firstNoticeDate":"","lastBiddingCloseTime":0,"currency":"USD","continuous":false,"trade":true}],"code":0,"message":"success","timestamp":1678169849775,"sign":"jE5c+XGvEUVOKBjiCmzM0zjlzsM7ASSvljfcKbJNom0+E0ivv8oenowoauJu0wHo45bjrX6sv7tWDEJInOKUYGpi4y69YivgNRsHvVKqS1qu14km/eqUYsrbvBO04xw9ttLqbtJqSYUF7gIi6By6f1bDTsoGdNMoS/ase5NxgoA="}

Get Futrue Contract By Type

Description

Get future contract by a given futures product.

Argument

ArgumentTypeRequiredDescription
typestringyesThe contract code of the future contract, excluding month code. Example: CL, ES
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureContractsResponsesourceopen in new window

Structured as follows:

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

Use FutureContractsResponse.Data to access returned data. This method will return a list of FutureContractItem object, whereTigerOpenAPI.Quote.Response.FutureContractItem has the following attributes:

NameTypeDescription
typestringfuture contract type, e.g. CL
namestringfuture contract name
tradeboolis tradable
continuousboolis continuous
contractCodestringcontract code, e.g. CL2112
contractMonthstringcontract month, e.g. 202112, indicates delivery in December 2021
currencystringtrading currency
exchangestringexchange
multiplierdecimalcontract multiplier, The real value of a contract is determined by multiplying the futures price by the contract multiplier. The reasonable price of futures can be estimated by dividing the contract multiplier by the physical price.
minTickdecimalThe minimum quote unit for futures price movement, for example, if the current futures price is 2000 and minTick is 100, then the correct quote includes 2100, 2200, and 2005 does not satisfy the requirement
firstNoticeDatestringThe first notice day is the date on which physical delivery of the contract can take place, and the contract cannot be opened for long positions after the first notice day. Existing long positions will be forced to close before the first notification date (usually the first three trading days). Non-physical delivery contracts (e.g. index contracts) this field is empty
lastBiddingCloseTimelonglast bidding close time
lastTradingDatestringRefers to the last trading date of the contract expiration month. Futures contracts that have not been cleared after the last trading day must be closed through the relevant spot commodity or cash settlement, and currently the last trading day for most futures commodities is usually the settlement day. Some commodities have the same day as the first notice day and the last trading day, such as the euro For cash delivery futures, as long as the last trading time has not passed, you can open positions normally, Non-cash delivery futures are restricted from opening positions in the first three trading days according to the smaller of the last trading time and the first notice day

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

Example

  static async Task<FutureContractsResponse?> GetFutureContractsAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureContractsResponse> request = new TigerRequest<FutureContractsResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_CONTRACTS,
      ModelValue = new FutureContractByTypeModel() { FutureType = "CL" }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "type":"CL",
            "name":"WTI Crude Oil - Apr 2023",
            "ibCode":"CL",
            "contractCode":"CL2304",
            "contractMonth":"202304",
            "exchangeCode":"NYMEX",
            "exchange":"NYMEX",
            "multiplier":1000,
            "minTick":0.01,
            "lastTradingDate":"20230321",
            "firstNoticeDate":"20230323",
            "lastBiddingCloseTime":0,
            "currency":"USD",
            "continuous":false,
            "trade":true
        },
        {
            "type":"CL",
            "name":"WTI Crude Oil - May 2023",
            "ibCode":"CL",
            "contractCode":"CL2305",
            "contractMonth":"202305",
            "exchangeCode":"NYMEX",
            "exchange":"NYMEX",
            "multiplier":1000,
            "minTick":0.01,
            "lastTradingDate":"20230420",
            "firstNoticeDate":"20230424",
            "lastBiddingCloseTime":0,
            "currency":"USD",
            "continuous":false,
            "trade":true
        },
        {
            "type":"CL",
            "name":"WTI Crude Oil - Jun 2023",
            "ibCode":"CL",
            "contractCode":"CL2306",
            "contractMonth":"202306",
            "exchangeCode":"NYMEX",
            "exchange":"NYMEX",
            "multiplier":1000,
            "minTick":0.01,
            "lastTradingDate":"20230522",
            "firstNoticeDate":"20230524",
            "lastBiddingCloseTime":0,
            "currency":"USD",
            "continuous":false,
            "trade":true
        },
        {
            "type":"CL",
            "name":"WTI Crude Oil - Jul 2023",
            "ibCode":"CL",
            "contractCode":"CL2307",
            "contractMonth":"202307",
            "exchangeCode":"NYMEX",
            "exchange":"NYMEX",
            "multiplier":1000,
            "minTick":0.01,
            "lastTradingDate":"20230620",
            "firstNoticeDate":"20230622",
            "lastBiddingCloseTime":0,
            "currency":"USD",
            "continuous":false,
            "trade":true
        },
        {
            "type":"CL",
            "name":"WTI Crude Oil - Aug 2023",
            "ibCode":"CL",
            "contractCode":"CL2308",
            "contractMonth":"202308",
            "exchangeCode":"NYMEX",
            "exchange":"NYMEX",
            "multiplier":1000,
            "minTick":0.01,
            "lastTradingDate":"20230720",
            "firstNoticeDate":"20230724",
            "lastBiddingCloseTime":0,
            "currency":"USD",
            "continuous":false,
            "trade":true
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678171088223,
    "sign":"Ml3F875Gt3mrcWt+imu0ykdelwBqt8I1USav3CJtcb/HbRUENJKC09iSgMwMB8AIh+7acT+WsmKNXdR2lR3fYH79L4Er3h6JZKxE2CyOtfqqcqGaBWgZo142RyfpI9gzpJejTGus1rTGk5BMtl6a+zLdMfut9fBoy10BTFaZHI8="
}

Get Futrue Continuous Contract

Description

Get future main contract by a given futures product.

Argument

ArgumentTypeRequiredDescription
typestringyesThe contract code of the future contract, excluding month code. Example: CL, ES
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureContractResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class FutureContractResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public FutureContractItem Data { get; set; }
  }
}

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

NameTypeDescription
typestringfuture contract type, e.g. CL
namestringfuture contract name
tradeboolis tradable
continuousboolis continuous
contractCodestringcontract code, e.g. CL2112
contractMonthstringcontract month, e.g. 202112, indicates delivery in December 2021
currencystringtrading currency
exchangestringexchange
multiplierdecimalcontract multiplier, The real value of a contract is determined by multiplying the futures price by the contract multiplier. The reasonable price of futures can be estimated by dividing the contract multiplier by the physical price.
minTickdecimalThe minimum quote unit for futures price movement, for example, if the current futures price is 2000 and minTick is 100, then the correct quote includes 2100, 2200, and 2005 does not satisfy the requirement
firstNoticeDatestringThe first notice day is the date on which physical delivery of the contract can take place, and the contract cannot be opened for long positions after the first notice day. Existing long positions will be forced to close before the first notification date (usually the first three trading days). Non-physical delivery contracts (e.g. index contracts) this field is empty
lastBiddingCloseTimelonglast bidding close time
lastTradingDatestringRefers to the last trading date of the contract expiration month. Futures contracts that have not been cleared after the last trading day must be closed through the relevant spot commodity or cash settlement, and currently the last trading day for most futures commodities is usually the settlement day. Some commodities have the same day as the first notice day and the last trading day, such as the euro For cash delivery futures, as long as the last trading time has not passed, you can open positions normally, Non-cash delivery futures are restricted from opening positions in the first three trading days according to the smaller of the last trading time and the first notice day

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

Example

  static async Task<FutureContractResponse?> GetFutureContinuousContractsAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureContractResponse> request = new TigerRequest<FutureContractResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_CONTINUOUS_CONTRACTS,
      ModelValue = new FutureContractByTypeModel() { FutureType = "ES" }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "type":"ES",
        "name":"E-mini S&P 500 - main",
        "ibCode":"ES",
        "contractCode":"ESmain",
        "contractMonth":"",
        "exchangeCode":"GLOBEX",
        "exchange":"CME",
        "multiplier":50,
        "minTick":0.25,
        "lastTradingDate":"",
        "firstNoticeDate":"",
        "lastBiddingCloseTime":0,
        "currency":"USD",
        "continuous":false,
        "trade":true
    },
    "code":0,
    "message":"success",
    "timestamp":1678171811158,
    "sign":"yAxfuGk0KFN2R344jiExbkJQo7FYzROFQhllfzHIwISWdYPiii0P3p8JmDEk2Ooswp396SdsQZv41r5+M4N0jiR8FCeRG3RkP4bWqt5kUriJANNzeNGd9ggu3Wzt9eGnzwJfIlFfZeojlgACYTRm1PzEdNQZB7rVDKxE1X5fmls="
}

Get Futrue Current Contract

Description

Get future current contract by a given futures product, that is, the main chain of the contract

Argument

ArgumentTypeRequiredDescription
typestringyesThe contract code of the future contract, excluding month code. Example: CL, ES
langstringnoLanguage parameter, which affects the "name" field in the return value, ranging from "zh_CN" to "en_US"

ResponseTigerOpenAPI.Quote.Response.FutureContractResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class FutureContractResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public FutureContractItem Data { get; set; }
  }
}

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

NameTypeDescription
typestringfuture contract type, e.g. CL
namestringfuture contract name
tradeboolis tradable
continuousboolis continuous
contractCodestringcontract code, e.g. CL2112
contractMonthstringcontract month, e.g. 202112, indicates delivery in December 2021
currencystringtrading currency
exchangestringexchange
multiplierdecimalcontract multiplier, The real value of a contract is determined by multiplying the futures price by the contract multiplier. The reasonable price of futures can be estimated by dividing the contract multiplier by the physical price.
minTickdecimalThe minimum quote unit for futures price movement, for example, if the current futures price is 2000 and minTick is 100, then the correct quote includes 2100, 2200, and 2005 does not satisfy the requirement
firstNoticeDatestringThe first notice day is the date on which physical delivery of the contract can take place, and the contract cannot be opened for long positions after the first notice day. Existing long positions will be forced to close before the first notification date (usually the first three trading days). Non-physical delivery contracts (e.g. index contracts) this field is empty
lastBiddingCloseTimelonglast bidding close time
lastTradingDatestringRefers to the last trading date of the contract expiration month. Futures contracts that have not been cleared after the last trading day must be closed through the relevant spot commodity or cash settlement, and currently the last trading day for most futures commodities is usually the settlement day. Some commodities have the same day as the first notice day and the last trading day, such as the euro For cash delivery futures, as long as the last trading time has not passed, you can open positions normally, Non-cash delivery futures are restricted from opening positions in the first three trading days according to the smaller of the last trading time and the first notice day

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

Example

  static async Task<FutureContractResponse?> GetFutureCurrentContractAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureContractResponse> request = new TigerRequest<FutureContractResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_CURRENT_CONTRACT,
      ModelValue = new FutureContractByTypeModel() { FutureType = "CL" }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "type":"CL",
        "name":"WTI Crude Oil - Apr 2023",
        "ibCode":"CL",
        "contractCode":"CL2304",
        "contractMonth":"202304",
        "exchangeCode":"NYMEX",
        "exchange":"NYMEX",
        "multiplier":1000,
        "minTick":0.01,
        "lastTradingDate":"20230321",
        "firstNoticeDate":"20230323",
        "lastBiddingCloseTime":0,
        "currency":"USD",
        "continuous":false,
        "trade":true
    },
    "code":0,
    "message":"success",
    "timestamp":1678172580508,
    "sign":"FzIp9l2W4BQg3OFwowIUGAFb24J7/MzApVeFxllE4Xr82s8pbSCqnlusufnjUOSNtDlp1/k8TdowexfPfiw8OQCBX1eT1d0tHlJgKiGHZx+nz/KK8QU3nnwjyCrzYIhqLLpXIE95kDEW4Odu0S0HH+yP4Iw+fDzrePLneFwdmCM="
}

Get Futrue Trading Date

Description

Get Trading Times of a selected future contract.

Argument

ArgumentTypeRequiredDescription
contractCodestringyesfutrure contract code, e.g. ES2306
tradingDatelongyestrading date's timestamp

ResponseTigerOpenAPI.Quote.Response.FutureTradingDateResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class FutureTradingDateResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public FutureTradingDateItem Data { get; set; }
  }
}

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

NameTypeDescription
tradingTimesarraytrading times, include 'start' and 'end'
biddingTimesarraybidding times, include 'start' and 'end'
timeSectionstringexchange's time zone

Use the properties, such asFutureTradingDateItem.TradingTimes.Start to access data,or use JsonConvert.SerializeObject() method to convert data to a string

Example

  static async Task<FutureTradingDateResponse?> GetFutureTradingDateAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureTradingDateResponse> request = new TigerRequest<FutureTradingDateResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_TRADING_DATE,
      ModelValue = new FutureTradingDateModel() {
        ContractCode = "ES2306",
        TradingDate = DateUtil.CurrentTimeMillis()
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "biddingTimes":[
            {
                "start":1678142700000,
                "end":1678143600000
            }
        ],
        "tradingTimes":[
            {
                "start":1678143600000,
                "end":1678226400000
            }
        ],
        "timeSection":"America/Chicago"
    },
    "code":0,
    "message":"success",
    "timestamp":1678173600501,
    "sign":"ey6JxBr3m2BmqmBI4prrakogg8EOI5IOSZaYoZ2A+9bqkGk+rCTPrGlzCQZVh7fbqxjCnJAvNdPfpv01XPnJfsgMiIpjTXTaodQYmDBidoZDDtf/2frdiGi/gcgaAH5eznznQkhXFcWarfVi8czgF9LNvGnwA9Afs0rm9nZtY+o="
}

Get future bars

Description

Get Future K-line data.

Argument

ArgumentTypeRequiredDescription
contractCodeslistyesfutures code list
periodstringyesK-line period:"min", "3min", "5min", "10min","15min", "30min", "45min", "60min","2hour", "3hour", "4hour", "6hour","day", "week", "month"
begin_timelongyesBegin time(include), millisecond timestamp
end_timelongyesEnd time(exclude), millisecond timestamp
limitintnoreturn limit count. default is 200, max is 1000
pageTokenstringnopage token

ResponseTigerOpenAPI.Quote.Response.FutureKlineResponsesourceopen in new window

Structured as below:

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

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

NameTypeDescription
symbolstringticker symbol of the underlying asse
nextPageTokenstringpage token for next query
itemsList<FutureKlineItem>a list that contains FutureKlineItem. FutureKlineItem is an array that contains bar data. Data included are listed as below

FutureKlineItem object has the following attributes:

NameTypeDescription
lastTimelonglast trading time
volumelongtrading volume within a bar
openInterestnoopen interest
opendecimalopen price
closedecimalclose price
timelongstart time of a bar, in millisecond timestamp
highdecimalhigh price
lowdecimallow price
settlementdecimalsettlement price

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

Example

  static async Task<FutureKlineResponse?> GetFutureKLineAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureKlineResponse> request = new TigerRequest<FutureKlineResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_KLINE,
      ModelValue = new FutureKlineModel()
      {
        ContractCodes = new List<string> { "ES2306" },
        Period = FutureKType.min15.Value,
        BeginTime = DateUtil.ConvertTimestamp("2023-03-06 09:00:00", CustomTimeZone.NY_ZONE),
        EndTime = DateUtil.ConvertTimestamp("2023-03-06 20:00:00", CustomTimeZone.NY_ZONE),
        Limit = 20
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "contractCode":"ES2306",
            "nextPageToken":"ZnV0dXJlX2tsaW5lfEVTMjMwNnwxNW1pbnwxNjc4MTUwODAwMDAwfDE2NzgxMjkxNzAwMDA=",
            "items":[
                {
                    "time":1678149900000,
                    "lastTime":1678150746000,
                    "open":4092.5,
                    "close":4092,
                    "high":4092.75,
                    "low":4091,
                    "volume":32,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678149000000,
                    "lastTime":1678149860000,
                    "open":4093.75,
                    "close":4093,
                    "high":4094.5,
                    "low":4092,
                    "volume":81,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678148100000,
                    "lastTime":1678148987000,
                    "open":4091.25,
                    "close":4093.75,
                    "high":4094,
                    "low":4091,
                    "volume":83,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678147200000,
                    "lastTime":1678148083000,
                    "open":4091.5,
                    "close":4092.25,
                    "high":4094.25,
                    "low":4091.5,
                    "volume":28,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678146300000,
                    "lastTime":1678147127000,
                    "open":4090.5,
                    "close":4091.75,
                    "high":4092.75,
                    "low":4090.5,
                    "volume":21,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678145400000,
                    "lastTime":1678146202000,
                    "open":4092.25,
                    "close":4089.75,
                    "high":4092.25,
                    "low":4089.75,
                    "volume":9,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678144500000,
                    "lastTime":1678145341000,
                    "open":4089.75,
                    "close":4091.5,
                    "high":4091.5,
                    "low":4089.75,
                    "volume":15,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678143600000,
                    "lastTime":1678144339000,
                    "open":4090,
                    "close":4089.75,
                    "high":4090,
                    "low":4088.75,
                    "volume":25,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678139100000,
                    "lastTime":1678139970000,
                    "open":4091.5,
                    "close":4091.5,
                    "high":4091.75,
                    "low":4091,
                    "volume":36,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678138200000,
                    "lastTime":1678138786000,
                    "open":4091.75,
                    "close":4091.5,
                    "high":4092.75,
                    "low":4091.25,
                    "volume":40,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678137300000,
                    "lastTime":1678138056000,
                    "open":4090.75,
                    "close":4091.75,
                    "high":4091.75,
                    "low":4090.25,
                    "volume":43,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678136400000,
                    "lastTime":1678137298000,
                    "open":4089.25,
                    "close":4090.5,
                    "high":4090.75,
                    "low":4088.25,
                    "volume":363,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678135500000,
                    "lastTime":1678136399000,
                    "open":4090.75,
                    "close":4089.25,
                    "high":4092.25,
                    "low":4088.25,
                    "volume":494,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678134600000,
                    "lastTime":1678135484000,
                    "open":4086,
                    "close":4090.5,
                    "high":4091.25,
                    "low":4085.25,
                    "volume":441,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678133700000,
                    "lastTime":1678134584000,
                    "open":4090,
                    "close":4086.5,
                    "high":4090.25,
                    "low":4085.75,
                    "volume":444,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678132800000,
                    "lastTime":1678133699000,
                    "open":4091.25,
                    "close":4090,
                    "high":4094.75,
                    "low":4088.5,
                    "volume":598,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678131900000,
                    "lastTime":1678132766000,
                    "open":4095.75,
                    "close":4090.5,
                    "high":4095.75,
                    "low":4089.5,
                    "volume":189,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678131000000,
                    "lastTime":1678131880000,
                    "open":4094.25,
                    "close":4096.25,
                    "high":4096.75,
                    "low":4092.25,
                    "volume":132,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678130100000,
                    "lastTime":1678130990000,
                    "open":4096.75,
                    "close":4094,
                    "high":4097,
                    "low":4091.25,
                    "volume":174,
                    "openInterest":0,
                    "settlement":0
                },
                {
                    "time":1678129200000,
                    "lastTime":1678130078000,
                    "open":4093,
                    "close":4097.75,
                    "high":4098.25,
                    "low":4092.5,
                    "volume":149,
                    "openInterest":0,
                    "settlement":0
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678175056154,
    "sign":"QOhaoeoPG4m8rkG1p7PQW7PahB2y3iUhnY61FLWmZoInply63yFDxpCEMCsvEzCAZcNdOuinXC6YvYOKI1Jt/C5LRZ4M5zzsTeYVSMzyJefbCmmdKey49HXimPgWQwOuS8AsuiIf19blKzK20xMyj2/tNT3eB8ZTuWcComEC/Kc="
}

Get Realtime Quote

Description

Get future realtime quote data.

Argument

ArgumentTypeRequiredDescription
contractCodeslistyesfutures code list

ResponseTigerOpenAPI.Quote.Response.FutureRealTimeQuoteResponsesourceopen in new window

Structured as below:

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

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

NameTypeDescription
contractCodestringcontract code
latestPricedecimallatest price
latestSizedecimallatest trading size
latestTimelonglatest trading time
bidPricedecimalbid price
bidSizelongbid size
askPricedecimalask price
askSizelongask size
volumelongtrading volume within a bar
openInterestlongopen interest
opendecimalopen price
highdecimalhigh price
lowdecimallow price
settlementdecimalsettlement price
limitUpdecimallimit up price
limitDowndecimallimit down price

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

Example

  static async Task<FutureRealTimeQuoteResponse?> GetFutureRealTimeQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureRealTimeQuoteResponse> request = new TigerRequest<FutureRealTimeQuoteResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_REAL_TIME_QUOTE,
      ModelValue = new FutureContractCodesModel()
      {
        ContractCodes = new List<string> { "CL2306" }
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "contractCode":"CL2306",
            "latestPrice":80.46,
            "latestSize":1,
            "latestTime":1678177555000,
            "bidPrice":80.41,
            "bidSize":6,
            "askPrice":80.43,
            "askSize":7,
            "openInterest":220802,
            "volume":1541,
            "open":80.51,
            "high":80.97,
            "low":80.42,
            "settlement":80.51,
            "limitUp":0,
            "limitDown":0
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678177603241,
    "sign":"SZviDq7XrkTefCKvlLZlwGbFKq8CVw+q0HMU3GZxuC7gdiCp5QbRcnPAKSEvupQCtkV7kN75jQROe5WocD0DQdOPtvWgvBbb+JB+lnL5YS5od3gUQutAcG0iCLjoupJVqjIa/FjbEqcaWMX2IYRg8myEkNFP/g3T/57/QLQaKS8="
}

Get Future Trade Ticks

Description

Get trade tick data for futures

Argument

ArgumentTypeRequiredDescription
contractCodestringyescontract code
beginIndexlongyesbegin index
endIndexlongyesend index
limitIntnoreturn count, default is 200, max is 1000

ResponseTigerOpenAPI.Quote.Response.FutureTickResponsesourceopen in new window

has the following structure:

namespace TigerOpenAPI.Quote.Response
{
  public class FutureTickResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public FutureTickBatchItem Data { get; set; }
  }
}

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

NameTypeDescription
contractCodestringcontract code
itemsList<FutureTickItem>List of FutureTickItem object. Each FutureTickItem corresponds to a trade tick

FutureTickItem has the following attributes:

NameTypeArgument
indexintindex
pricedoubletransaction price
timelongtransaction time
volumelongtrade volume

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

Example

  static async Task<FutureTickResponse?> GetFutureTickAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureTickResponse> request = new TigerRequest<FutureTickResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_TICK,
      ModelValue = new FutureTickModel()
      {
        ContractCode = "ES2306",
        BeginIndex = 10,
        EndIndex = 100,
        Limit = 20
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "contractCode":"ES2306",
        "items":[
            {
                "index":10,
                "price":4089.5,
                "volume":1,
                "time":1678144320000
            },
            {
                "index":11,
                "price":4089.75,
                "volume":1,
                "time":1678144339000
            },
            {
                "index":12,
                "price":4089.75,
                "volume":1,
                "time":1678144534000
            },
            {
                "index":13,
                "price":4089.75,
                "volume":3,
                "time":1678144548000
            },
            {
                "index":14,
                "price":4090.5,
                "volume":1,
                "time":1678144591000
            },
            {
                "index":15,
                "price":4090.75,
                "volume":3,
                "time":1678144624000
            },
            {
                "index":16,
                "price":4090.75,
                "volume":1,
                "time":1678144624000
            },
            {
                "index":17,
                "price":4091,
                "volume":2,
                "time":1678144870000
            },
            {
                "index":18,
                "price":4091.25,
                "volume":1,
                "time":1678145178000
            },
            {
                "index":19,
                "price":4091.5,
                "volume":1,
                "time":1678145287000
            },
            {
                "index":20,
                "price":4091.5,
                "volume":2,
                "time":1678145341000
            },
            {
                "index":21,
                "price":4092.25,
                "volume":1,
                "time":1678145425000
            },
            {
                "index":22,
                "price":4092,
                "volume":1,
                "time":1678145462000
            },
            {
                "index":23,
                "price":4091.5,
                "volume":1,
                "time":1678145568000
            },
            {
                "index":24,
                "price":4090.75,
                "volume":2,
                "time":1678145647000
            },
            {
                "index":25,
                "price":4091,
                "volume":1,
                "time":1678145844000
            },
            {
                "index":26,
                "price":4091,
                "volume":2,
                "time":1678146074000
            },
            {
                "index":27,
                "price":4089.75,
                "volume":1,
                "time":1678146202000
            },
            {
                "index":28,
                "price":4090.5,
                "volume":1,
                "time":1678146337000
            },
            {
                "index":29,
                "price":4091,
                "volume":1,
                "time":1678146435000
            }
        ]
    },
    "code":0,
    "message":"success",
    "timestamp":1678179358159,
    "sign":"c47DHnl8Y/zNCX6fFIMBGUQJeJ2rsaJ1KGfIP3lubO3nEMgRBInh4TYVzWmzTW2UW4Xx1/UnjVi8sWbBbD73UysOQnWEsFwdz+FDbpiA+UxVF07j/7kY7vsFnX+NzYm7js2R4/9LhMPAxdvCoM7P0Ujwz3nDWHHH+yTpo29r6xI="
}

Get futures main's historical contract codes

Request:TigerRequest(QuoteApiService.FUTURE_HISTORY_MAIN_CONTRACT)

Description

Get futures main's historical contract codes

Argument

ArgumentTypeRequiredDescription
contractCodeslistyesfutures code list
begin_timelongyesBegin time(exclude), millisecond timestamp
end_timelongyesEnd time(include), millisecond timestamp

ResponseTigerOpenAPI.Quote.Response.FutureHistoryMainContractResponsesourceopen in new window

Structured as below:

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

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

NameTypeDescription
contractCodestringfutures main contract code
mainReferItemsList<FutureHistoryContractItem>a list that contains FutureHistoryContractItem. FutureHistoryContractItem is an array that contains historical futures contract code. Data included are listed as below

FutureHistoryContractItem object has the following attributes:

NameTypeDescription
timelongtimestamp
referContractCodestringfutures main's historical contract code

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

Example

  static async Task<FutureHistoryMainContractResponse?> GetFutureHistoryMainContractAsync(QuoteClient quoteClient)
  {
    TigerRequest<FutureHistoryMainContractResponse> request = new TigerRequest<FutureHistoryMainContractResponse>()
    {
      ApiMethodName = QuoteApiService.FUTURE_HISTORY_MAIN_CONTRACT,
      ModelValue = new FutureHistoryMainContractModel()
      {
        ContractCodes = new List<string> { "ESmain" },
        BeginTime = DateUtil.ConvertTimestamp("2023-08-08 00:00:00", CustomTimeZone.NY_ZONE),
        EndTime = DateUtil.ConvertTimestamp("2023-10-05 23:59:00", CustomTimeZone.NY_ZONE),
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "contractCode":"ESmain",
            "mainReferItems":[
                {
                    "time":1696453200000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1696366800000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1696280400000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1696021200000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695934800000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695848400000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695762000000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695675600000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695416400000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695330000000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695243600000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695157200000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1695070800000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694811600000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694725200000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694638800000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694552400000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694466000000,
                    "referContractCode":"ES2312"
                },
                {
                    "time":1694206800000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1694120400000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1694034000000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693947600000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693602000000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693515600000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693429200000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693342800000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1693256400000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692997200000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692910800000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692824400000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692738000000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692651600000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692392400000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692306000000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692219600000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692133200000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1692046800000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1691787600000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1691701200000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1691614800000,
                    "referContractCode":"ES2309"
                },
                {
                    "time":1691528400000,
                    "referContractCode":"ES2309"
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1696503833367,
    "sign":"KCLiaXU/4r517tF5JfPLuWOz2C0kdyAJBTt5eA8aPfUSXHQb6LjGeNyJdXZyhKkTODoWBfdcOY0eB8uvgVi9iy2ZZkEfrrF6VGIs0q9rXutoD1a7M/TyuphSyT2r5Lj4XToFswE5Tk2Pz1WIj554Kcuq1gdKtGXN5Zu+amO7LU8="
}
Last update: