Requests, Responses, and Operations
TigerRequest
public class TigerRequest<T> where T : TigerResponse| Property | Type | SDK default | Purpose |
|---|---|---|---|
ApiMethodName | string | none | QuoteApiService/TradeApiService operation constant |
ModelValue | ApiModel | client's empty model | Business request serialized as biz_content |
ApiVersion | string | TigerApiConstants.DEFAULT_VERSION | Protocol version |
Charset | string | UTF-8 constant | Signature character set |
SignType | string | RSA constant | Signature algorithm |
TigerId, Timestamp, Sign, DeviceId | string | populated by client | Normally 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:
| Field | Meaning |
|---|---|
Delta | Sensitivity of theoretical option value to changes in the underlying price |
Gamma | Sensitivity of Delta to changes in the underlying price |
Theta | Sensitivity of theoretical option value to the passage of time |
Vega | Sensitivity of theoretical option value to changes in implied volatility |
Rho | Sensitivity of theoretical option value to changes in the risk-free rate |
These local calculations are distinct from the deprecated option-chain Greek fields.
Updated about 7 hours ago
