Files
playbook/skills/tsl-api-reference/references/codegen/dotnet/equity/trading_calendar.md
T
csh e1f7ce052c feat(skills): add tsl api reference skill
Bundle the TSL API index and markdown references under the skill, route TSL docs to use it, and update the codegen index generator to maintain the bundled data.
2026-07-07 16:36:15 +08:00

8.1 KiB

股票 / 证券交易时间

stockauctionclosespantrading(auctiontype)

离指定交易时段截止时间的时长(交易分钟),与系统参数(证券代码,日期))相关

参数 类型 说明
auctiontype int 整型,竞价性质,取值如下:

返回:int

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.0900T);
return StockAuctionCloseSpanTrading(3);

stockAuctionEndTime(auction_type, time_type, r_type)

指定日指定竞价性质的交易时间,与系统参数(证券代码,日期)相关。

参数 类型 说明
auction_type int 用户自定义。竞价性质,取值如下:
time_type int 用户自定义。时间性质,取值如下:
r_type int 用户自定义。返回的数据格式,取值如下:

返回:string

示例

SetSysParam(pn_stock(),"bc2401");
SetSysParam(PN_Date(),20231215T);
return StockAuctionEndTime(3,0,0);

stockauctionopenspannatural(auctiontype)

离指定交易时段开始时间的时长(自然分钟),与系统参数(证券代码,日期)相关

参数 类型 说明
auctiontype int 整型,竞价性质,取值如下:

返回:int

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.0900T);
return StockAuctionOpenSpanNatural(2);

stockauctionopenspantrading(auctiontype)

离指定交易时段开始时间的时长(交易分钟),与系统参数(证券代码,日期)相关 注意:交易分钟线是,指定竞价时间点 到 endt的交易分钟线

参数 类型 说明
auctiontype int 整型,竞价类型,取值如下:

返回:int

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.2200T);
return StockAuctionOpenSpanTrading(2);

stockauctiontime(auctiontype, timetype)

竞价性质的交易时间,与系统参数(证券代码,日期)相关

参数 类型 说明
auctiontype int 整型,竞价性质,取值如下:
timetype int 整型,时间性质,开始时间=0,截止时间=1

返回:string

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockAuctionTime(2,0);

stockauctiontimelong(auctiontype)

竞价性质的交易时长(分钟),与系统参数(证券代码,日期)相关

参数 类型 说明
auctiontype int 整型,竞价性质,取值如下:

返回:int

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockAuctionTimeLong(2);

stockcontinuousauctiontime()

指定日连续竞价时长(分钟),与系统参数(证券代码,日期)相关

返回:int

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockContinuousAuctionTime();

stockisclosecallauction()

是否有收盘集合竞价,与系统参数(证券代码,日期)相关

返回:bool

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockIsCloseCallAuction();

stockisnightopening()

是否有夜盘,与系统参数(证券代码,日期)相关

返回:bool

示例

检查CU2109是否有夜盘
setsysparam(pn_stock(),"CU2109");
setsysparam(pn_stock(),20201020T);
return StockIsNightOpening();

stockisopencallauction()

是否有开盘集合竞价,与系统参数(证券代码,日期)相关

返回:bool

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockIsOpenCallAuction();

stockistradingtime()

是否为交易时间点,与系统参数(证券代码,日期)相关

返回:bool

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.2200T);
return StockIsTradingTime();

stocknextauctionopenspannatural(auctiontype)

离指定交易时段开始时间的时长(未来、自然分钟),与系统参数(证券代码,日期))相关

参数 类型 说明
auctiontype int 整型,竞价性质,取值如下:

返回:float

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.0900T);
return StockNextAuctionOpenSpanNatural(4);

stocknightopeningdate()

指定品种夜盘开始日,与系统参数(证券代码,日期)相关

返回:int

示例

计算CU的夜盘开始日
setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockNightOpeningDate();

stockopenspantrading()

已开盘时长(交易分钟),与系统参数(证券代码,日期)相关

返回:float

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020.2300T);
return StockOpenSpanTrading();

stockTradeDate(ttype)

指定时间点属于的交易日,与系统参数(证券代码、时间)相关。 判定规则:日盘,日盘交易时间和期间休盘时间点返回所属交易日; 夜盘,夜盘交易时间返回所属交易日; 其余时间点,返回为0。

参数 类型 说明
ttype int 整数。是否考虑集合竞价时段。0:不考虑;1:考虑

返回:float

示例

SetSysParam(pn_stock(),"bc2401");
SetSysParam(PN_Date(),20231216.0030T);
return StockTradeDate(0);

stockTradeDateByEndT(_type)

指定日期的交易时段,与日期相关与时间点无关,与系统参数证券代码、日期相关。

参数 类型 说明
_type int Int 是否考虑集合竞价时段 0:不考虑,1:考虑

返回:array

示例

SetSysParam(pn_stock(),"a2107");
SetSysParam(PN_Date(),20210513T);
return StockTradeDateByEndT(1);

stockTradeDateByEndT2(ttype)

指定日期证券的交易时段,与系统参数(证券代码、时间)相关。

参数 类型 说明
ttype int 整数,是否考虑集合竞价时段

返回:array

示例

SetSysParam(pn_stock(),"SZ000002");
SetSysParam(PN_Date(),20231218T);
return StockTradeDateByEndT2(0);

stocktradingnumberchange()

证券代码对应的交易时间代码,与系统参数(证券代码)相关 各品种代码对照: 大类 取数代码 上交所股票、指数 SH000001 上交所基金 SH000011 上交所债券 SH000012 上交所债券回购 SH204001 上交所期权 OP10000001 深交所股票、指数 SZ399106 深交所基金 SZ399103 深交所债券 SZ399481 深交所债券回购 SZ131810 深交所期权 OP90000001 中证指数 CSI000001 申万指数 SW801003 港股通 HKHSI001 跨市场指数(跨香港交易所) CSICES300 商品期货/股指期货/国债期货 品种代码 商品期权/股指期权 OP+品种代码

返回:string

示例

将CU2109转化为取数代码
setsysparam(pn_stock(),"CU2109");
return StockTradingNumberChange();

stocktradingtimes()

证券最近的交易时间序列,与系统参数(证券代码,日期)相关

返回:array

示例

setsysparam(pn_stock(),"CU2109");
setsysparam(pn_date(),20201020T);
return StockTradingTimes();

stockTradingTimesHistory()

证券历史交易时间,与系统参数(证券代码)相关。

返回:array

示例

SetSysParam(pn_stock(),"bc2401");
return StockTradingTimesHistory();