账户与持仓

资产估值行情口径

以下新增参数示例适用于 C# SDK 1.2.7 及以上版本。

综合/模拟账户查询资产或持仓时,可通过 AssetQuoteType 选择估值使用的行情口径;HTTP 字段名为 asset_quote_type。

值说明
ETH包含盘前、盘中、盘后行情;夜盘时段使用前一日盘后收盘价计算
RTH仅包含盘中行情;盘前、盘后及夜盘时段使用盘中收盘价
OVERNIGHT包含盘前、盘中、盘后和夜盘行情;夜盘时段使用夜盘行情计算

该属性为可空枚举,未设置或为 null 时省略该字段并保持原有行为。该参数控制资产和持仓估值,不代表夜盘下单权限或交易能力。枚举定义见资产行情模式。

该参数不会冻结资产或持仓数据。即使使用 RTH,资金、汇率或其他市场的变化仍可能影响净资产。

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

获取账户列表

操作名

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

请求

TigerRequest<AccountsResponse>

ModelValue: ApiModel.

参数

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

返回

AccountsResponse 继承 TigerResponse;其 Data 为 Dictionary<string, List<AccountItem>>。

示例

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

Data 字段

响应数据结构SDK 约定
Dictionary<string, List<AccountItem>>键由服务端决定;每个值为 List<AccountItem>。
AccountItem 字段API 字段C# 类型说明
Accountaccountstring账户号
Capabilitycapabilitystring账户交易能力
AccountTypeaccountTypestring账户类型
Statusstatusstring账户状态

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": {
    "accounts": [
      {
        "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为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
SegmentBooleansegmentCLR 默认值;序列化时省略Optional—
MarketValueBooleanmarket_valueCLR 默认值;序列化时省略Optional—
AssetQuoteTypeAssetQuoteType?asset_quote_typenull;序列化时省略OptionalETH / RTH / OVERNIGHT;仅综合/模拟账户适用,见口径说明

返回

TigerDictResponse 继承 TigerResponse;其 Data 为 Dictionary<string, object>。

示例

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

Data 字段

类型SDK 约定
Dictionary<string, object>动态字典;SDK 未定义固定键或嵌套对象类型。

返回示例

{
  "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为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
BaseCurrencystringbase_currencynullOptional—
ConsolidatedBooleanconsolidatedCLR 默认值;序列化时省略Optional—
AssetQuoteTypeAssetQuoteType?asset_quote_typenull;序列化时省略OptionalETH / RTH / OVERNIGHT;见口径说明

返回

PrimeAssetResponse 继承 TigerResponse;其 Data 为 PrimeAssetItem。

示例

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

响应类型

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

Data 字段(PrimeAssetItem)

字段API 字段C# 类型说明
AccountaccountIdstring账户标识
UpdateTimestampupdateTimestamplong资产更新时间戳
SegmentssegmentsList<Segment>分区资产列表

每个 Segment:

字段API 字段C# 类型说明
Capabilitycapabilitystring分区交易能力
Categorycategorystring分区类别
Currencycurrencystring计价币种
CashBalancecashBalanceDouble现金余额
CashAvailableForTradecashAvailableForTradeDouble可交易现金
CashAvailableForWithdrawalcashAvailableForWithdrawalDouble可取现金
GrossPositionValuegrossPositionValueDouble持仓总市值
EquityWithLoanequityWithLoanDouble含贷款权益
NetLiquidationnetLiquidationDouble净清算价值
InitMargininitMarginDouble初始保证金
MaintainMarginmaintainMarginDouble维持保证金
OvernightMarginovernightMarginDouble隔夜保证金
UnrealizedPLunrealizedPLDouble未实现盈亏
RealizedPLrealizedPLDouble已实现盈亏
ExcessLiquidationexcessLiquidationDouble超额流动性
OvernightLiquidationovernightLiquidationDouble隔夜流动性
BuyingPowerbuyingPowerDouble购买力
LeverageleverageDouble杠杆倍数
UnrealizedPLByCostOfCarryunrealizedPLByCostOfCarryDouble按持仓成本计算的未实现盈亏
TotalTodayPLtotalTodayPLDouble当日总盈亏
LockedFundslockedFundsDouble锁定资金
UncollecteduncollectedDouble在途资产
CurrencyAssetscurrencyAssetsList<CurrencyAssets>按币种划分的资产列表
ConsolidatedSegTypesconsolidatedSegTypesList<string>合并的账户分区类型

每个 CurrencyAssets:

字段API 字段C# 类型说明
Currencycurrencystring币种
CashBalancecashBalanceDouble现金余额
CashAvailableForTradecashAvailableForTradeDouble可交易现金
GrossPositionValuegrossPositionValueDouble持仓总市值
StockMarketValuestockMarketValueDouble股票市值
OptionMarketValueoptionMarketValueDouble期权市值
FuturesMarketValuefuturesMarketValueDouble期货市值
UnrealizedPLunrealizedPLDouble未实现盈亏
RealizedPLrealizedPLDouble已实现盈亏

返回示例

{
  "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为空时 TradeClient 从 TigerConfig.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 继承 TigerResponse;其 Data 为 PrimeAnalyticsAssetItem。

示例

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

Data 字段(PrimeAnalyticsAssetItem)

字段API 字段C# 类型说明
SummarysummarySummary历史资产汇总
HistoryhistoryList<HistoryItem>历史资产明细列表

Summary:

字段API 字段C# 类型说明
PnlpnlDouble盈亏
PnlPercentagepnlPercentageDouble盈亏比例
AnnualizedReturnannualizedReturnDouble年化收益率
OverUserPercentageoverUserPercentageDouble相对用户百分比
HistoryItem 字段API 字段C# 类型说明
Datedatelong日期时间戳
AssetassetDouble资产值
PnlpnlDouble盈亏
PnlPercentagepnlPercentageDouble盈亏比例
CashBalancecashBalanceDouble现金余额
GrossPositionValuegrossPositionValueDouble持仓总市值
DepositdepositDouble入金金额
WithdrawalwithdrawalDouble出金金额

获取聚合资产

操作名

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

请求

TigerRequest<AggregateAssetResponse>

ModelValue: AggregateAssetModel.

仅支持已开通聚合资产能力的机构账户,例如子账户打通购买力后的机构聚合资产。必须通过 SecretKey 或 TigerConfig.SecretKey 配置机构交易员密钥,且服务端要求 SegType 为 SEC / FUT / FUND。

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynull;为空时使用 TigerConfig.SecretKey请求或配置中必需机构交易员密钥
SegTypestringseg_typenullRequired仅支持 SEC / FUT / FUND;ALL 或未传会被拒绝
BaseCurrencystringbase_currencynullOptional—
AssetQuoteTypeAssetQuoteType?asset_quote_typenull;序列化时省略OptionalETH / RTH / OVERNIGHT;见口径说明

返回

AggregateAssetResponse 继承 TigerResponse;其 Data 为 AggregateAssetItem。

示例

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

响应类型

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

Data 字段(AggregateAssetItem)

字段API 字段C# 类型说明
Currencycurrencystring计价币种
CashBalancecashBalancedouble现金余额
CashBalanceWithInTransitcashBalanceWithInTransitdouble含在途资金的现金余额
EquityWithLoanequityWithLoandouble含贷款权益
NetLiquidationnetLiquidationdouble净清算价值
InitMargininitMargindouble初始保证金
MaintainMarginmaintainMargindouble维持保证金
TradeCurrencyMargintradeCurrencyMargindouble交易币种保证金
IntradayRiskRatiointradayRiskRatiodouble日内风险比率
GrossPositionValuegrossPositionValuedouble持仓总市值
OptionMarketValueoptionMarketValuedouble期权市值
StockMarketValuestockMarketValuedouble股票市值
CashAvailableForTradecashAvailableForTradedouble可交易现金
AvailableCashavailableCashdouble可用现金
LockedFundslockedFundsdouble锁定资金
LockedCashlockedCashdouble锁定现金
CreditLimitcreditLimitdouble信用额度
ExcessEquityexcessEquitydouble超额权益
ExcessLiquidityexcessLiquiditydouble超额流动性

频率限制

基础额度:每分钟 60 次。

获取持仓

操作名

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

请求

TigerRequest<PositionsResponse>

ModelValue: PositionsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
CurrencyCurrencycurrencyCLR 默认值;序列化时省略Optional—
SymbolstringsymbolnullRequired—
RightstringrightnullOptional—
StrikeDoublestrikeCLR 默认值;序列化时省略Optional—
ExpirystringexpirynullOptional—
AssetQuoteTypeAssetQuoteType?asset_quote_typenull;序列化时省略OptionalETH / RTH / OVERNIGHT;仅综合/模拟账户适用,见口径说明

返回

PositionsResponse 继承 TigerResponse;其 Data 为 PositionsItem。

示例

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

响应类型

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

Data 字段(PositionsItem)

字段API 字段C# 类型说明
ItemsitemsList<PositionDetail>持仓明细列表

每个 PositionDetail:

字段API 字段C# 类型说明
Accountaccountstring账户号
PositionQtypositionQtyDouble持仓数量
SalableQtysalableQtyDouble可卖数量
Positionpositionlong整数持仓数量
positionScalepositionScaleint持仓数量小数位数
AverageCostaverageCostDouble平均成本
AverageCostByAverageaverageCostByAverageDouble按平均价计算的平均成本
AverageCostOfCarryaverageCostOfCarryDouble持仓成本
MarketValuemarketValueDouble持仓市值
LatestPricelatestPriceDouble最新价
IsLevel0PriceisLevel0PriceBoolean是否为 Level 0 行情价格
RealizedPnlrealizedPnlDouble已实现盈亏
RealizedPnlByAveragerealizedPnlByAverageDouble按平均价计算的已实现盈亏
UnrealizedPnlunrealizedPnlDouble未实现盈亏
UnrealizedPnlByAverageunrealizedPnlByAverageDouble按平均价计算的未实现盈亏
UnrealizedPnlPercentunrealizedPnlPercentDouble未实现盈亏比例
UnrealizedPnlPercentByAverageunrealizedPnlPercentByAverageDouble按平均价计算的未实现盈亏比例
UnrealizedPnlByCostOfCarryunrealizedPnlByCostOfCarryDouble按持仓成本计算的未实现盈亏
UnrealizedPnlPercentByCostOfCarryunrealizedPnlPercentByCostOfCarryDouble按持仓成本计算的未实现盈亏比例
SecTypesecTypestring证券类型
Marketmarketstring所属市场
Currencycurrencystring计价币种
Identifieridentifierstring合约标识
Symbolsymbolstring合约代码
Expiryexpirystring到期日
StrikestrikeDouble行权价
Rightrightstring期权方向
MultipliermultiplierDouble合约乘数
UpdateTimestampupdateTimestamplong持仓更新时间戳
MmPercentmmPercentDouble维持保证金比例
MmValuemmValueDouble维持保证金金额
TodayPnltodayPnlDouble当日盈亏
TodayPnlPercenttodayPnlPercentDouble当日盈亏比例
YesterdayPnlyesterdayPnlDouble昨日盈亏,仅基金适用
LastClosePricelastClosePriceDouble上一交易日收盘价,已前复权
CategoriescategoriesList<string>合约分类列表

positionScale 是 SDK 中的精确小写属性名;SalableQty 对应的响应 JSON 字段为 salableQty。

返回示例

{
  "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为空时 TradeClient 从 TigerConfig.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 继承 TigerResponse;其 Data 为 TradableQuantityItem。

示例

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

Data 字段(TradableQuantityItem)

字段API 字段C# 类型说明
TradableQuantitytradableQuantityDouble现金账户可交易数量
FinancingQuantityfinancingQuantityDouble保证金账户可交易数量
PositionQuantitypositionQuantityDouble持仓数量
TradablePositionQuantitytradablePositionQuantityDouble持仓中可交易数量

频率限制

基础额度:每分钟 60 次。


Did this page help you?