Requests, Responses, and Operations

TigerRequest

public class TigerRequest<T> where T : TigerResponse
PropertyTypeSDK defaultPurpose
ApiMethodNamestringnoneQuoteApiService/TradeApiService operation constant
ModelValueApiModelclient's empty modelBusiness request serialized as biz_content
ApiVersionstringTigerApiConstants.DEFAULT_VERSIONProtocol version
CharsetstringUTF-8 constantSignature character set
SignTypestringRSA constantSignature algorithm
TigerId, Timestamp, Sign, DeviceIdstringpopulated by clientNormally do not set manually

QuoteApiService and TradeApiService are not network clients. IsQuoteApi/IsTradeApi only validate operation names. Network calls are QuoteClient.Execute[Async] and TradeClient.Execute[Async].

TigerResponse

Every response has Code, Message, Timestamp, Sign, and IsSuccess(). Read each concrete class's Data, which may be strongly typed, a list, Dictionary<string, object>, or object.

Rates and Errors

  • Retry count comes from TigerConfig.FailRetryCounts; business failures are not retryable network failures.
  • Synchronous order placement and token refresh bypass automatic retry.
  • Use only batch, date-window, page, and rate limits stated on the relevant API page. Check business codes on failure, pass page tokens unchanged, and back off only for safely retryable read requests.
  • Quote, trading, options, futures, depth, and streaming permissions are separate.

Protocol-field models

Five server operations are registered in QuoteApiService but have no dedicated request class in C# SDK 1.2.3. An anonymous object cannot be assigned to TigerRequest.ModelValue; define small ApiModel subclasses. Use the complete definitions in the paired Chinese page or the equivalent declarations below.

using Newtonsoft.Json;
using TigerOpenAPI.Common.Enum;
using TigerOpenAPI.Model;

public sealed class StockDetailModel : ApiModel
{
    [JsonProperty(PropertyName = "symbols")]
    public List<string> Symbols { get; set; } = new();
    [JsonProperty(PropertyName = "sec_type", NullValueHandling = NullValueHandling.Ignore)]
    public string? SecType { get; set; }
}

public sealed class OptionTimelineQuery
{
    [JsonProperty(PropertyName = "symbol")]
    public string Symbol { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "expiry")]
    public long Expiry { get; set; }
    [JsonProperty(PropertyName = "right")]
    public string Right { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "strike")]
    public string Strike { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "begin_time", NullValueHandling = NullValueHandling.Ignore)]
    public long? BeginTime { get; set; }
}

public sealed class OptionTimelineModel : ApiModel
{
    [JsonProperty(PropertyName = "option_query")]
    public List<OptionTimelineQuery> OptionQuery { get; set; } = new();
    [JsonProperty(PropertyName = "market")]
    public Market Market { get; set; }
}

public sealed class IndustryListModel : ApiModel
{
    [JsonProperty(PropertyName = "industry_level", NullValueHandling = NullValueHandling.Ignore)]
    public string? IndustryLevel { get; set; }
}

public sealed class IndustryStocksModel : ApiModel
{
    [JsonProperty(PropertyName = "industry_id")]
    public int IndustryId { get; set; }
    [JsonProperty(PropertyName = "market", NullValueHandling = NullValueHandling.Ignore)]
    public string? Market { get; set; }
}

public sealed class StockIndustryModel : ApiModel
{
    [JsonProperty(PropertyName = "symbol")]
    public string Symbol { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "market", NullValueHandling = NullValueHandling.Ignore)]
    public string? Market { get; set; }
    [JsonProperty(PropertyName = "sec_type", NullValueHandling = NullValueHandling.Ignore)]
    public string? SecType { get; set; }
}

Local Option Calculations

OptionCalcUtil.GetOptionFundamentals calculates OptionFundamentals from market inputs. The locally calculated Greeks mean:

FieldMeaning
DeltaSensitivity of theoretical option value to changes in the underlying price
GammaSensitivity of Delta to changes in the underlying price
ThetaSensitivity of theoretical option value to the passage of time
VegaSensitivity of theoretical option value to changes in implied volatility
RhoSensitivity of theoretical option value to changes in the risk-free rate

These local calculations are distinct from the deprecated option-chain Greek fields.


Did this page help you?