账户与持仓

状态变更操作必须防止重复提交。

获取账户列表

操作名

TradeApiService.ACCOUNTS = accounts。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<AccountsResponse>

ModelValue: ApiModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullnoACCOUNTS 豁免默认账户注入和账户必填校验

返回

AccountsResponse inherits TigerResponse; its data property is 字典,键为 string,值为 列表,元素为 AccountItem. Key SDK fields: 动态字段.

示例

TigerRequest<AccountsResponse> request = new()
{
    ApiMethodName = TradeApiService.ACCOUNTS,
    ModelValue = new ApiModel()
};
AccountsResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

Dictionary<string, List<AccountItem>>? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": [
    {
      "account": "DU12345678",
      "capability": "RegTMargin",
      "status": "Active"
    }
  ]
}

频率限制

基础额度:每分钟 60 次

获取环球账户资产

操作名

TradeApiService.ASSETS = assets。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<TigerDictResponse>

ModelValue: GlobalAssetsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
SegmentBooleansegmentCLR 默认值;序列化时省略Optional
MarketValueBooleanmarket_valueCLR 默认值;序列化时省略Optional

返回

TigerDictResponse inherits TigerResponse; its data property is 字典,键为 string,值为 object. Key SDK fields: 动态字段.

示例

TigerRequest<TigerDictResponse> request = new()
{
    ApiMethodName = TradeApiService.ASSETS,
    ModelValue = new GlobalAssetsModel { Account = tradeClient.GetDefaultAccount }
};
TigerDictResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

Dictionary<string, object>? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": [
    {
      "account": "DU12345678",
      "summary": {
        "netLiquidation": 125000.0,
        "totalCashValue": 50000.0,
        "grossPositionValue": 75000.0,
        "initMarginReq": 25000.0,
        "maintMarginReq": 20000.0,
        "buyingPower": 100000.0,
        "unrealizedPnl": 15866.0,
        "realizedPnl": 3200.0
      }
    }
  ]
}

频率限制

基础额度:每分钟 60 次

获取综合/模拟账户资产

操作名

TradeApiService.PRIME_ASSETS = prime_assets。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<PrimeAssetResponse>

ModelValue: PrimeAssetsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
BaseCurrencystringbase_currencynullOptional
ConsolidatedBooleanconsolidatedCLR 默认值;序列化时省略Optional

返回

PrimeAssetResponse inherits TigerResponse; its data property is PrimeAssetItem. Key SDK fields: Account: string, UpdateTimestamp: long, Segments: list of Segment.

示例

TigerRequest<PrimeAssetResponse> request = new()
{
    ApiMethodName = TradeApiService.PRIME_ASSETS,
    ModelValue = new PrimeAssetsModel { Account = tradeClient.GetDefaultAccount }
};
PrimeAssetResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

PrimeAssetItem? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": [
    {
      "account": "DU12345678",
      "segments": [
        {"category": "S", "currency": "USD", "cashBalance": 50000.0, "grossPositionValue": 75000.0, "netLiquidation": 125000.0}
      ]
    }
  ]
}

频率限制

基础额度:每分钟 60 次

获取历史资产分析

操作名

TradeApiService.ANALYTICS_ASSET = analytics_asset。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<PrimeAnalyticsAssetResponse>

ModelValue: PrimeAnalyticsAssetModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional
CurrencyCurrencycurrencyCLR 默认值;序列化时省略Optional
SubAccountstringsub_accountnullOptional
StartDatestringstart_datenullOptionalTimestamp or date format; maintain chronological order
EndDatestringend_datenullOptionalTimestamp or date format; maintain chronological order

返回

PrimeAnalyticsAssetResponse inherits TigerResponse; its data property is PrimeAnalyticsAssetItem. Key SDK fields: Summary: Summary, History: list of HistoryItem.

示例

TigerRequest<PrimeAnalyticsAssetResponse> request = new()
{
    ApiMethodName = TradeApiService.ANALYTICS_ASSET,
    ModelValue = new PrimeAnalyticsAssetModel { Account = tradeClient.GetDefaultAccount, SegType = SegmentType.SEC, Currency = Currency.USD, StartDate = "2026-01-01", EndDate = "2026-01-31" }
};
PrimeAnalyticsAssetResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

PrimeAnalyticsAssetItem? data = response?.Data; // response 或 data 缺失时为 null

获取聚合资产

操作名

TradeApiService.AGGREGATE_ASSETS = aggregate_assets。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<AggregateAssetResponse>

ModelValue: AggregateAssetModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
SegTypestringseg_typenullOptional
BaseCurrencystringbase_currencynullOptional

返回

AggregateAssetResponse inherits TigerResponse; its data property is AggregateAssetItem. Key SDK fields: Currency: string, CashBalance: double, CashBalanceWithInTransit: double, EquityWithLoan: double, NetLiquidation: double, InitMargin: double, MaintainMargin: double, TradeCurrencyMargin: double.

示例

TigerRequest<AggregateAssetResponse> request = new()
{
    ApiMethodName = TradeApiService.AGGREGATE_ASSETS,
    ModelValue = new AggregateAssetModel { Account = tradeClient.GetDefaultAccount, SegType = "SEC" }
};
AggregateAssetResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

AggregateAssetItem? data = response?.Data; // response 或 data 缺失时为 null

频率限制

基础额度:每分钟 60 次

获取持仓

操作名

TradeApiService.POSITIONS = positions。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<PositionsResponse>

ModelValue: PositionsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
CurrencyCurrencycurrencyCLR 默认值;序列化时省略Optional
SymbolstringsymbolnullRequired
RightstringrightnullOptional
StrikeDoublestrikeCLR 默认值;序列化时省略Optional
ExpirystringexpirynullOptional
AssetQuoteTypeAssetQuoteTypeasset_quote_typeCLR 默认值;序列化时省略Optional

返回

PositionsResponse inherits TigerResponse; its data property is PositionsItem. Key SDK fields: Items: list of PositionDetail.

示例

TigerRequest<PositionsResponse> request = new()
{
    ApiMethodName = TradeApiService.POSITIONS,
    ModelValue = new PositionsModel { Account = tradeClient.GetDefaultAccount, SecType = SecType.STK, Market = Market.US, Currency = Currency.USD, Symbol = "AAPL" }
};
PositionsResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

PositionsItem? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": [
    {
      "account": "DU12345678",
      "symbol": "AAPL",
      "position": 100,
      "averageCost": 150.25,
      "latestPrice": 308.91,
      "marketValue": 30891.0,
      "unrealizedPnl": 15866.0,
      "secType": "STK",
      "currency": "USD"
    }
  ]
}

频率限制

基础额度:每分钟 60 次

预估可交易数量

操作名

TradeApiService.ESTIMATE_TRADABLE_QUANTITY = estimate_tradable_quantity。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<EstimateTradableQuantityResponse>

ModelValue: EstimateTradableQuantityModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional
ActionActionTypeactionCLR 默认值;序列化时省略Optional
OrderTypeOrderTypeorder_typeCLR 默认值;序列化时省略Optionalprice fields are conditionally required by order type
LimitPriceDoublelimit_priceCLR 默认值;序列化时省略Optionalconditional order-price field
StopPriceDoublestop_priceCLR 默认值;序列化时省略Optional

返回

EstimateTradableQuantityResponse inherits TigerResponse; its data property is TradableQuantityItem. Key SDK fields: TradableQuantity: Double, FinancingQuantity: Double, PositionQuantity: Double, TradablePositionQuantity: Double.

示例

TigerRequest<EstimateTradableQuantityResponse> request = new()
{
    ApiMethodName = TradeApiService.ESTIMATE_TRADABLE_QUANTITY,
    ModelValue = new EstimateTradableQuantityModel { Account = tradeClient.GetDefaultAccount, Symbol = "AAPL", Strike = "200", SegType = SegmentType.SEC, SecType = SecType.STK }
};
EstimateTradableQuantityResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

TradableQuantityItem? data = response?.Data; // response 或 data 缺失时为 null

频率限制

基础额度:每分钟 60 次


Did this page help you?