# 金融 / 股票 / 证券交易时间 / 中间函数 ## `stockAuctionEndTime(auction_type, time_type, r_type)` 声明:function 返回指定日指定竞价性质的交易时间,与系统参数(证券代码,日期)相关 | 参数 | 类型 | 说明 | | -------------- | ---- | ------------------------------------- | | `auction_type` | int | 用户自定义。竞价性质,取值如下: | | `time_type` | int | 用户自定义。时间性质,取值如下: | | `r_type` | int | 用户自定义。返回的数据格式,取值如下: | 返回:string ### 示例 范例01:调用函数 ```tsl SetSysParam(pn_stock(), "bc2401"); SetSysParam(PN_Date(), 20231215T); return StockAuctionEndTime(3, 0, 0); ``` ## `stockTradeDate(ttype)` 声明:function 返回指定时间点属于的交易日,与系统参数(证券代码、时间)相关。 判定规则:日盘,日盘交易时间和期间休盘时间点返回所属交易日; 夜盘,夜盘交易时间返回所属交易日; 其余时间点,返回为0 | 参数 | 类型 | 说明 | | ------- | ---- | -------------------------------------------- | | `ttype` | int | 整数。是否考虑集合竞价时段。0:不考虑;1:考虑 | 返回:float ### 示例 范例01:调用函数 ```tsl SetSysParam(pn_stock(), "bc2401"); SetSysParam(PN_Date(), 20231216.0030T); return StockTradeDate(0); ``` ## `stockTradeDateByEndT2(ttype)` 声明:function 返回指定日期证券的交易时段,与系统参数(证券代码、时间)相关 | 参数 | 类型 | 说明 | | ------- | ---- | -------------------------- | | `ttype` | int | 整数,是否考虑集合竞价时段 | 返回:array ### 示例 范例01:调用函数 ```tsl SetSysParam(pn_stock(), "SZ000002"); SetSysParam(PN_Date(), 20231218T); return StockTradeDateByEndT2(0); ``` ## `stockTradingTimesHistory()` 声明:function 返回证券历史交易时间,与系统参数(证券代码)相关 返回:array ### 示例 范例01:调用函数 ```tsl SetSysParam(pn_stock(), "bc2401"); return StockTradingTimesHistory(); ```