Files
playbook/skills/tsl-api-reference/references/codegen/builtin/external/web.md
T
2026-07-29 07:58:05 +00:00

18 KiB
Raw Blame History

Builtin - 外部交互 / Web

TSWEB_HSGLastTradeDay_132(dtype, end_t)

声明:function

报表:WEB-股票.沪深港通持股明细的最新交易日(132)

参数 类型 说明
dtype any 用户自定义,南向 or 北向
end_t datetime 日期,截止日期

返回:array

TSWEB_HSGLastTradeDay_132Dtype(bkid)

声明:function

报表:WEB-南北向标识 "HG000001" 港股通(沪) "HG000003" 港股通(深) "HG000001;HG000003" 港股通 "HG000002" 沪股通 "HG000004" 深股通 "HG000002;HG000004" 陆股通

参数 类型 说明
bkid string 证券,板块ID

返回:any

TSWEB_FC_RemainingTerm_Average(fund_bk, end_t, r_date_n, sort_type, return_type)

声明:function

投资组合-剩余期限-平均剩余期限

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 用户自定义,报告期个数
sort_type bool object
return_type any 用户自定义,返回类型

返回:array

TSWEB_FC_BonusDistribution_DividendDetails(fund_bk, end_y)

声明:function

基金对比-分红送配-分红明细

参数 类型 说明
fund_bk string 字符串,基金板块
end_y any 整数,年份

返回:array

TSWEB_FC_HolderStructure_Details(fund_bk, r_date_n, sort_type, end_t, return_type)

声明:function

基金对比-持有人结构-持有人结构

参数 类型 说明
fund_bk string 字符串,基金板块
r_date_n any 用户自定义,报告期个数
sort_type bool object
end_t datetime 日期,截止日期
return_type any 用户自定义,返回类型

返回:array

TSWEB_FO_BonusDistribution_DividendOverview(fund_bk, beg_y, end_y)

声明:function

基金对比-分红送配-近10年分红概况

参数 类型 说明
fund_bk string 字符串,基金板块
beg_y any 整数,开始年度
end_y any 整数,截止年度

返回:array

TSWEB_FC_StockHoldDetails_Concentration(fund_bk, end_t, r_date_n, d_type, sort_type, return_type)

声明:function

投资组合-持股明细-持股集中度

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 用户自定义,报告个数
d_type any 用户自定义,数据类型
sort_type bool object
return_type any 用户自定义,返回类型

返回:array

TSWEB_FC_IndustryAllocation_IndustryData(fund_bk, end_t, r_date_n, ratio_type, is_ratio, sort_type, industry_type, return_type)

声明:function

投资组合-行业配置-行业配置-表

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 用户自定义,报告期个数
ratio_type any 用户自定义,占比(%)
is_ratio bool object
sort_type bool object
industry_type any 用户自定义,行业
return_type any 用户自定义,返回类型

返回:array

TSWEB_FC_IndustryAllocation_Concentration(fund_bk, end_t, r_date_n, ratio_type, is_ratio, sort_type, industry_type, return_type)

声明:function

投资组合-行业配置-行业集中度

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 整数,报告期个数
ratio_type any 用户自定义,占比(%)
is_ratio bool object
sort_type bool object
industry_type any 用户自定义,行业
return_type any 用户自定义,返回类型

返回:array

TSWEB_FC_ConcentrationArr(info_id, d_type)

声明:function

投资组合-集中度配置

参数 类型 说明
info_id string 整数,表ID
d_type any 用户自定义,数据类型

返回:array

TSWEB_FC_AssetAllocation_AssetData(fund_bk, end_t, r_date_n, ratio_type, is_ratio, sort_type, return_type)

声明:function

投资组合-资产配置-资产配置-表

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 用户自定义,报告期个数
ratio_type any 用户自定义,占比(%)
is_ratio bool object
sort_type bool object
return_type any 用户自定义,返回类型

返回:array

TSWEB_FC_AssetBackedSecurities_Concentration(fund_bk, end_t, r_date_n, d_type, sort_type, return_type)

声明:function

投资组合-资产支持证券-资产支持证券集中度

参数 类型 说明
fund_bk string 字符串,基金板块
end_t datetime 日期,截止日期
r_date_n any 用户自定义,报告期个数
d_type any 用户自定义,数据类型
sort_type bool object
return_type any 用户自定义,返回类型

返回:array

TSWEB_FM_IndexType()

声明:function

指数类型 指数类型: "增强指数型","被动指数型"

返回:array

TSWEB_FAS_Managers_PositionStyleData(fund_bk, rdate)

声明:function

基金总览-基金经理-规模统计数据

参数 类型 说明
fund_bk string 字符串,基金板块
rdate datetime 报告期,报告期

返回:array

TSWEB_Block_VarietyBasicInformation(bk_name, end_t)

声明:function

期权对比-基本信息-品种基本信息

参数 类型 说明
bk_name string 用户自定义,板块名称
end_t datetime 日期,截止日期

返回:array

TSWEB_OptionsZLId(pzid, end_t, day_type, n)

声明:function

期权主力合约

参数 类型 说明
pzid string 字符串,期权品种代码
end_t datetime 日期,截止日期
day_type any 用户自定义,日期推算类型
n any 整数,N日

返回:array

TSWEB_OWL_TradeDetailEndT(index_id, end_t)

声明:function

期权分析-龙虎榜-指定日明细-成交

参数 类型 说明
index_id string 指数,期权品种
end_t datetime 日期,截止日期

返回:array

TSWEB_OWL_HoldDetailEndT(index_id, end_t)

声明:function

期权分析-龙虎榜-指定日明细-持仓

参数 类型 说明
index_id string 指数,期权品种
end_t datetime 日期,截止日期

返回:array

TSWEB_Future_MarketQuotationsWRDailyStatisticsOfSDCE(varieties_id, begt, endt)

声明:function

仓单日报-大商所-每日统计

参数 类型 说明
varieties_id string 字符串,品种代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:array

TSWEB_Future_MarketQuotationsWRDailyStatisticsOfGZFE(varieties_id, begt, endt)

声明:function

仓单日报-广期所-每日统计

参数 类型 说明
varieties_id string 证券,品种代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:array

TSWEB_Future_MarketQuotationsWRDailyStatisticsOfSHFE(varieties_id, begt, endt)

声明:function

仓单日报-上期所-每日统计

参数 类型 说明
varieties_id string 证券,品种代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:array

TSWEB_Future_MarketQuotationsWRDailyStatisticsOfCZCE(varieties_id, begt, endt)

声明:function

仓单日报-上期所-每日统计

参数 类型 说明
varieties_id string 证券,品种代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:array

TSWEB_FBlock_DealsandPositionConSum(variety_id, end_t)

声明:function

期货对比-龙虎榜-合约统计-合约汇总-成交与持仓

参数 类型 说明
variety_id string 证券,期货品种
end_t datetime 日期,截止日期

返回:array

TSWEB_FBlock_DealsandPositionInsSum(variety_id, end_t)

声明:function

期货对比-龙虎榜-机构统计-机构汇总-成交与持仓 注:2020年1月1日开始,除中金所外,所有商品期货行情的成交量、持仓量都为单边计算,之前是双边计算 中金所一直是单边计算

参数 类型 说明
variety_id string 证券,期货品种
end_t datetime 日期,截止日期

返回:array

TSWEB_GetHQinfo(qharr, endt, expr)

声明:function

获取单个期货指定合约数组的单边总成交/总持仓 注:2020年1月1日开始,除中金所外,所有商品期货行情的成交量、持仓量都为单边计算,之前是双边计算 中金所一直是单边计算

参数 类型 说明
qharr array 一维字符串数组,合约数组
endt datetime 日期,截止日期
expr any 表达式,表达式

返回:array

TSWEB_GetQHArrTradeRankingByDate(qharr, endt)

声明:function

获取指定合约数组的指定日期货成交持仓排名

参数 类型 说明
qharr array 一维字符串数组,合约数组
endt datetime 日期,截止日期

返回:array

TSWEB_TransInstitution(str)

声明:function

机构简称规范化

参数 类型 说明
str string 字符串,机构

返回:array

TSWEB_Future_DealsandPositionList(future_id, end_t)

声明:function

期货分析-龙虎榜-龙虎榜单-成交与持仓 注:2020年1月1日开始,除中金所外,所有商品期货行情的成交量、持仓量都为单边计算,之前是双边计算 中金所一直是单边计算

参数 类型 说明
future_id string 证券,合约代码
end_t datetime 日期,截止日期

返回:array

TSWEB_Stock_PurchasingManagerIndex(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_PurchasingManagerIndex 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_IndustrialAddedValueGrowth(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_IndustrialAddedValueGrowth 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_FixedInvestmentAssetsEF(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_FixedInvestmentAssetsEF 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_GrossDomesticProduct(stockid, begt, endt, month)

声明:function

TSWEB_Stock_GrossDomesticProduct 相关函数。

参数 类型 说明
stockid string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_TotalRetail(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_TotalRetail 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_IndustrialProducerPriceIndex(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_IndustrialProducerPriceIndex 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_ForeignExchangeAndGoldReserves(stock_id, begt, endt, month)

声明:function

TSWEB_Stock_ForeignExchangeAndGoldReserves 相关函数。

参数 类型 说明
stock_id string 证券,证券代码
begt datetime 日期,开始日期
endt datetime 日期,截止日期
month any 用户自定义,报告类型

返回:any

TSWEB_Stock_LatestBenchmarkLoanInterestRate(begt, endt)

声明:function

TSWEB_Stock_LatestBenchmarkLoanInterestRate 相关函数。

参数 类型 说明
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:any

TSWEB_Stock_LatestBenchmarkDepositInterestRate(begt, endt)

声明:function

TSWEB_Stock_LatestBenchmarkDepositInterestRate 相关函数。

参数 类型 说明
begt datetime 日期,开始日期
endt datetime 日期,截止日期

返回:any

fSess()

声明:function

整型,会话IDhttp Session ID,创建对象时产生,并设置成了分段输出模式。

返回:any

fStream()

声明:function

字符串,接收到的转发数据内容

返回:any

fRetry()

声明:function

整型,毫秒数;连接中断后,重连请求之间的等待时间间隔

返回:any

fLastId()

声明:function

整型,最后一次记录的事件ID,用于重连

返回:any

fOpsId()

声明:function

字符串,TS-OPS服务id

返回:any

fAsyncResults()

声明:function

数组,用于存放事件处理结果

返回:any

fDataUrl()

声明:function

字符串,TS-OPS服务数据上传地址

返回:any

web_metric_TranValuesWithGroup(metric_values, metric_group_define)

声明:function

将扁平指标值,按指标分组定义,自动转换为标准指标分组字典结构 输入 指标分组定义格式(业务:分组+指标名称): array( '核心收益风险': ( '组合累计(%)', '最大回撤(%)', '夏普', '年化收益(%)', '卡玛比率' ), '日间表现': ( '日胜率(%)', '日胜率(%)(不亏)', '日极端(%)' ) ); 输入 指标值格式: metricValues['组合累计(%)'] := 12.34; metricValues['最大回撤(%)'] := -5.67; 输出 指标分组结构(Group 分组结构): array( '核心收益风险': ( '组合累计(%)': 12.34, '最大回撤(%)': -5.67 ), '日间表现': ( ... ) );

参数 类型 说明
metric_values array 一维字符串数组,指标值列表
metric_group_define array 一维字符串数组,分组定义

返回:string