账户与持仓

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

获取账户列表

操作名

TradeApiService.ACCOUNTS = accounts. 使用服务端方法 accounts。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<AccountsResponse>

ModelValue: ApiModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullnoNot auto-filled for this operation

返回

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"
    }
  ]
}

获取环球账户资产

操作名

TradeApiService.ASSETS = assets. 使用服务端方法 assets。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<TigerDictResponse>

ModelValue: GlobalAssetsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
SegmentBooleansegmentNone (omitted if not set)Optional
MarketValueBooleanmarket_valueNone (omitted if not set)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
      }
    }
  ]
}

获取综合/模拟账户资产

操作名

TradeApiService.PRIME_ASSETS = prime_assets. 使用服务端方法 prime_assets。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<PrimeAssetResponse>

ModelValue: PrimeAssetsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
BaseCurrencystringbase_currencynullOptional
ConsolidatedBooleanconsolidatedNone (omitted if not set)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}
      ]
    }
  ]
}

获取历史资产分析

操作名

TradeApiService.ANALYTICS_ASSET = analytics_asset. 使用服务端方法 analytics_asset。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<PrimeAnalyticsAssetResponse>

ModelValue: PrimeAnalyticsAssetModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
CurrencyCurrencycurrencyNone (omitted if not set)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. 使用服务端方法 aggregate_assets。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<AggregateAssetResponse>

ModelValue: AggregateAssetModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
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

获取持仓

操作名

TradeApiService.POSITIONS = positions. 使用服务端方法 positions。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<PositionsResponse>

ModelValue: PositionsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
SecTypeSecTypesec_typeNone (omitted if not set)Optional
MarketMarketmarketNone (omitted if not set)OptionalEnum value
CurrencyCurrencycurrencyNone (omitted if not set)Optional
SymbolstringsymbolnullRequired
RightstringrightnullOptional
StrikeDoublestrikeNone (omitted if not set)Optional
ExpirystringexpirynullOptional
AssetQuoteTypeAssetQuoteTypeasset_quote_typeNone (omitted if not set)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"
    }
  ]
}

预估可交易数量

操作名

TradeApiService.ESTIMATE_TRADABLE_QUANTITY = estimate_tradable_quantity. 使用服务端方法 estimate_tradable_quantity。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<EstimateTradableQuantityResponse>

ModelValue: EstimateTradableQuantityModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
ActionActionTypeactionNone (omitted if not set)Optional
OrderTypeOrderTypeorder_typeNone (omitted if not set)Optionalprice fields are conditionally required by order type
LimitPriceDoublelimit_priceNone (omitted if not set)Optionalconditional order-price field
StopPriceDoublestop_priceNone (omitted if not set)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

Did this page help you?