Files
playbook/docs/tsl/codegen/dotnet/datawarehouse/pending_migrated.md
T

125 KiB
Raw Blame History

数据仓库函数 - 未细分函数

函数

marketId(stock_id, day)

获得证券的所属市场ID。

参数 类型 说明
stock_id string 证券代码。
day datetime 可选参数,缺省表示获得当前的所属市场ID,否则就可以获得历史指定时间的市场ID。

返回:any

marketInfo(id, info_id)

获得市场的相关信息。

参数 类型 说明
id any 市场编码。证券的市场编码可以用MarketID函数获得。
info_id string 可选参数,缺省返回所有如下市场信息。

返回:array

marketOpenCloseTime(id, day)

取得指定市场在指定日的理论开盘时间以及收盘时间。即便由于长假原因导致夜盘不开盘,也会存在理论的夜盘开盘时间。

参数 类型 说明
id any 市场编码。
day datetime 指定的日期。

返回:array

tsPeriod(stock_id, cycle, date)

返回指定证券指定日期的指定周期时间序列。如有夜盘,包含昨日夜盘数据。

参数 类型 说明
stock_id string 字符串,证券代码,支持所有类型证券(包括已退市)
cycle string 秒线和分钟线级别周期,支持半秒线和自由周期
date datetime 日期或日期时间,任意自然日。自由周期下,支持传入具体时间作为自由周期基准时间点。

返回:array

spTime(get_set_time)

取得当前环境的时间,不是真正的现在的时间。与系统变量(股票pn_stock()、时间pn_date()、周期pn_cycle()相关)。

参数 类型 说明
get_set_time datetime 整数,获取时间的类型,可缺省,默认为方式0,可取值如下:

返回:datetime

tradeDays(begin_date, end_date)

得到当前股票在两个日期间的交易日数目。如果参数BeginDate和参数EndDate是同一天而且有交易则为1,如果之间无交易日则为0。 该模型与股票、周期相关。获取开始时间到截止时间的交易日(周期)数。

参数 类型 说明
begin_date datetime TDateTime类型,开始时间
end_date datetime TDateTime类型,结束时间

返回:any

isTradeDay(date)

如果当前股票在Date指定日交易则返回1,否则返回0。 该函数的判断是依据指定日是否有日线行情数据,不管当日是否有成交量。 比如期货不活跃时,当日可能没有成交量,但是也有行情数据,则判断当日也是交易日。 一般用于判断当前股票在指定日是否停牌。 支持周期:日线及更低频,比如周线、月线等。若是周线,则判断这一周内是否有日线数据,若有则为真,若一条都没有则为假。即,不支持高频的判定。

参数 类型 说明
date datetime 日期类型,日期;

返回:bool

isValidCode(id, full_id)

判断是否为合法的代码。判断是否合法代码的规则与isstock类似。如果ID是合法的代码,FullID返回的值为标准化后的天软代码,否则为0。

参数 类型 说明
id string 字符串,证券代码;
full_id string 字符串,标准化后的证券代码,可省略;

返回:bool

isCashFlowInfoId(infold)

判断是否是现金流量表指标,如果是则返回1,否则返回0。

参数 类型 说明
infold any 基本面,基本面ID

返回:bool

isMainReportId(infold)

判断是否是主要报告指标,如果是返回1,否则返回0。指标包括资产负债表,利润分配表,现金流量表,基金资产负债表,基金利润分配表,股票财务指标。

参数 类型 说明
infold any 基本面,基本面ID

返回:bool

analyseStockArr(b_kname, stocks)

板块BKname序列添加股票Stocks。

参数 类型 说明
b_kname string 市场和板块,板块名称
stocks array 字符串,证券代码,证券代码间以分号分隔,如 ID1;ID2;ID3...

返回:any

isBalanceInfoId(infold)

是否是资产负债表指标。是则返回1,否则返回0。

参数 类型 说明
infold any 基本面,基本面ID

返回:bool

isInterestInfoId(infold)

是否是利润分配表指标。是则返回1,否则返回0。

参数 类型 说明
infold any 基本面,基本面ID

返回:bool

isFundBalanceSheetInfoId(infold)

是否是基金资产负债表字段。是则返回1,否则返回0。

参数 类型 说明
infold any 整数

返回:bool

isFundInterestInfoId(infold)

是否是基金利润分配表表字段。是则返回1,否则返回0。

参数 类型 说明
infold any 整数

返回:bool

isStockFinancialItem(infold)

是否是股票财务指标。是则返回1,否则返回0。

参数 类型 说明
infold any 整数

返回:bool

isFinancialInfoId(info_id)

是否是主要财务指标(仅Wind适用),兼容Wind的主要财务指标也计算最近12个月的数据。

参数 类型 说明
info_id string 整数。基本面Id

返回:bool

rd(id)

取得实时数据,就是当前最近的数据,主要用于盘中分析,委托5-10为LEVEL2行情专用。该函数与当前时间,当前周期无关,只与当前证券代码有关。

参数 类型 说明
id any 整数,含义如下:

返回:datetime|void

sectionSubmitBuyVol()

当天截止累计委买量,与系统参数(股票、时间、周期、复权等相关),查看相关行情数据说明

返回:float

spStd(exp, n, cache_string)

估算N天的TExpression的标准差。TExpression是与时间序列数据相关的函数或表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算标准差。

参数 类型 说明
exp any TExpression表达式
n any 整数,交易日天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spStdp(exp, n, cache_string)

估算N天的TExpression的总体标准差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的EXP的值计算总体标准差

参数 类型 说明
exp any TExpression表达式
n any 整数,天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spVar(exp, n, cache_string)

估算N天的TExpression的样本方差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算样本方差

参数 类型 说明
exp any TExpression表达式
n any 整数,天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spVarp(exp, n, cache_string)

估算N天的TExpression的总体样本方差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算总体样本方差

参数 类型 说明
exp any TExpression表达式
n any 整数,天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spAvedev(exp, n, cache_string)

估算N天的TExpression的平均绝对偏差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算平均绝对偏差

参数 类型 说明
exp any TExpression表达式
n any 整数,天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spDevsq(exp, n, cache_string)

估算N天的TExpression的偏差平方和。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算偏差平方和

参数 类型 说明
exp any TExpression表达式
n any 整数,天数;N为-1,0时无效。
cache_string string 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速

返回:float

spLarge(exp, m, n)

移动最大排位值。指定表达式最近N天中的第M个最大值

参数 类型 说明
exp any 指定表达式,和系统当前时间有关
m any 最大值位数
n any 交易日天数

返回:float

spSmall(exp, m, n)

移动最小排位值。指标数据最近N个交易日的第M个最小值

参数 类型 说明
exp any 表达式
m any 对应的最小值位数
n any 交易日天数;备注:指定表达式与系统当前时间相关,M的取值数据小于N.

返回:float

spPercentile(exp, m, n)

移动百分位数。表达式最近N个交易日第M个百分比对应的数据

参数 类型 说明
exp any 表达式
m float 百分比,0~1之间
n any 交易日天数

返回:float

spPercentrank(exp1, exp2, n)

移动百分比排名。指标数据的当前数据在最近N个交易日中的百分比排名

参数 类型 说明
exp1 any 表达式,N个交易日的表达式
exp2 any 表达式,当前值的表达式
n any 交易日天数

返回:float

spQuartile(exp, m, n)

移动四分位数。表达式最近N个交易日集中四分位对应的数据

参数 类型 说明
exp any 表达式
m any 四分位值,0~4的整数
n any 交易日天数

返回:float

spRank(exp, n)

移动排名。表达式当前数据在最近N个交易日的排名(从大到小)

参数 类型 说明
exp any 表达式
n any 交易日天数

返回:array

spTrimmean(exp, m, n)

移动去首尾平均值。表达式最近N个交易日去掉首尾百分比后的平均值

参数 类型 说明
exp any 表达式
m any 百分比数,0~1之间
n any 交易日天数

返回:float

spFrequency(exp, m, n)

移动频数。表达式最近N个交易日的频数

参数 类型 说明
exp any 表达式
m array 指标数据分布区域,一维数组
n any 交易日天数

返回:array

spGeoMean(exp, n)

移动几何平均数。表达式前N个交易日的几何平均数

参数 类型 说明
exp any 表达式
n any 交易日天数

返回:float

spHarMean(exp, n)

移动调和平均数。表达式前N个交易日的调和平均数

参数 类型 说明
exp any 表达式
n any 交易日天数

返回:float

spMedian(exp, n)

移动中位数,表达式前N个交易日的中位数

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spMode(exp, n)

移动众数。表达式数据前N个交易日的众数

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spProduct(exp, n)

移动累乘。表达式数据前N个交易日的累乘值

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spTotalVariance(exp, n)

移动总体偏差。表达式数据最近N个交易日的离差平方和(总体偏差)

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spNorm(exp, n)

移动平方和的平方根。表达式数据最近N个交易日的平方和的平方根

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spSkewness(exp, n)

移动偏度(Excel兼容)。表达式数据最近N个交易日的偏度,算法与excel兼容

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spKurtosis(exp, n)

移动峰度(Excel兼容)。表达式数据最近N个交易日的峰度,算法与excel兼容

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spSkewness2(exp, n)

移动偏度(Matlab兼容)。表达式数据最近N个交易日的偏度,算法与matlab兼容

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spKurtosis2(exp, n)

移动峰度(Matlab兼容)。表达式最近N个交易日的峰度,算法与matlab兼容

参数 类型 说明
exp any 表达式
n any 天数

返回:float

spCov(exp1, exp2, n)

移动协方差。两个表达式在最近N个交易日的协方差

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spCorrel(exp1, exp2, n)

移动相关系数。两个表达式正在最近N个交易日的相关系数

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spSlope(exp1, exp2, n)

移动回归斜率。两个表达式在最近N个交易日的回归斜率

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spIntercept(exp1, exp2, n)

移动回归截距。两个表达式在最近N个交易日的回归截距

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spRsq(exp1, exp2, n)

移动相关系数平方。两个表达式最近N个交易日的Pearson乘积矩相关系数的平方

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spSteyx(exp1, exp2, n)

移动标准误差。两个表达式最近N个交易日的相对标准偏差

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:float

spSlopeAndIntercept(exp1, exp2, n)

移动回归斜率和截距。两个表达式最近N个交易日的回归斜率和截距

参数 类型 说明
exp1 any 表达式1,与系统当前日期相关
exp2 any 表达式2,与系统当前日期相关
n any 天数

返回:array

toverData(date)

取得某日的成交明细数据。返回的数据是一张表。不给参数,则返回当前时间的交易明细数据。 数据如下: 字段名字段含义字段类型 time日期时间TDateTime price成交价格Real amount成交金额Real vol成交量Real glb量比Real buy1买一价Real buy2买二价Real buy3买三价Real buy4买四价Real buy5买五价Real sale1卖一价Real sale2卖二价Real sale3卖三价Real sale4卖四价Real sale5卖五价Real bc1买一量Integer bc2买二量Integer bc3买三量Integer bc4买四量Integer bc5买五量Integer sc1卖一量Integer sc2卖二量Integer sc3卖三量Integer sc4卖四量Integer sc5卖五量Integer syl1市盈率1Real syl2市盈率2Real tradecnt交易笔数Integer

参数 类型 说明
date datetime 日期,可省略。

返回:array

toverDataEx(fields, date, trade_flag, start_time, end_time, min_vol, min_amount, min_price, max_vol, max_amount, max_price, mmp_flag, vol_amount_or)

返回满足条件的某日的成交明细数据。返回的数据是一张表。 数据如下: 字段名 字段含义 字段类型 time 日期时间 TDateTime price 成交价格 Real amount 成交金额 Real vol 成交量 Real Buy1 买一价 Real Buy2 买二价 Real Buy3 买三价 Real Buy4 买四价 Real Buy5 买五价 Real Sale1 卖一价 Real Sale2 卖二价 Real Sale3 卖三价 Real Sale4 卖四价 Real Sale5 卖五价 Real Bc1 买一量 Integer Bc2 买二量 Integer Bc3 买三量 Integer Bc4 买四量 Integer Bc5 买五量 Integer SC1 卖一量 Integer SC2 卖二量 Integer SC3 卖三量 Integer SC4 卖四量 Integer SC5 卖五量 Integer syl1 市盈率1 Real syl2 市盈率2 Real tradecnt 交易笔数 Integer

参数 类型 说明
fields array 一般用0,表示返回所有的字段。参见交易明细字段标识函数。
date datetime 日期,成交明细的所在日期。
trade_flag any 整数,交易主买/主卖条件(0,全部,1主买,2主卖,3中性,4主买+中性,5主卖+中性)。
start_time datetime 时间,开始时间(不包含日期)
end_time datetime 时间,截止时间(不包含日期)
min_vol any 整数,最低的交易量
min_amount float 实数,最低的交易金额
min_price float 实数,最低的价格
max_vol any 整数,最高的交易量
max_amount float 实数,最低的交易金额
max_price float 实数,最高的价格
mmp_flag any 整数,是否考虑买卖盘。0不考虑,1考虑买,2考虑卖,3考虑买盘和卖盘
vol_amount_or bool object

返回:array

td(id)

返回当前时间指定的交易明细数据。必须设置当前周期为小于日线的高频周期。

参数 类型 说明
id any 整数,字段标识

返回:any

tdByIndex(id, n)

第N个交易明细

参数 类型 说明
id any 数,提取数据标识
n any 整数,交易点位置,0表示第一个交易点,-1表示最后一个交易点。

返回:any

tdCountEx(date, trade_flag, start_time, end_time, min_vol, min_amount, min_price, max_vol, max_amount, max_price, mmp_flag, vol_amount_or)

返回满足条件的某日的交易点个数。

参数 类型 说明
date datetime 日期,成交明细的所在日期。
trade_flag any 整数,交易主买/主卖条件(0,全部,1主买,2主卖,3中性,4主买+中性,5主卖+中性)。
start_time datetime 时间,开始时间
end_time datetime 时间,截止时间
min_vol float 整数,最低的交易量
min_amount float 实数,最低的交易金额
min_price float 实数,最低的价格
max_vol float 整数,最高的交易量
max_amount float 实数,最低的交易金额
max_price float 实数,最高的价格
mmp_flag any 整数,是否考虑买卖盘。0不考虑,1考虑买,2考虑卖,3考虑买盘和卖盘
vol_amount_or bool object

返回:any

tdInfoByIndex(n)

取得某一交易点的成交明细数据。返回的数据是一维字符串下标表。 数据如下: 字段名字段含义字段类型 time日期时间TDateTime price成交价格Real amount成交金额Real vol成交量Real glb量比Real buy1买一价Real buy2买二价Real buy3买三价Real buy4买四价Real buy5买五价Real sale1卖一价Real sale2卖二价Real sale3卖三价Real sale4卖四价Real sale5卖五价Real bc1买一量Integer bc2买二量Integer bc3买三量Integer bc4买四量Integer bc5买五量Integer sc1卖一量Integer sc2卖二量Integer sc3卖三量Integer sc4卖四量Integer sc5卖五量Integer syl1市盈率1Real syl2市盈率2Real tradecnt交易笔数Integer

参数 类型 说明
n any 整数,交易点位置,0表示第一个交易点,-1表示最后一个交易点。

返回:string

tdSum(sum_vol, sum_amount, date, trade_flag, start_time, end_time, min_vol, min_amount, min_price, max_vol, max_amount, max_price, mmp_flag, vol_amount_or)

成交明细数据统计。

参数 类型 说明
sum_vol float 整数,返回的成交量和
sum_amount float 实数,返回的成交金额和
date datetime 日期,成交明细的所在日期。
trade_flag any 整数,交易主买/主卖条件(0,全部,1主买,2主卖,3中性,4主买+中性,5主卖+中性)。
start_time datetime 时间,开始时间
end_time datetime 时间,截止时间
min_vol float 整数,最低的交易量
min_amount float 实数,最低的交易金额
min_price float 实数,最低的价格
max_vol float 整数,最高的交易量
max_amount float 实数,最低的交易金额
max_price float 实数,最高的价格
mmp_flag any 整数,是否考虑买卖盘。0不考虑,1考虑买,2考虑卖,3考虑买盘和卖盘
vol_amount_or bool object

返回:void

getBk(marketlist)

得到指定的市场板块列表包含的股票列表。 注意,获取的是最新的板块成分股,行业名称或者板块名称,而非指数代码。 这些板块或行业名称必须和板块管理中的名称一致。 如果用户需要获取指定日期的历史成分股,请参考GetBKByDate。

参数 类型 说明
marketlist string 字符串,市场板块列表。多个市场板块之间用分号分格

返回:array

getUserBkList(bktype)

得到所有的或者指定的板块类别下的用户板块的名称列表。

参数 类型 说明
bktype string string 可选参数,无参数时得到所有的板块列表,;否则参数可为:'地域'或者'行业'分别得到地域板块列表或者行业板块列表。如果有多级目录,用\进行目录分级。

返回:array

getBkList(type)

得到所有的或者指定的系统板块类别下的板块名称列表。板块类别用户可查看板块管理中的类别。

参数 类型 说明
type string 字符串,板块类别,即具体板块的目录名称;无参数时得到所有的板块列表。

返回:array

getUserBkList2(bktype)

得到所有的或者指定的板块类别下用户板块的名称列表以及板块所在路径名。 注意,除了结果类型与GetUserBKList不同以外,此函数得到指定板块类别下以及子路径下的所有的板块。

参数 类型 说明
bktype string string 可选参数,无参数时得到所有的板块列表,;否则参数可为:'地域'或者'行业'分别得到地域板块列表或者行业板块列表。如果有多级目录,用\进行目录分级。

返回:array

getBkList2(bktype)

得到所有的或者指定的系统板块类别下的板块名称列表以及板块所在路径名。 注意:除了结果类型与GetUserBKList不同以外,此函数得到指定板块类别下以及子路径下的所有的板块。

参数 类型 说明
bktype string string 可选参数,无参数时得到所有的板块列表,;否则参数可为:'地域'或者'行业'分别得到地域板块列表或者行业板块列表。

返回:array

spS(name, value)

设置Name指定的系统参数的值为Value。如果设置不成功返回假否则返回真。系统参数为全局变量,即该函数设置的变量全局有效。也可以自定义参数。功能同sp_setsysparam

参数 类型 说明
name string 字符串类型的系统参数名。
value any 设置的系统参数的值。

返回:bool

spG(name)

返回Name指定的系统参数。功能同getsysparam。

参数 类型 说明
name string 字符串类型的系统参数名

返回:any

pnCalcCtrlWord(return_value)

系统参数常量"CalcCTRLWord" 控制nil参与计算以及浮点除0的警告或者出错

参数 类型 说明
return_value string 返回字符串"CalcCTRLWord"

返回:string

cyFreeCycle(n)

指定秒数的自由滚动周期

参数 类型 说明
n any 整数,指定的滚动秒数。

返回:any

cyTrailingSeconds(n)

指定秒数的自由滚动周期

参数 类型 说明
n any 整数,指定的滚动秒数,秒数应超过4*3600也就是4个小时以内。

返回:string

cyTrailingDays(n)

指定交易日数的自由滚动周期

参数 类型 说明
n any 整数,指定的滚动交易日数。

返回:string

yearsBetween2(a_now, a_then)

对年数:明年的今天(不包括)算一个完整年度,即一个对年。

参数 类型 说明
a_now datetime 日期,
a_then datetime 日期,

返回:float

monthsBetween2(a_now, a_then)

对月数:今天到下个月的今天(不包括)算一个完整月度,即一个对月。

参数 类型 说明
a_now datetime 日期,
a_then datetime 日期,

返回:float

report(info_id, report_id)

返回某个报告期ReportID的某项财务指标或其他信息的值。函数可提取与报告期相关的基础财务数据。 该模型与当前的时间有关。因为财务数据有调整前调整后的数据,提取该数据的时候,要注意设置当前的时间。如果要取调整前的数据,当前的日期,要设置在调整后数据公布日之前。 比如股票A,2011年的年报是2012年4月15日公布,2012年年报是2013年4月15日公布,2012年年报披露的时候,同时会披露2011年年报调整后的数据。 当前的时间pn_date()设置在2013年4月15日之前的时候,取到的2011年年报数据就是调整前的数据,否则,取到的是2011年调整后的数据。

参数 类型 说明
info_id string 整数,信息类别代码,即财务指标和其他信息的ID,可以通过证券数据专家或基本面信息(F11)查询。
report_id string 整数报告期,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报,0331第一季度,0930第三季度。如20170930;0001为自然周第一周周报,0002为第二周,以此类推。以周为报告期的日期,主要用于提取封闭式基金的净值数据。如20170001

返回:any

reportOfAll(info_id, report_id)

返回某个报告期ReportID的某项财务指标的值,即可提取与报告期相关的数据。 与Report函数相比,ReportOfAll函数功能更为强大,除了获取与报告期相关的直接从报告中采集并入库的基础财务数据,还可以取根据基础财务数据实时计算的指标。实时计算指标的InfoID分布为9900000- 9902239,用户可以通过证券数据专家或基本面信息查询,也可查看FAQ:证券数据专家中提供的基础数据现状 该模型与当前的时间有关。因为财务数据有调整前调整后的数据,提取该数据的时候,要注意设置当前的时间。如果要取调整前的数据,当前的日期,要设置在调整后数据公布日之前。 比如股票A,2011年的年报是2012年4月15日公布,2012年年报是2013年4月15日公布,2012年年报披露的时候,同时会披露2011年年报调整后的数据。 当前的时间pn_date()设置在2013年4月15日之前的时候,取到的2011年年报数据就是调整前的数据,否则,取到的是2011年调整后的数据。

参数 类型 说明
info_id string 整数,信息类别代码,即财务指标和其他信息的ID,可以通过证券数据专家或基本面信息(F11)查询。
report_id string 整数报告期,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报,0331第一季度,0930第三季度。如20170930;0001为自然周第一周周报,0002为第二周,以此类推。以周为报告期的日期,主要用于提取封闭式基金的净值数据。如20170001;另外,使用0表示最新报告期。

返回:any

reportOfDiy(info_id, report_id, data_date, source)

返回某个自有数据仓库数据的值,也可使用report来调用,report支持多种参数个数接口。

参数 类型 说明
info_id string 信息类别代码,包括财务指标和其他信息,每项信息有一个InfoID编号,infoID参见附录。
report_id string 报告期代码,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报。0331第一季度,0930第三季度。0001为自然周第一周周报,0002为第二周,以此类推如果ReportID,使用0表示最新报告期。以周为报告期的日期,主要用于提取封闭式基金的净值数据。
data_date datetime 数据的时间,系统会返回<=DataDate的数据。为0则表示任意时间。
source string 数据的来源,为’’则返回任意来源。

返回:any

reportExists(info_id, report_id)

返回是否存在某个报告期的某项财务指标

参数 类型 说明
info_id string 信息类别代码,包括财务指标和其他信息,每项信息有一个InfoID编号,infoID参见附录。
report_id string 报告期代码,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报。0331第一季度,0930第三季度。0001为自然周第一周周报,0002为第二周,以此类推如果ReportID,使用0表示最新报告期。

返回:bool

reportHist(infoid, find_v)

返回一个数组,公布了包含infoID的所有报告期列表,例如返回(19991231,20000630,20001231)表示含有InfoID所指数据的报告有1999年年报,2000年中报以及2001年年报。 如果存在FindV参数,则仅返回报告期ID与FindV最接近且不大于的报告期。

参数 类型 说明
infoid any 数据表字段代码,infoID参见附录。如合并利润表中营业收入的ID为46002
find_v any 可选参数,查找的报告期,如20131231。

返回:array

reportHistExists(infoid)

返回某项数据是否存在有报告

参数 类型 说明
infoid any 信息类别代码,infoID参见附录。

返回:bool

lastQuarterData(r_date, info_id, get_the_nearest)

返回某个季度RDate的某项财务指标的值。函数只能提取与报告期相关的数据。季度数据如一季度(1-3月)、二季度(4-6月)、三季度(7-9月)、四季度(10-12月),目前在内地交易所没有要求上市企业公布季度报表,所以我们季度数据需要计算出来。 该模型与当前的时间有关。因为财务数据有调整前调整后的数据,提取数据的时候,要注意设置当前的时间。如果要取调整前的数据,当前的日期,要设置在调整后数据公布日之前。 比如股票A,2011年的年报是2012年4月15日公布,2012年年报是2013年4月15日公布,2012年年报披露的时候,同时会披露2011年年报调整后的数据。 当前的时间pn_date()设置在2013年4月15日之前的时候,取到的2011年年报数据就是调整前的数据,否则,取到的是2011年调整后的数据。 与系统参数pn_stock()、pn_date()相关,默认时间为今天。

参数 类型 说明
r_date datetime 整数报告期,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报,0331第一季度,0930第三季度。如20170930;0001为自然周第一周周报,0002为第二周,以此类推。以周为报告期的日期,主要用于提取封闭式基金的净值数据。如20170001;另外,使用0表示最新报告期。
info_id string 整数,信息类别代码,即财务指标和其他信息的ID,可以通过证券数据专家或基本面信息(F11)查询。
get_the_nearest bool 布尔值,如无指定报告,是否找最接近的报告数据。1为是,0为否。

返回:array

last12MData(r_date, info_id, get_the_nearest)

返回指定报告期RDate往前12个月的某项财务指标的值。函数只能提取与报告期相关的数据。 该模型与当前的时间有关。因为财务数据有调整前调整后的数据,提取数据的时候,要注意设置当前的时间。如果要取调整前的数据,当前的日期,要设置在调整后数据公布日之前。 比如股票A,2011年的年报是2012年4月15日公布,2012年年报是2013年4月15日公布,2012年年报披露的时候,同时会披露2011年年报调整后的数据。 当前的时间pn_date()设置在2013年4月15日之前的时候,取到的2011年年报数据就是调整前的数据,否则,取到的是2011年调整后的数据。 与系统参数pn_stock()、pn_date()相关,默认时间为今天

参数 类型 说明
r_date datetime 整数报告期,一般为YEAR + Code指定,Code为0630表示中报,1231表示年报,0331第一季度,0930第三季度。如20170930;0001为自然周第一周周报,0002为第二周,以此类推。以周为报告期的日期,主要用于提取封闭式基金的净值数据。如20170001;另外,使用0表示最新报告期。
info_id string 整数,信息类别代码,即财务指标和其他信息的ID,可以通过证券数据专家或基本面信息(F11)查询。
get_the_nearest bool object

返回:array

base(info_id, order)

返回某项和报告期无关的数据,例如股票基本信息、公司简称、注册地址等

参数 类型 说明
info_id string 信息类别代码,infoID参见数据字典字段对照ID
order any 省略此参数,则取最后一条记录,否则为第几条数据。0表示第1条。 注意,最后一条记录可能不是最后一次更新的记录,数据的排序考虑了业务,不同的表排序可能不一样,最后一条记录跟该表的排序有关。

返回:any

baseExists(info_id, order)

返回是否存在某项和报告期无关的数据,例如公司简称、注册地址等

参数 类型 说明
info_id string 信息类别代码,infoID参见附录。
order any 省略此参数取最后一次更新,否则为第几条数据。0表示第一条,-1表示最后一条

返回:bool

infoArrayExt(info_id, changed_field_name, changed_value, record_id, field1, value1, field_n, value_n)

返回数据表中指定字段的数值小于等于指定数值的指定记录。例如:分红,送股,配股的历史纪录(2维表)

参数 类型 说明
info_id string 整数,信息类别代码,infoID参见附录;
changed_field_name string 字符串,条件字段;
changed_value any 实数,字段数值要满足的条件;
record_id string 整数,满足条件的记录编号
field1 string 可选参数,可以指定返回的第一个字段
value1 any 可选参数,指定的第一个字段的返回值,返回参数
field_n string 可选参数,可以指定返回的第N个字段
value_n any 可选参数,指定的第N个字段的返回值,返回参数

返回:array

bName(info_id)

返回某信息ID的含义。另,用户也可以通过F11快捷键进行查询。

参数 类型 说明
info_id string 整数,某信息对应的ID号

返回:string

idtType(info_id)

返回某信息ID的类型。

参数 类型 说明
info_id string 整数,某信息对应的ID号.

返回:any

idfType(id)

返回某信息ID的数据类型。

参数 类型 说明
id any 整数,某信息的ID号。

返回:any

basicIdExists(id)

返回某信息ID是否存在

参数 类型 说明
id any 整数,某信息的ID号。

返回:bool

baseArray(id, rep_id)

取“截止日”等于RepID的字段的值。返回指定股票ID号对应的信息,与系统参数(股票)相关。

参数 类型 说明
id any 基本面
rep_id string 报告期

返回:any

queryBk()

提取板块基本面数据。根据用户提供的板块名称,以及提供的函数,计算相应的指标。

返回:array

queryBkWithPeriod()

取板块一段时间的行情类数据。 (1)第二个参数为取股票序列的值,该参数在这个函数中无效;主要是取第一个参数设置的板块的数据。 (2)函数计算的是一段时间序列的数据,函数在调用之前,要设置开始日期setsysparam(pn_begt(),begt)和截止日期setsysparam(pn_endt(),endt)。如果要时间排序的,设置时间为主导setsysparam("TimeIndex",1)。

返回:array

queryWithPeriod(market_list, stock_id_list, condition, field_name1, expression1, field_name2, expression2, field_name_n, expression_n)

取证券一段时间的时间序列数据(行情、净值等)

参数 类型 说明
market_list array 字符串,板块名称列表;
stock_id_list array 字符串,股票代码列表
condition bool 布尔型,选股条件;
field_name1 string 字符串,字段名称1
expression1 any 函数,函数表达式1
field_name2 string 字符串,字段名称2
expression2 any 函数,函数表达式2;;…
field_name_n string 字符串,字段名称N
expression_n any 函数,函数表达式N。

返回:array

evalstring(s)

内核使用,返回表达式s的值。

参数 类型 说明
s string 字符串,表达式

返回:float

specSysParams(exp, date, cycle, rate, rate_day)

设置系统参数(日期,周期,复权,复权基准日)。运行前须先定义表达式Exp。

参数 类型 说明
exp any 函数表达式,表达式
date datetime 日期,时间
cycle string 周期
rate float 复权
rate_day datetime 基准,复权基准日

返回:any

relativeStrengthOfSector(exp, sector)

系统当前证券在板块中的相对强弱(%)。系统当前证券pn_stock()在指定板块Sector中的指标Exp值的从大到小的排位百分比。该函数与系统参数(股票,日期,复权,周期)相关。

参数 类型 说明
exp any 函数表达式
sector string 市场和板块,板块

返回:float

reportOfListed(id, report_id)

返回指定报告期ReportID的基本面ID数据。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。

参数 类型 说明
id string 基本面,基本面ID
report_id string 报告期

返回:any

reportPerShareOfListed(id, report_id)

指定报告期ReportID的基本面ID数据/总股本。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。

参数 类型 说明
id string 基本面,数据ID
report_id string 报告期

返回:any

derivative1(f, n)

指标技术趋势,返回N个时间点前连续三个周期的指标Expr变化趋势,与当前系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
f any 函数表达式,指标
n any 整数,日期偏移

返回:float

positionOfSector(exp, sector)

从大到小排名。板块Sector中成分股按个券指标EXP大小排序,返回指定股票pn_stock()的排名,该函数与系统参数(股票,日期,复权,周期)相关。

参数 类型 说明
exp any 函数表达式
sector string 市场和板块,板块

返回:float

reduceWithHighestOfPeriod(exp, beg_date, end_date, return_type)

返回表达式Exp在区间BegDate到EndDate中的最大值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。

参数 类型 说明
exp any 函数表达式
beg_date datetime 日期,开始日
end_date datetime 日期,截止日
return_type any 用户自定义,返回类型

返回:float

occuredRepIdOfRepPeriod(expr, beg_report, end_year)

在区间BegReport到EndYear年中,与BegReport报告期同比的报告期中返回表达式exp为真的报告期。

参数 类型 说明
expr any 布尔公式表达式
beg_report any 开始期,开始报告期
end_year any 年份,截止年份

返回:any

continuedMatchOfRepPeriod(expr, beg_report, end_year)

判断在区间BegReport到EndYear中是否存在运行表达式Exp的值,若存在返回1,否则返回0。

参数 类型 说明
expr any 布尔公式表达式
beg_report any 开始期,开始报告期
end_year any 年份,截止年份

返回:any

growthOfRepPeriod(expr, r_date, result_type)

表达式Exp某个指标在报告期Rdate的同比增长,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。

参数 类型 说明
expr any 函数表达式
r_date datetime 报告期
result_type any 用户自定义,返回类型

返回:any

relativeStrengthOfSectorDesc(exp, sector)

系统当前证券在板块中的相对强弱(%)。系统当前证券pn_stock()在指定板块Sector中的指标Exp值的从小到大的排位百分比。该函数与系统参数(股票,日期,复权,周期)相关。

参数 类型 说明
exp any 函数表达式
sector string 市场和板块,板块

返回:float

positionOfSectorDesc(exp, sector)

从小到大排名。板块Sector中按指标EXP大小排序,返回指定股票的排名,与系统参数(股票,日期,复权,周期)相关。

参数 类型 说明
exp any 函数表达式
sector string 市场和板块,板块

返回:float

growthWithLowestOfPeriod(exp, beg_date, end_date, return_type)

返回表达式Exp在区间BegDate到EndDate中的最小值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。。

参数 类型 说明
exp any 函数表达式
beg_date datetime 日期,开始日
end_date datetime 日期,截止日
return_type any 用户自定义,返回类型

返回:float

sumOfSector(exp, shares_day, list_day, s_type, sample_select, eps_criterion, except_no_trade)

对指定板块按照一定标准进行选股后,对板块下每一只股票Exp表达式的指标值求和. 选股标准由SType、SampleSelect与EPSCriterion确定。 其中亏损股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<0; 停牌股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<EPSCriterion,与系统参数(板块,周期,时间)相关。

参数 类型 说明
exp any 函数表达式
shares_day datetime 日期,收益计算日
list_day datetime 日期,在之前上市
s_type any 用户自定义,股票类型
sample_select any 用户自定义,样本股选择
eps_criterion float 实数,绩差股标准。每股收益(摊薄)<EPSCriterion即表示绩差股
except_no_trade bool object

返回:float

avgOfSector(exp, mode, shares_day, list_day, s_type, sample_select, eps_criterion, except_no_trade)

板块平均。对指定板块按照一定标准进行选股后,对板块下每一只股票Exp表达式的指标值按mode求平均,选股标准由SampleSelect与EPSCriterion确定。其中亏损股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<0,停牌股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<EPSCriterion,与系统参数(股票,周期)相关。

参数 类型 说明
exp any 函数表达式
mode any 用户自定义,平均模式
shares_day datetime 日期,收益计算日
list_day datetime 日期,在之前上市
s_type any 用户自定义,股票类型
sample_select any 用户自定义,样本股选择
eps_criterion float 实数,绩差股标准。每股收益(摊薄)<EPSCriterion即表示绩差股
except_no_trade bool object

返回:float

occuredTimeOfPeriod(exp, beg_date, end_date)

返回BegDate至Endtime之间表达式Exp存在值的时间序列,与系统参数(股票,复权,周期)相关。

参数 类型 说明
exp any 布尔公式表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止时间

返回:any

specDateValue(date, exp)

返回指定时间表达式Expr的值,与系统参数(股票,复权,周期)相关。

参数 类型 说明
date datetime 日期,时间
exp any 布尔公式表达式

返回:any

derivative2(a)

指标技术加速度,返回4个周期的指标Expr变化趋势,与当前系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
a any 函数表达式

返回:float

stockTrailingAvgByEndT(endt, ref_type, exp, is_exclude_ipo, n)

获取基于指定日推移阶段的日均指标

参数 类型 说明
endt datetime 日期,截止日
ref_type any 用户自定义,选择所推移类型,取值如下:
exp string 字符串, 指标表达式,如"close()","stockzdf3()"
is_exclude_ipo bool object
n any 整数, 剔除天数

返回:float

stockTrailingStdByEndT(endt, ref_type, exp, is_exclude_ipo, n)

获取基于指定日推移阶段的指标标准差

参数 类型 说明
endt datetime 日期,截止日
ref_type any 用户自定义,选择所推移类型,取值如下:
exp string 字符串, 指标表达式,如"close()","stockzdf3()"
is_exclude_ipo bool object
n any 整数, 剔除天数

返回:float

occuredOfNReport(exp, report_id, n)

当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间发生报告Exp的次数,与系统参数(股票)相关。

参数 类型 说明
exp any 布尔公式表达式
report_id string 报告期
n any 整数

返回:any

continuedMatchOfNReport(exp, report_id, n)

当前时间ReportID向前推N年,若从ReportID-N到ReportID时间均存在报告Exp则返回1,否则返回0,与系统参数(股票)相关。

参数 类型 说明
exp any 布尔公式表达式
report_id string 报告期
n any 整数

返回:bool

occuredRepIdOfNReport(exp, report_id, n)

当前时间ReportID向前推N年,若从ReportID-N到ReportID时间存在报告Exp则返回报告期,与系统参数(股票)相关。

参数 类型 说明
exp any 布尔公式表达式
report_id string 报告期
n any 整数,期数

返回:any

sumOfNReport(exp, report_id, n)

当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间报告期Exp指标和,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
report_id string 报告期
n any 整数,期数

返回:float

avgOfNReport(exp, report_id, n, report_type)

当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间报告期Exp指标平均值,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
report_id string 报告期
n any 整数,期数
report_type any 整数,0:年度,1:季度,默认年度

返回:float

refReportValue(exp, report_id, n)

当前时间ReportID向前推N年,返回ReportID-N时间点表达式 Exp指标值,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
report_id string 报告期
n any 整数

返回:float

growthOfNReport(exp, report_id, n, return_type)

当前时间ReportID向前推N年,返回从ReportID-N与ReportID表达式Exp指标的增长比例,其中returntype决定增长模式,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
report_id string 报告期
n any 整数
return_type any 用户自定义,返回类型

返回:float

accOfNReport(exp, report_id, n, report_type, if_stand, return_type)

N期加速度算子

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型
if_stand bool 布尔类型,回归数据是否标准化
return_type any 整型,返回类型

返回:float

robustAccOfNReport(exp, report_id, n, report_type, last_report_type)

N期稳健加速度

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,通常以增长率来表示增速。;如TTM净利润增长率(%)表达式为@Last12MData(DefaultRepID(),9900604)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型
last_report_type any 整数,上期报告期类型,默认与ReportType取值相同(兼容历史)

返回:float

highestOfNReport(exp, report_id, n, report_type)

表达式N期最高

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
n any 整数,期数
report_type any 整数,报告期类型

返回:float

standGrowthOfNReport(exp, report_id, n, report_type)

N期标准化增长率

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型

返回:float

lowestOfNReport(exp, report_id, n, report_type)

表达式N期最低

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
n any 整数,期数
report_type any 整数,报告期类型

返回:float

eavOfNReport(exp, report_id, n, report_type, last_report_type)

N期加速度EAV

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型
last_report_type any 整数,上期报告期类型

返回:float

eaaOfNReport(exp, report_id, last_report_type)

N期加速度EAA

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
last_report_type any 整数,上期报告期类型

返回:float

turnPositiveOfNReport(exp, report_id, n, report_type)

N期转正拐点:最近N期中,前N-1期数据小于0,第N期数据大于0

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型

返回:bool

secondOrderGrowthOfNReport(exp, report_id, n, report_type)

N期二阶增长拐点:最近N期中,前N-1期逐渐下降,第N期数据上升 l 参数: Exp:表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078) ReportID:报告期 N:整数,最近N期 ReportType:报告期类型 取值 含义 备注 0 年度标准(默认) 假设ReportID:=20200930N=2,对应最近N个报告期为20190930、20200930 1 季度标准 假设ReportID:=20200930N=2,对应最近N个报告期为20200630、20200930

参数 类型 说明
exp any
report_id string
n any
report_type any

返回:bool

highGrowthOfNReport(exp, report_id, n, report_type, range)

N期高速增长拐点:最近N期中,第N期数据上升且大于前N-1期极差的range倍 max=max(前N-1期数据) min=min(前N-1期数据) 第N期>上期+range*(max-min)

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N期
report_type any 报告期类型
range float 实数,前N-1期极差的Range倍,用于衡量高速增长的幅度,默认取3

返回:bool

sumOfNDay(exp, n)

返回表达是Exp指标值在N个周期内的求和,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 表达式
n any 整数,天数

返回:float

refValue(exp, n)

返回表达式Exp在前N个交易日的指标值,以市场交易日为准往前推N个交易日,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 表达式,函数表达式
n any 整数,天数

返回:float

continuedMatchOfNDay(exp, n)

判断Exp在过去N个交易日是否取得指标值,若取得返回1,否则返回0,与系统参数(股票,日期)相关。

参数 类型 说明
exp any 表达式,函数表达式
n any 整数,天数

返回:bool

occuredTimeOfNDay(exp, n)

返回表达式Exp指标值发生前N个时间点的时间序列,与系统参数(股票,时间,周期)相关。

参数 类型 说明
exp any 表达式,函数表达式
n any 整数,天数

返回:any

highestOfNDay(exp, n)

返回连续N个周期表达式Exp指标值的最大值,交易日序列以上证指数的交易日为基础,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数

返回:float

stdOfNDay(exp, n)

返回连续N个周期的表达式Exp指标值的标准差,交易日序列以上证指数的交易日为基础,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数

返回:float

lowestOfNDay(exp, n)

返回表达式Exp指标连续N个周期的最小值,交易日序列以上证指数的交易日为基础,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数

返回:float

swingOfNDay(exp, n, return_type)

返回表达式Exp在N个周期指标的振幅,其中returnType决定振幅显示的模式,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数
return_type any 用户自定义,返回类型

返回:float

growthOfNDay(exp, n, return_type)

返回表达式Exp在N个周期指标的增长,其中returnType决定增长显示的类别,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数
return_type any 用户自定义,返回类型

返回:float

avgOfNDay(exp, n)

返回表达式Exp指标连续N个周期的平均值,交易日序列以上证指数的交易日为基础,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数

返回:float

occuredOfNDay(exp, n)

返回表达式Exp指标连续N个周期发生次数,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
n any 整数,天数

返回:any

growthWithHighestOfNDay(exp, n, return_type)

表达式N日最大与当前的偏离,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
return_type any 整数,返回类型

返回:float

growthWithLowestOfNDay(exp, n, return_type)

表达式N日最小与当前的偏离,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
return_type any 整数,返回类型

返回:float

timeOfHighestOfNDay(exp, n)

表达式N日最高时间,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数

返回:string|datetime

timeOfLowestOfNDay(exp, n)

表达式N日最低时间,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数

返回:string|datetime

medianOfNDay(exp, n)

表达式N日中位数,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数

返回:float

kurtosisOfNDay(exp, n)

表达式N日峰度,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数

返回:float

skewnessOfNDay(exp, n)

表达式N日偏度,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数

返回:float

covOfNDay(exp, n, base_id)

表达式N日协方差(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

rsqOfNDay(exp, n, base_id)

表达式N日相关系数平方(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

steyxOfNDay(exp, n, base_id)

表达式N日标准偏差(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

slopeOfNDay2(exp, n, base_id)

表达式N日回归斜率(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

correlOfNDay2(exp, n, base_id)

表达式N日相关系数(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

interceptOfNDay2(exp, n, base_id)

表达式N日回归截距(双序列) ,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串,函数表达式
n any 整数,天数
base_id string 字符串,基准证券代码

返回:float

correlOfNDay(exp1, exp2, n, cache_str)

过去N日相关系数,其中N日表示市场交易日。注:剔除非交易日,例如求过去20天开盘价与成交量的相关系数,但是期间有10天停牌,则取非停牌日10天的相关系数。

参数 类型 说明
exp1 string 字符串。统计表达式1
exp2 string 字符串。统计表达式2
n any 整数。天数
cache_str string 字符串。缓存串

返回:float

decayAvgOfNDay(exp, n, cache_str)

N日线性衰减加权平均,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数
cache_str string 字符串。缓存串

返回:float

deltaOfNDay(exp, n)

当前值-前N日值。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数

返回:float

hhvBarsOfNDay(exp, n, cache_str)

N日最高点到当前的周期数。N日表示市场交易日,当日最低为0。注:剔除非交易日(停牌或未上市)数据指标。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数
cache_str string 字符串。缓存串

返回:any

interceptofNday(exp1, exp2, n, cache_str)

N日线性回归截距项,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp1 string 字符串。因变量表达式
exp2 string 字符串。自变量表达式
n any 整数。交易日天数
cache_str string 字符串。缓存字段

返回:float

llvBarsOfNDay(exp, n, cache_str)

N日最低点到当前的周期数。N日表示市场交易日,当日最低为0。注:剔除非交易日(停牌或未上市)数据指标。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数
cache_str string 字符串。缓存串

返回:datetime

percentRankOfNDay(exp, n, cache_str)

当前值在最近N天的百分位排名,Nan值不参与排名。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数
cache_str string 字符串。缓存串

返回:float

signedPower(exp, n)

符号次方。特殊当x=0时,N<0,返回NanN=0, 返回1N>0, 返回0。

参数 类型 说明
exp string 字符串。函数表达式
n any 实数。次方

返回:float

slopeofNday(exp1, exp2, n, cache_str)

N日线性回归系数。

参数 类型 说明
exp1 string 字符串。因变量表达式
exp2 string 字符串。自变量表达式
n any 整数。交易日天数
cache_str string 字符串。缓存字段

返回:float

covarOfNDay(exp1, exp2, n, cache_str)

过去N日协方差。N日表示市场交易日。注:剔除非交易日,例如求过去20天开盘价与成交量的协方差,但是期间有10天停牌,则取非停牌日10天的协方差。

参数 类型 说明
exp1 string 字符串。统计表达式1
exp2 string 字符串。统计表达式2
n any 整数。天数
cache_str string 字符串。缓存串

返回:float

productOfNDay(exp, n, cache_str)

过去N日乘积。N日表示市场交易日。注:剔除非交易日(停牌或未上市)数据指标。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。天数
cache_str string 字符串。缓存串

返回:float

wmaofNday(exp, n, cache_astr)

N日衰减加权。最新值权重最大,权重归一化,结果同DecayAvgOfNDay。

参数 类型 说明
exp string 字符串。函数表达式
n any 整数。天数
cache_astr string 字符串。缓存串

返回:float

sumifofNday(exp, n, condition, cache_astr)

N日条件求和,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。N日
condition string 字符串。条件表达式
cache_astr string 字符串。缓存串

返回:float

smaofNDay(exp, n, m, cache_str)

过去N日平滑移动平均。N日表示市场交易日。注:剔除非交易日(停牌或未上市)数据指标。

参数 类型 说明
exp string 字符串。统计表达式
n any 整数。最近N日
m float 实数。权重
cache_str string 字符串。缓存串

返回:float

getExpCaceStr(exp, cache_str)

判断是否缓存以及返回缓存串。

参数 类型 说明
exp string 字符串。
cache_str string 字符串。

返回:string

techCalUnit()

技术指标计算单元库。

返回:any

sumOfSectorExceptNoTrade(exp)

返回当前板块当前时间存在交易股票指标Exp的和,与系统参数(板块,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式

返回:float

avgOfSectorExceptNoTrade(exp, mode)

返回当前板块当前时间存在交易股票指标Exp的平均值,其中Mode决定返回的平均类型,与系统参数(板块,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
mode any 用户自定义,平均模式

返回:float

sumOfPeriod(v, beg_t, end_t)

返回当前从开始日Begt到截止日Endt表达式Exp的指标和,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
v any 函数表达式
beg_t datetime 日期,开始日
end_t datetime 日期,截止日

返回:float

swingOfPeriod(exp, beg_date, end_date, re_turn_type)

返回当前从开始日Begt到截止日Endt表达式Exp的指标区间振幅,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
beg_date datetime 日期,开始日
end_date datetime 日期,截止日
re_turn_type any 用户自定义,返回类型

返回:float

highestOfPeriod(exp, beg_date, end_date)

返回当前从开始日Begt到截止日Endt表达式Exp的指标的最大值,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
beg_date datetime 日期,开始日
end_date datetime 日期,截止日

返回:float

timeOfHighestOfPeriod(exp, beg_date, end_date)

返回当前从开始日BegDate到截止日EndDate表达式Exp的指标最大值的时间点,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
beg_date datetime 日期,开始日
end_date datetime 日期,截止日

返回:string

occuredOfPeriod(exp, beg_date, end_date)

表达式区间发生次数

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

avgOfPeriod(exp, begdate, enddate)

返回当前从开始日BegDate到截止日EndDate表达式Exp的指标平均值,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
begdate datetime 日期,开始日期
enddate datetime 日期,截止日期

返回:float

occuredOfRepPeriod(exp, begreport, end_year)

返回当前股票从BegReport到EndYear的同季度报告期数,与系统参数(股票)相关。

参数 类型 说明
exp any 布尔公式表达式
begreport any 报告期,开始报告期
end_year any 年份,截止年份

返回:float

continuedMatchOfPeriod(exp, beg_date)

取Begdate到Enddate的交易日序列,如果在交易日序列Expr指标存在值则返回1,否则返回0。

参数 类型 说明
exp any 布尔公式表达式
beg_date datetime 日期,开始日期;EndYear:日期,截止日期

返回:bool

lowestOfPeriod(exp, beg_date)

从Begdate到Enddate之间Expr指标的最小值,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 布尔公式表达式
beg_date datetime 日期,开始日期;EndYear:日期,截止日期

返回:float

avgOfRepPeriod(exp, begreport, end_year)

返回当前股票从报告期BegReport到EndYear同季度报告期的Expr指标的平均值,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
begreport any 报告期,开始报告期
end_year any 年份,截止年份

返回:float

sumOfRepPeriod(exp, begreport, end_year)

返回当前股票Expr指标从报告期BegReport到EndYear同季度报告期的和,与系统参数(股票)相关。

参数 类型 说明
exp any 函数表达式
begreport any 报告期,开始报告期
end_year any 年份,截止年份

返回:float

growthOfPeriod(exp, beg_date, end_date, returntype)

从Begdate到Enddate之间Expr指标的增长,增长模式由Returntype决定,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 布尔公式表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
returntype any 用户自定义,返回类型

返回:float

timeOfLowestOfPeriod(exp, beg_t, end_t)

返回当前从开始日Begt到截止日Endt表达式Exp的指标最小值的时间点,与系统参数(股票,日期,周期,复权)相关。

参数 类型 说明
exp any 函数表达式
beg_t datetime 日期,开始日
end_t datetime 日期,截止日

返回:string

hhvBarsOfPeriod(exp, beg_date, end_date)

表达式区间最高点到当前的周期数

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

llvBarsOfPeriod(exp, beg_date, end_date)

表达式区间最低点到当前的周期数

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

highestOfRepPeriod2(exp, beg_report, end_report, report_type)

表达式区间最高

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型

返回:float

lowestOfRepPeriod2(exp, beg_report, end_report, report_type)

表达式区间最低

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型

返回:float

medianOfPeriod(exp, beg_date, end_date)

表达式区间中位数

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

percentRankOfPeriod(exp, beg_date, end_date)

表达式区间分位数

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

skewnessOfPeriod(exp, beg_date, end_date)

表达式区间偏度

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

kurtosisOfPeriod(exp, beg_date, end_date)

表达式区间峰度

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

growthOfRepPeriod2(exp, beg_report, end_report, return_type, report_type)

表达式区间增长

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
return_type any 整数,返回类型
report_type any 整数,报告期类型

返回:float

sumOfRepPeriod2(exp, beg_report, end_report, report_type)

表达式区间和

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型

返回:float

avgOfRepPeriod2(exp, beg_report, end_report, report_type)

表达式区间平均

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型

返回:float

stdOfPeriod(exp, beg_date, end_date)

表达式区间标准差

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期

返回:float

stdOfRepPeriod2(exp, beg_report, end_report, report_type)

表达式区间标准差

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型

返回:float

correlOfPeriod(exp, beg_date, end_date, base_id)

表达式区间相关系数(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

rsqOfPeriod(exp, beg_date, end_date, base_id)

表达式区间相关系数平方(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

slopeOfPeriod(exp, beg_date, end_date, base_id)

表达式区间回归斜率(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

interceptOfPeriod(exp, beg_date, end_date, base_id)

表达式区间回归截距(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

covOfPeriod(exp, beg_date, end_date, base_id)

表达式区间协方差(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

steyxOfPeriod(exp, beg_date, end_date, base_id)

表达式区间标准偏差(双序列)

参数 类型 说明
exp string 字符串,函数表达式
beg_date datetime 日期,开始日期
end_date datetime 日期,截止日期
base_id string 字符串,基准证券代码

返回:float

ratioValueByType(v1, v2, type, n)

依据返回类型type,返回初值V1到末值V2的增长/增长率/复合增长率。

参数 类型 说明
v1 any 实数,初值
v2 any 实数,末值
type any 用户自定义,返回数据类型
n any 整数,期数或交易天数

返回:float

isValidValue(v)

判断V是否是一个数字类型(整数或者实数),如果是非空实数,则返回1,否则返回0。

参数 类型 说明
v any 整数

返回:bool

filterSampleByCriterionWiz(stock_arr, list_day, sample_select, eps_criterion, eps_day)

按照一定的标准过滤计算板块指标的股票,标准由SampleSelect与EPSCriterion确定。其中亏损股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<0,停牌股为当前时间之前最近一期报告期每股收益(摊薄)*12/报告期所在月份<EPSCriterion,与系统参数(股票,周期)相关。

参数 类型 说明
stock_arr array 一维字符串数组,股票列表
list_day datetime 整数,上市日约束
sample_select any 用户自定义,样本股选择
eps_criterion float 实数,绩差股标准。每股收益(摊薄)<EPSCriterion即表示绩差股
eps_day datetime 整数型日期,收益计算日

返回:any

compositeRatioValue(v1, v2, n)

返回初值V1到末值V2的复合增长率。

参数 类型 说明
v1 any 实数,初值
v2 any 实数,末值
n any 整数,期数

返回:float

simplyRatioValue(v1, v2)

返回初值V1到末值V2的增长率。若V1<0,则直接返回0。

参数 类型 说明
v1 any 实数,初值
v2 any 实数,末值

返回:float

isNull(v)

判断是否为空,如果是返回1,否则返回0。

参数 类型 说明
v any 整数

返回:bool

isValidPositiveValue(v)

判断是否为大于0的实数,如果是返回1,否则返回0。

参数 类型 说明
v any 实数

返回:bool

reportValueOfPeriod(exp, beg_report, end_report, report_type, reportvalue)

区间财务数据

参数 类型 说明
exp string 字符串,函数表达式
beg_report any 整数,开始报告期
end_report any 整数,截止报告期
report_type any 整数,报告期类型
reportvalue array 数组,报告期数据

返回:array

sumOfNReport2(exp, report_id, n)

N个季度报告期数据之和,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

avgOfNReport2(exp, report_id, n)

N个季度报告期数据的平均值,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润为@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

stdOfNReport2(exp, report_id, n)

N个季度报告期数据的标准差,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润为@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

accOfNReport2(exp, report_id, n)

N季加速度,与ACCOfNReport的区别在于仅支持季度数据计算,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润为@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

robustGrowthOfNReport2(exp, report_id, n)

N季稳健增速,与RobustGrowthOfNReport的区别在于仅支持季度数据计算,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润为@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

robustAccOfNReport2(exp, report_id, n)

N季稳健加速度,与RobustACCOfNReport的区别在于仅支持季度数据计算,与系统证券相关

参数 类型 说明
exp any 表达式类型,计算相关财务指标,一般与报告期相关,;如TTM归属母公司净利润为@Last12MData(DefaultRepID(),46078)
report_id string 报告期
n any 整数,最近N季

返回:float

percentRankOftheReport(exp, report_id, cache_str)

表达式当期分位排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
cache_str string 字符串,缓存串

返回:float

percentRankOftheDay3(exp, cache_str, fill_nan)

表达式当日分位排名,个股在pn_StockArr()成分股中的表达式值的分位排名,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
cache_str string 字符串,缓存串
fill_nan any 整数,非交易日NAN替代

返回:float

rankOftheReport(exp, report_id, sort_order, cache_str)

表达式当期排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
sort_order any 整数,排位方式
cache_str string 字符串,缓存串

返回:float

rankOftheDay3(exp, sort_order, cache_str, fill_nan)

表达式当日排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
sort_order any 整数,排位方式
cache_str string 字符串,缓存串
fill_nan any 整数,非交易日NAN替代

返回:float

scaleOfSeries3(exp, a, cache_str, fill_nan)

表达式当日标准化,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
a any 整数,标准化数值
cache_str string 字符串,缓存串
fill_nan any 整数,非交易日NAN替代

返回:float

scaleOfSeriesOftheReport(exp, report_id, a, cache_str)

表达式当期标准化

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
a any 整数,标准化数值
cache_str string 字符串,缓存串

返回:float

indNeutralize4(exp, by_group, cache_str, fill_nan)

表达式当日中性化,与系统参数证券代码,时间,pn_StockArr()相关。

参数 类型 说明
exp string 字符串,函数表达式
by_group any 整数,分类标准
cache_str string 字符串,缓存串
fill_nan any 整数,非交易日NAN替代

返回:float

indNeutralizeOftheReport(exp, report_id, by_group, cache_str)

表达式当期中性化

参数 类型 说明
exp string 字符串,函数表达式
report_id string 整数,报告期
by_group any 整数,分类标准
cache_str string 字符串,缓存串

返回:float

indNeutralize(exp, by_group, cache_str)

中性化操作,分组去均值化。将数据指标Exp按照ByGroup分类,对每个类别按照Exp=Exp–mean(Exp)进行中性化处理,处理之后Exp的均值为0。注:因分类标准不明确,此函数暂时不进行分类,即按整个市场,只对Exp进行中性化处理。

参数 类型 说明
exp string 字符串。统计表达式
by_group any 用户自定义。取值如下:
cache_str string 字符串。缓存串

返回:float|void

indNeutralize2(exp, by_group, cache_str)

中性化操作,分组去均值化。将数据指标Exp按照ByGroup分类,对每个类别按照Exp=Exp–mean(Exp)进行中性化处理,处理之后Exp的均值为0。注:因分类标准不明确,此函数暂时不进行分类,即按整个市场,只对Exp进行中性化处理。

参数 类型 说明
exp string 字符串。统计表达式
by_group any 用户自定义。取值如下:
cache_str string 字符串。缓存串

返回:float

percentRankOftheDay(exp, cache_str)

当日分位排名。与PercentRankOftheDay2最大的区别,停牌成分设为Nan。

参数 类型 说明
exp string 字符串。统计表达式
cache_str string 字符串。缓存串

返回:float|void

percentRankOftheDay2(exp, cache_str)

当日分位排名。股票横截面数据排名,x表示一组股票的截面数据,按向量x的元素大小升序排序,序号从0开始,如[0,1,...,n],然后输出排名所占总位数的百分比,即将排名归一到[0,1]区间。注意:Nan值不参与排名,输出Nan。

参数 类型 说明
exp string 字符串。统计表达式
cache_str string 字符串。缓存串

返回:float

rankOftheDay(exp, sort_order, cache_str)

当日横比排名。注意:pn_StockArr当日无交易的成分设置为Nan;EXp计算为NAN值时,不参与排名,排名为NAN。

参数 类型 说明
exp string 字符串。统计表达式
sort_order any 整数。排位方式,取值如下:
cache_str string 字符串。缓存串

返回:void

rankOftheDay2(exp, sort_order, cache_str)

当日最新值横比排名。与RankOftheDay的区别在于:RankOftheDay2不会将pn_StockArr当日的停牌成分设置为Nan。注意:EXp计算为NAN值时,不参与排名,排名为NAN。

参数 类型 说明
exp string 字符串。统计表达式
sort_order any 整数。排位方式,取值如下:
cache_str string 字符串。缓存串

返回:any

scaleOfSeries(exp, a, cache_str)

标准化(无交易成分设为NAN)。将x中的非NAN值进行标准化,使x的绝对值的和为a,默认a=1。注意:NAN值依然输出NAN。

参数 类型 说明
exp string 字符串。统计表达式
a float 实数。标准化数值
cache_str string 字符串。缓存串

返回:float|void

scaleOfSeries2(exp, a, cache_str)

标准化。将x中的非NAN值进行标准化,使x的绝对值的和为a,默认a=1。注意:NAN值依然输出NAN。

参数 类型 说明
exp string 字符串。统计表达式
a float 实数。标准化数值
cache_str string 字符串。缓存串

返回:float

cacheStrMerge()

缓存串参数拼接。

返回:string

getParmStockArrByEndt(end_t)

得到指定日股票池。1、用于支持横比动态成分;2、目前多用于101因子的计算中。

参数 类型 说明
end_t datetime 日期。指定日。

返回:array

getParmGroupIndustryByEndt(t, endt, by_group)

得到指定日股票池行业分类。1、用于支持横比行业分类;2、目前多用于101因子的计算中的中间函数IndNeutralize中;3、目前使用申万一二三级行业来处理。

参数 类型 说明
t array 数组。股票池数据
endt datetime 日期。截止日
by_group any 用户自定义。取值如下:

返回:array

getHbCacheStr(cache_str, fname)

横比缓存串,多用于101因子中。串中不缓存pn_StockArr,因为无法满足动态指数成分,得需要用pn_StockArrName作唯一标识。

参数 类型 说明
cache_str string 字符串。缓存串
fname string 字符串。函数名称

返回:string

setParmStockArrFunc(func, stock_arr_name)

1、用于支持横比动态成分;2、目前多用于101因子的计算中,与GetParm_StockArr_ByEndt一起使用;3、一般客户无需使用。

参数 类型 说明
func string 字符串。函数名称
stock_arr_name string 字符串。股票池名称

返回:any

isTimePeriodInfoId(info_id)

是否是时段指标。

参数 类型 说明
info_id string 整数。基本面Id。

返回:bool