📝 docs(tsl): complete and lint codegen reference
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
# 数据仓库 / 复权相关
|
||||
|
||||
### `rdFirstday()`
|
||||
## `rd_firstday()`
|
||||
|
||||
复权基准日函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `rdLastday()`
|
||||
## `rd_lastday()`
|
||||
|
||||
复权基准日函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `rtComplex()`
|
||||
## `rt_complex()`
|
||||
|
||||
复权类型函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `rtNone()`
|
||||
## `rt_none()`
|
||||
|
||||
复权类型函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `rtScale()`
|
||||
## `rt_scale()`
|
||||
|
||||
复权类型函数相关函数。
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 通用
|
||||
|
||||
### `monthsBetween2(a_now, a_then)`
|
||||
## `monthsBetween2(a_now, a_then)`
|
||||
|
||||
对月数:今天到下个月的今天(不包括)算一个完整月度,即一个对月。
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
返回:float
|
||||
|
||||
### `yearsBetween2(a_now, a_then)`
|
||||
## `yearsBetween2(a_now, a_then)`
|
||||
|
||||
对年数:明年的今天(不包括)算一个完整年度,即一个对年。
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 当日
|
||||
|
||||
### `cacheStrMerge(arg1, arg2, date_value_3)`
|
||||
## `cacheStrMerge(arg1, arg2, date_value_3)`
|
||||
|
||||
当日相关函数。
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
返回:string
|
||||
|
||||
### `getHbCacheStr(cache_str, fname)`
|
||||
## `getHbCacheStr(cache_str, fname)`
|
||||
|
||||
横比缓存串,多用于101因子中。串中不缓存pn_StockArr,因为无法满足动态指数成分,得需要用pn_StockArrName作唯一标识。
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
返回:string
|
||||
|
||||
### `getParmGroupIndustryByEndt(t, endt, by_group)`
|
||||
## `GetParm_GroupIndustry_ByEndt(t, endt, by_group)`
|
||||
|
||||
得到指定日股票池行业分类。1、用于支持横比行业分类;2、目前多用于101因子的计算中的中间函数IndNeutralize中;3、目前使用申万一二三级行业来处理。
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `getParmStockArrByEndt(end_t)`
|
||||
## `GetParm_StockArr_ByEndt(end_t)`
|
||||
|
||||
得到指定日股票池。1、用于支持横比动态成分;2、目前多用于101因子的计算中。
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `indNeutralize4(exp, by_group, cache_str, fill_nan)`
|
||||
## `indNeutralize4(exp, by_group, cache_str, fill_nan)`
|
||||
|
||||
表达式当日中性化,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -68,7 +68,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return IndNeutralize4(@close(),0,"",1);
|
||||
```
|
||||
|
||||
### `indNeutralizeOftheReport(exp, report_id, by_group, cache_str)`
|
||||
## `indNeutralizeOftheReport(exp, report_id, by_group, cache_str)`
|
||||
|
||||
表达式当期中性化
|
||||
|
||||
@@ -81,7 +81,7 @@ return IndNeutralize4(@close(),0,"",1);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20221231T;
|
||||
@@ -90,7 +90,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return IndNeutralizeOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
```
|
||||
|
||||
### `percentRankOftheDay(exp, cache_str)`
|
||||
## `percentRankOftheDay(exp, cache_str)`
|
||||
|
||||
当日分位排名。与PercentRankOftheDay2最大的区别,停牌成分设为Nan。
|
||||
|
||||
@@ -101,7 +101,7 @@ return IndNeutralizeOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
|
||||
返回:float|void
|
||||
|
||||
### `percentRankOftheDay2(exp, cache_str)`
|
||||
## `percentRankOftheDay2(exp, cache_str)`
|
||||
|
||||
当日分位排名。股票横截面数据排名,x表示一组股票的截面数据,按向量x的元素大小升序排序,序号从0开始,如\[0,1,...,n\],然后输出排名所占总位数的百分比,即将排名归一到\[0,1\]区间。注意:Nan值不参与排名,输出Nan。
|
||||
|
||||
@@ -112,7 +112,7 @@ return IndNeutralizeOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
|
||||
返回:float
|
||||
|
||||
### `percentRankOftheDay3(exp, cache_str, fill_nan)`
|
||||
## `percentRankOftheDay3(exp, cache_str, fill_nan)`
|
||||
|
||||
表达式当日分位排名,个股在pn_StockArr()成分股中的表达式值的分位排名,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -124,7 +124,7 @@ return IndNeutralizeOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -134,7 +134,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return PercentRankOftheDay3(@close(),"",1);
|
||||
```
|
||||
|
||||
### `percentRankOftheReport(exp, report_id, cache_str)`
|
||||
## `percentRankOftheReport(exp, report_id, cache_str)`
|
||||
|
||||
表达式当期分位排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -146,7 +146,7 @@ return PercentRankOftheDay3(@close(),"",1);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20221231T;
|
||||
@@ -155,19 +155,19 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return PercentRankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231);
|
||||
```
|
||||
|
||||
### `pnStockArrFunc()`
|
||||
## `pn_StockArrFunc()`
|
||||
|
||||
当日相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `pnStockArrName()`
|
||||
## `pn_StockArrName()`
|
||||
|
||||
当日相关函数。
|
||||
|
||||
返回:string
|
||||
|
||||
### `rankOftheDay(exp, sort_order, cache_str)`
|
||||
## `rankOftheDay(exp, sort_order, cache_str)`
|
||||
|
||||
当日横比排名。注意:pn_StockArr当日无交易的成分设置为Nan;EXp计算为NAN值时,不参与排名,排名为NAN。
|
||||
|
||||
@@ -179,7 +179,7 @@ return PercentRankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231);
|
||||
|
||||
返回:int
|
||||
|
||||
### `rankOftheDay2(exp, sort_order, cache_str)`
|
||||
## `rankOftheDay2(exp, sort_order, cache_str)`
|
||||
|
||||
当日最新值横比排名。与RankOftheDay的区别在于:RankOftheDay2不会将pn_StockArr当日的停牌成分设置为Nan。注意:EXp计算为NAN值时,不参与排名,排名为NAN。
|
||||
|
||||
@@ -191,7 +191,7 @@ return PercentRankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231);
|
||||
|
||||
返回:int
|
||||
|
||||
### `rankOftheDay3(exp, sort_order, cache_str, fill_nan)`
|
||||
## `rankOftheDay3(exp, sort_order, cache_str, fill_nan)`
|
||||
|
||||
表达式当日排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -204,7 +204,7 @@ return PercentRankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -214,7 +214,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return RankOftheDay3(@close(),0,"",1);
|
||||
```
|
||||
|
||||
### `rankOftheReport(exp, report_id, sort_order, cache_str)`
|
||||
## `rankOftheReport(exp, report_id, sort_order, cache_str)`
|
||||
|
||||
表达式当期排名,个股在pn_StockArr()成分股中的表达式值的排名,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -227,7 +227,7 @@ return RankOftheDay3(@close(),0,"",1);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20221231T;
|
||||
@@ -236,7 +236,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return RankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
```
|
||||
|
||||
### `scaleOfSeries(exp, a, cache_str)`
|
||||
## `scaleOfSeries(exp, a, cache_str)`
|
||||
|
||||
标准化(无交易成分设为NAN)。将x中的非NAN值进行标准化,使x的绝对值的和为a,默认a=1。注意:NAN值依然输出NAN。
|
||||
|
||||
@@ -248,7 +248,7 @@ return RankOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,0);
|
||||
|
||||
返回:float|void
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -258,7 +258,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return ScaleOfSeries(@close(),1,"");
|
||||
```
|
||||
|
||||
### `scaleOfSeries2(exp, a, cache_str)`
|
||||
## `scaleOfSeries2(exp, a, cache_str)`
|
||||
|
||||
标准化。将x中的非NAN值进行标准化,使x的绝对值的和为a,默认a=1。注意:NAN值依然输出NAN。
|
||||
|
||||
@@ -270,7 +270,7 @@ return ScaleOfSeries(@close(),1,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -280,7 +280,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return ScaleOfSeries2(@close(),1,"");
|
||||
```
|
||||
|
||||
### `scaleOfSeries3(exp, a, cache_str, fill_nan)`
|
||||
## `scaleOfSeries3(exp, a, cache_str, fill_nan)`
|
||||
|
||||
表达式当日标准化,与系统参数证券代码,时间,pn_StockArr()相关。
|
||||
|
||||
@@ -293,7 +293,7 @@ return ScaleOfSeries2(@close(),1,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20231010T;
|
||||
@@ -303,7 +303,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return ScaleOfSeries3(@close(),1,"",1);
|
||||
```
|
||||
|
||||
### `scaleOfSeriesOftheReport(exp, report_id, a, cache_str)`
|
||||
## `scaleOfSeriesOftheReport(exp, report_id, a, cache_str)`
|
||||
|
||||
表达式当期标准化
|
||||
|
||||
@@ -316,7 +316,7 @@ return ScaleOfSeries3(@close(),1,"",1);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
endt:=20221231T;
|
||||
@@ -325,7 +325,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",endt));
|
||||
return ScaleOfSeriesOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,1);
|
||||
```
|
||||
|
||||
### `setParmStockArrFunc(func, stock_arr_name)`
|
||||
## `SetParm_StockArrFunc(func, stock_arr_name)`
|
||||
|
||||
1、用于支持横比动态成分;2、目前多用于101因子的计算中,与GetParm_StockArr_ByEndt一起使用;3、一般客户无需使用。
|
||||
|
||||
@@ -335,4 +335,3 @@ return ScaleOfSeriesOftheReport(@ReportOfAll(46002,DefaultRepID()),20221231,1);
|
||||
| `stock_arr_name` | string | 字符串。股票池名称 |
|
||||
|
||||
返回:any
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 盘中统计
|
||||
|
||||
### `reportOfAll(info_id, report_id)`
|
||||
## `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年调整后的数据。
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ000001');
|
||||
@@ -19,7 +19,7 @@ setsysparam(pn_date(),20171031);
|
||||
return reportofall(46002,20170930);
|
||||
```
|
||||
|
||||
### `spAvedev(exp, n, cache_string)`
|
||||
## `SP_AVEDEV(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的平均绝对偏差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算平均绝对偏差
|
||||
|
||||
@@ -31,7 +31,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spCorrel(exp1, exp2, n)`
|
||||
## `sp_correl(exp1, exp2, n)`
|
||||
|
||||
移动相关系数。两个表达式正在最近N个交易日的相关系数
|
||||
|
||||
@@ -43,7 +43,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spCov(exp1, exp2, n)`
|
||||
## `sp_cov(exp1, exp2, n)`
|
||||
|
||||
移动协方差。两个表达式在最近N个交易日的协方差
|
||||
|
||||
@@ -55,7 +55,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spDevsq(exp, n, cache_string)`
|
||||
## `SP_DEVSQ(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的偏差平方和。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算偏差平方和
|
||||
|
||||
@@ -67,7 +67,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `specDateValue(date, exp)`
|
||||
## `specDateValue(date, exp)`
|
||||
|
||||
返回指定时间表达式Expr的值,与系统参数(股票,复权,周期)相关。
|
||||
|
||||
@@ -78,7 +78,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:any
|
||||
|
||||
### `specSysParams(exp, date, cycle, rate, rate_day)`
|
||||
## `specSysParams(exp, date, cycle, rate, rate_day)`
|
||||
|
||||
设置系统参数(日期,周期,复权,复权基准日)。运行前须先定义表达式Exp。
|
||||
|
||||
@@ -92,7 +92,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:any
|
||||
|
||||
### `spFrequency(exp, m, n)`
|
||||
## `sp_frequency(exp, m, n)`
|
||||
|
||||
移动频数。表达式最近N个交易日的频数
|
||||
|
||||
@@ -104,7 +104,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:array
|
||||
|
||||
### `spG(name)`
|
||||
## `sp_g(name)`
|
||||
|
||||
返回Name指定的系统参数。功能同getsysparam。
|
||||
|
||||
@@ -114,7 +114,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:any
|
||||
|
||||
### `spGeoMean(exp, n)`
|
||||
## `sp_geomean(exp, n)`
|
||||
|
||||
移动几何平均数。表达式前N个交易日的几何平均数
|
||||
|
||||
@@ -125,7 +125,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spHarMean(exp, n)`
|
||||
## `sp_harmean(exp, n)`
|
||||
|
||||
移动调和平均数。表达式前N个交易日的调和平均数
|
||||
|
||||
@@ -136,7 +136,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spIntercept(exp1, exp2, n)`
|
||||
## `sp_intercept(exp1, exp2, n)`
|
||||
|
||||
移动回归截距。两个表达式在最近N个交易日的回归截距
|
||||
|
||||
@@ -148,7 +148,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spKurtosis(exp, n)`
|
||||
## `sp_kurtosis(exp, n)`
|
||||
|
||||
移动峰度(Excel兼容)。表达式数据最近N个交易日的峰度,算法与excel兼容
|
||||
|
||||
@@ -159,7 +159,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spKurtosis2(exp, n)`
|
||||
## `sp_kurtosis2(exp, n)`
|
||||
|
||||
移动峰度(Matlab兼容)。表达式最近N个交易日的峰度,算法与matlab兼容
|
||||
|
||||
@@ -170,7 +170,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spLarge(exp, m, n)`
|
||||
## `sp_large(exp, m, n)`
|
||||
|
||||
移动最大排位值。指定表达式最近N天中的第M个最大值
|
||||
|
||||
@@ -182,7 +182,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spPercentile(exp, m, n)`
|
||||
## `sp_percentile(exp, m, n)`
|
||||
|
||||
移动百分位数。表达式最近N个交易日第M个百分比对应的数据
|
||||
|
||||
@@ -194,7 +194,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spPercentrank(exp1, exp2, n)`
|
||||
## `sp_percentrank(exp1, exp2, n)`
|
||||
|
||||
移动百分比排名。指标数据的当前数据在最近N个交易日中的百分比排名
|
||||
|
||||
@@ -206,7 +206,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spQuartile(exp, m, n)`
|
||||
## `sp_quartile(exp, m, n)`
|
||||
|
||||
移动四分位数。表达式最近N个交易日集中四分位对应的数据
|
||||
|
||||
@@ -218,7 +218,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spRsq(exp1, exp2, n)`
|
||||
## `sp_rsq(exp1, exp2, n)`
|
||||
|
||||
移动相关系数平方。两个表达式最近N个交易日的Pearson乘积矩相关系数的平方
|
||||
|
||||
@@ -230,7 +230,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spS(name, value)`
|
||||
## `sp_s(name, value)`
|
||||
|
||||
设置Name指定的系统参数的值为Value。如果设置不成功返回假否则返回真。系统参数为全局变量,即该函数设置的变量全局有效。也可以自定义参数。功能同sp_setsysparam
|
||||
|
||||
@@ -241,7 +241,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `spSkewness(exp, n)`
|
||||
## `sp_skewness(exp, n)`
|
||||
|
||||
移动偏度(Excel兼容)。表达式数据最近N个交易日的偏度,算法与excel兼容
|
||||
|
||||
@@ -252,7 +252,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spSkewness2(exp, n)`
|
||||
## `sp_skewness2(exp, n)`
|
||||
|
||||
移动偏度(Matlab兼容)。表达式数据最近N个交易日的偏度,算法与matlab兼容
|
||||
|
||||
@@ -263,7 +263,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spSlope(exp1, exp2, n)`
|
||||
## `sp_slope(exp1, exp2, n)`
|
||||
|
||||
移动回归斜率。两个表达式在最近N个交易日的回归斜率
|
||||
|
||||
@@ -275,7 +275,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spSlopeAndIntercept(exp1, exp2, n)`
|
||||
## `sp_slopeandintercept(exp1, exp2, n)`
|
||||
|
||||
移动回归斜率和截距。两个表达式最近N个交易日的回归斜率和截距
|
||||
|
||||
@@ -287,7 +287,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:array
|
||||
|
||||
### `spSmall(exp, m, n)`
|
||||
## `sp_small(exp, m, n)`
|
||||
|
||||
移动最小排位值。指标数据最近N个交易日的第M个最小值
|
||||
|
||||
@@ -299,7 +299,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spStd(exp, n, cache_string)`
|
||||
## `SP_STD(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的标准差。TExpression是与时间序列数据相关的函数或表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算标准差。
|
||||
|
||||
@@ -311,7 +311,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spStdp(exp, n, cache_string)`
|
||||
## `SP_STDP(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的总体标准差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的EXP的值计算总体标准差
|
||||
|
||||
@@ -323,7 +323,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spSteyx(exp1, exp2, n)`
|
||||
## `sp_steyx(exp1, exp2, n)`
|
||||
|
||||
移动标准误差。两个表达式最近N个交易日的相对标准偏差
|
||||
|
||||
@@ -335,7 +335,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spTime(get_set_time)`
|
||||
## `sp_time(get_set_time)`
|
||||
|
||||
取得当前环境的时间,不是真正的现在的时间。与系统变量(股票pn_stock()、时间pn_date()、周期pn_cycle()相关)。
|
||||
|
||||
@@ -345,7 +345,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:datetime
|
||||
|
||||
### `spTotalVariance(exp, n)`
|
||||
## `sp_totalvariance(exp, n)`
|
||||
|
||||
移动总体偏差。表达式数据最近N个交易日的离差平方和(总体偏差)
|
||||
|
||||
@@ -356,7 +356,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spTrimmean(exp, m, n)`
|
||||
## `sp_trimmean(exp, m, n)`
|
||||
|
||||
移动去首尾平均值。表达式最近N个交易日去掉首尾百分比后的平均值
|
||||
|
||||
@@ -368,7 +368,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spVar(exp, n, cache_string)`
|
||||
## `SP_VAR(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的样本方差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算样本方差
|
||||
|
||||
@@ -380,7 +380,7 @@ return reportofall(46002,20170930);
|
||||
|
||||
返回:float
|
||||
|
||||
### `spVarp(exp, n, cache_string)`
|
||||
## `SP_VARP(exp, n, cache_string)`
|
||||
|
||||
估算N天的TExpression的总体样本方差。TExpression是与取时间序列数值的表达式,例如close函数,函数的含义是根据连续N天的当天的EXP的值计算总体样本方差
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 市场
|
||||
|
||||
### `getBk(marketlist)`
|
||||
## `getBk(marketlist)`
|
||||
|
||||
得到指定的市场板块列表包含的股票列表。 注意,获取的是最新的板块成分股,行业名称或者板块名称,而非指数代码。 这些板块或行业名称必须和板块管理中的名称一致。 如果用户需要获取指定日期的历史成分股,请参考GetBKByDate。
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `getBkList(_type)`
|
||||
## `getBkList(_type)`
|
||||
|
||||
得到所有的或者指定的系统板块类别下的板块名称列表。板块类别用户可查看板块管理中的类别。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------ | ------ | -------------------------------------------------------------------- |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | ------ | -------------------------------------------------------------------- |
|
||||
| `_type` | string | 字符串,板块类别,即具体板块的目录名称;无参数时得到所有的板块列表。 |
|
||||
|
||||
返回:array
|
||||
|
||||
### `getBkList2(bktype)`
|
||||
## `getBkList2(bktype)`
|
||||
|
||||
得到所有的或者指定的系统板块类别下的板块名称列表以及板块所在路径名。 注意:除了结果类型与GetUserBKList不同以外,此函数得到指定板块类别下以及子路径下的所有的板块。
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `getUserBkList(bktype)`
|
||||
## `getUserBkList(bktype)`
|
||||
|
||||
得到所有的或者指定的板块类别下的用户板块的名称列表。
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `getUserBkList2(bktype)`
|
||||
## `getUserBkList2(bktype)`
|
||||
|
||||
得到所有的或者指定的板块类别下用户板块的名称列表以及板块所在路径名。 注意,除了结果类型与GetUserBKList不同以外,此函数得到指定板块类别下以及子路径下的所有的板块。
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
返回:array
|
||||
|
||||
### `indNeutralize(exp, by_group, cache_str)`
|
||||
## `indNeutralize(exp, by_group, cache_str)`
|
||||
|
||||
中性化操作,分组去均值化。将数据指标Exp按照ByGroup分类,对每个类别按照Exp=Exp–mean(Exp)进行中性化处理,处理之后Exp的均值为0。注:因分类标准不明确,此函数暂时不进行分类,即按整个市场,只对Exp进行中性化处理。
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
返回:float|void
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600519");
|
||||
@@ -71,7 +71,7 @@ setsysparam(pn_StockArr(),getbkbydate("SH000300",20231010T));
|
||||
return IndNeutralize(@open(),0,"");
|
||||
```
|
||||
|
||||
### `indNeutralize2(exp, by_group, cache_str)`
|
||||
## `indNeutralize2(exp, by_group, cache_str)`
|
||||
|
||||
中性化操作,分组去均值化。将数据指标Exp按照ByGroup分类,对每个类别按照Exp=Exp–mean(Exp)进行中性化处理,处理之后Exp的均值为0。注:因分类标准不明确,此函数暂时不进行分类,即按整个市场,只对Exp进行中性化处理。
|
||||
|
||||
@@ -83,7 +83,7 @@ return IndNeutralize(@open(),0,"");
|
||||
|
||||
返回:float
|
||||
|
||||
### `marketId(stock_id, day)`
|
||||
## `marketId(stock_id, day)`
|
||||
|
||||
获得证券的所属市场ID。
|
||||
|
||||
@@ -94,7 +94,7 @@ return IndNeutralize(@open(),0,"");
|
||||
|
||||
返回:int
|
||||
|
||||
### `marketInfo(id, info_id)`
|
||||
## `marketInfo(id, info_id)`
|
||||
|
||||
获得市场的相关信息。
|
||||
|
||||
@@ -105,7 +105,7 @@ return IndNeutralize(@open(),0,"");
|
||||
|
||||
返回:array
|
||||
|
||||
### `marketOpenCloseTime(id, day)`
|
||||
## `marketOpenCloseTime(id, day)`
|
||||
|
||||
取得指定市场在指定日的理论开盘时间以及收盘时间。即便由于长假原因导致夜盘不开盘,也会存在理论的夜盘开盘时间。
|
||||
|
||||
@@ -115,4 +115,3 @@ return IndNeutralize(@open(),0,"");
|
||||
| `day` | datetime | 指定的日期。 |
|
||||
|
||||
返回:array
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# 数据仓库 / 多市场支撑函数
|
||||
|
||||
### `defaultTimeZone()`
|
||||
## `defaultTimeZone()`
|
||||
|
||||
多市场支撑函数相关函数。
|
||||
|
||||
返回:int
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / N期
|
||||
|
||||
### `accOfNReport(exp, report_id, n, report_type, if_stand, return_type)`
|
||||
## `accOfNReport(exp, report_id, n, report_type, if_stand, return_type)`
|
||||
|
||||
N期加速度算子
|
||||
|
||||
@@ -15,14 +15,14 @@ N期加速度算子
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600519");?
|
||||
return ACCOfNReport(@Last12MData(DefaultRepID(),46078),20201231,8,1);
|
||||
```
|
||||
|
||||
### `accOfNReport2(exp, report_id, n)`
|
||||
## `accOfNReport2(exp, report_id, n)`
|
||||
|
||||
N季加速度,与ACCOfNReport的区别在于仅支持季度数据计算,与系统证券相关
|
||||
|
||||
@@ -34,7 +34,7 @@ N季加速度,与ACCOfNReport的区别在于仅支持季度数据计算,与
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -44,7 +44,7 @@ N:=8;
|
||||
return RobustACCOfNReport2(Exp,ReportID,N); //-0.2568
|
||||
```
|
||||
|
||||
### `avgOfNReport(exp, report_id, n, report_type)`
|
||||
## `avgOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间报告期Exp指标平均值,与系统参数(股票)相关。
|
||||
|
||||
@@ -57,7 +57,7 @@ return RobustACCOfNReport2(Exp,ReportID,N); //-0.2568
|
||||
|
||||
返回:float
|
||||
|
||||
### `avgOfNReport2(exp, report_id, n)`
|
||||
## `avgOfNReport2(exp, report_id, n)`
|
||||
|
||||
N个季度报告期数据的平均值,与系统证券相关
|
||||
|
||||
@@ -69,7 +69,7 @@ N个季度报告期数据的平均值,与系统证券相关
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -79,7 +79,7 @@ N:=8;
|
||||
return AvgOfNReport2(Exp,ReportID,N); //122912375000
|
||||
```
|
||||
|
||||
### `continuedMatchOfNReport(exp, report_id, n)`
|
||||
## `continuedMatchOfNReport(exp, report_id, n)`
|
||||
|
||||
当前时间ReportID向前推N年,若从ReportID-N到ReportID时间均存在报告Exp则返回1,否则返回0,与系统参数(股票)相关。
|
||||
|
||||
@@ -91,7 +91,7 @@ return AvgOfNReport2(Exp,ReportID,N); //122912375000
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
判断2014到2015这两年平安银行年报是否全部存在
|
||||
@@ -99,7 +99,7 @@ SetSysParam(pn_stock(),'SZ000001');
|
||||
return ContinuedMatchOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,2);
|
||||
```
|
||||
|
||||
### `eaaOfNReport(exp, report_id, last_report_type)`
|
||||
## `eaaOfNReport(exp, report_id, last_report_type)`
|
||||
|
||||
N期加速度EAA
|
||||
|
||||
@@ -111,7 +111,7 @@ N期加速度EAA
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600519");
|
||||
@@ -122,7 +122,7 @@ t:=EAAOfNReport(Exp,ReportID,LastReportType);
|
||||
return t; //-0.016
|
||||
```
|
||||
|
||||
### `eavOfNReport(exp, report_id, n, report_type, last_report_type)`
|
||||
## `eavOfNReport(exp, report_id, n, report_type, last_report_type)`
|
||||
|
||||
N期加速度EAV
|
||||
|
||||
@@ -136,7 +136,7 @@ N期加速度EAV
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600519");
|
||||
@@ -149,7 +149,7 @@ t:=EAVOfNReport(Exp,ReportID,N,ReportType,LastReportType);
|
||||
return t; //-0.45
|
||||
```
|
||||
|
||||
### `growthOfNReport(exp, report_id, n, return_type)`
|
||||
## `growthOfNReport(exp, report_id, n, return_type)`
|
||||
|
||||
当前时间ReportID向前推N年,返回从ReportID-N与ReportID表达式Exp指标的增长比例,其中returntype决定增长模式,与系统参数(股票)相关。
|
||||
|
||||
@@ -162,7 +162,7 @@ return t; //-0.45
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
返回平安银行2014年与2015年报营业收入增长比例
|
||||
@@ -170,7 +170,7 @@ SetSysParam(pn_stock(),'SZ000001');
|
||||
return GrowthOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,1,1);
|
||||
```
|
||||
|
||||
### `highestOfNReport(exp, report_id, n, report_type)`
|
||||
## `highestOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
表达式N期最高
|
||||
|
||||
@@ -183,14 +183,14 @@ return GrowthOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return HighestOfNReport(@ReportOfAll(46080,DefaultRepID()),20221231,5,0);
|
||||
```
|
||||
|
||||
### `highGrowthOfNReport(exp, report_id, n, report_type, range)`
|
||||
## `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)
|
||||
|
||||
@@ -204,7 +204,7 @@ N期高速增长拐点:最近N期中,第N期数据上升且大于前N-1期
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SZ002340");
|
||||
@@ -217,7 +217,7 @@ t:=HighGrowthOfNReport(Exp,ReportID,N,ReportType,Range);
|
||||
return t; //1
|
||||
```
|
||||
|
||||
### `lowestOfNReport(exp, report_id, n, report_type)`
|
||||
## `lowestOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
表达式N期最低
|
||||
|
||||
@@ -230,14 +230,14 @@ return t; //1
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return lowestOfNReport(@ReportOfAll(46080,DefaultRepID()),20221231,5,0);
|
||||
```
|
||||
|
||||
### `occuredOfNReport(exp, report_id, n)`
|
||||
## `occuredOfNReport(exp, report_id, n)`
|
||||
|
||||
当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间发生报告Exp的次数,与系统参数(股票)相关。
|
||||
|
||||
@@ -249,7 +249,7 @@ return lowestOfNReport(@ReportOfAll(46080,DefaultRepID()),20221231,5,0);
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
返回平安银行截止到2015年12月31日的所有年报数量
|
||||
@@ -257,7 +257,7 @@ SetSysParam(pn_stock(),'SZ000001');
|
||||
returnOccuredOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,100);
|
||||
```
|
||||
|
||||
### `occuredRepIdOfNReport(exp, report_id, n)`
|
||||
## `occuredRepIdOfNReport(exp, report_id, n)`
|
||||
|
||||
当前时间ReportID向前推N年,若从ReportID-N到ReportID时间存在报告Exp则返回报告期,与系统参数(股票)相关。
|
||||
|
||||
@@ -269,7 +269,7 @@ returnOccuredOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,
|
||||
|
||||
返回:any
|
||||
|
||||
### `refReportValue(exp, report_id, n)`
|
||||
## `refReportValue(exp, report_id, n)`
|
||||
|
||||
当前时间ReportID向前推N年,返回ReportID-N时间点表达式 Exp指标值,与系统参数(股票)相关。
|
||||
|
||||
@@ -281,7 +281,7 @@ returnOccuredOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
返回平安银行2015年年报营业收入额
|
||||
@@ -289,7 +289,7 @@ SetSysParam(pn_stock(),'SZ000001');
|
||||
return RefReportValue(@reportofall(46002,GetSysParam('DefaultRepID')),20161231,1);
|
||||
```
|
||||
|
||||
### `robustAccOfNReport(exp, report_id, n, report_type, last_report_type)`
|
||||
## `robustAccOfNReport(exp, report_id, n, report_type, last_report_type)`
|
||||
|
||||
N期稳健加速度
|
||||
|
||||
@@ -303,14 +303,14 @@ N期稳健加速度
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600519");
|
||||
return RobustACCOfNReport(@Last12MData(DefaultRepID(),9900604),20201231,8,0); // -0.0878801178157446
|
||||
```
|
||||
|
||||
### `robustAccOfNReport2(exp, report_id, n)`
|
||||
## `robustAccOfNReport2(exp, report_id, n)`
|
||||
|
||||
N季稳健加速度,与RobustACCOfNReport的区别在于仅支持季度数据计算,与系统证券相关
|
||||
|
||||
@@ -322,7 +322,7 @@ N季稳健加速度,与RobustACCOfNReport的区别在于仅支持季度数据
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -332,7 +332,7 @@ N:=8;
|
||||
return RobustACCOfNReport2(Exp,ReportID,N); //-0.2568
|
||||
```
|
||||
|
||||
### `robustGrowthOfNReport2(exp, report_id, n)`
|
||||
## `robustGrowthOfNReport2(exp, report_id, n)`
|
||||
|
||||
N季稳健增速,与RobustGrowthOfNReport的区别在于仅支持季度数据计算,与系统证券相关
|
||||
|
||||
@@ -344,7 +344,7 @@ N季稳健增速,与RobustGrowthOfNReport的区别在于仅支持季度数据
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -354,7 +354,7 @@ N:=8;
|
||||
return RobustGrowthOfNReport2(Exp,ReportID,N); //-0.3269
|
||||
```
|
||||
|
||||
### `secondOrderGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
## `secondOrderGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
N期二阶增长拐点:最近N期中,前N-1期逐渐下降,第N期数据上升 l 参数: Exp:表达式类型,计算相关财务指标,一般与报告期相关,如TTM归属母公司净利润:@Last12MData(DefaultRepID(),46078) ReportID:报告期 N:整数,最近N期 ReportType:报告期类型 取值 含义 备注 0 年度标准(默认) 假设ReportID:=20200930,N=2,对应最近N个报告期为20190930、20200930 1 季度标准 假设ReportID:=20200930,N=2,对应最近N个报告期为20200630、20200930
|
||||
|
||||
@@ -367,7 +367,7 @@ N期二阶增长拐点:最近N期中,前N-1期逐渐下降,第N期数据
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SZ000636");
|
||||
@@ -379,7 +379,7 @@ t:=SecondOrderGrowthOfNReport(Exp,ReportID,N,ReportType);
|
||||
return t; //1
|
||||
```
|
||||
|
||||
### `standGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
## `standGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
N期标准化增长率
|
||||
|
||||
@@ -392,7 +392,7 @@ N期标准化增长率
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600519");
|
||||
@@ -404,7 +404,7 @@ t:=StandGrowthOfNReport(Exp,ReportID,N,ReportType);
|
||||
return t; //1.265
|
||||
```
|
||||
|
||||
### `stdOfNReport2(exp, report_id, n)`
|
||||
## `stdOfNReport2(exp, report_id, n)`
|
||||
|
||||
N个季度报告期数据的标准差,与系统证券相关
|
||||
|
||||
@@ -416,7 +416,7 @@ N个季度报告期数据的标准差,与系统证券相关
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -426,7 +426,7 @@ N:=8;
|
||||
return StdOfNReport2(Exp,ReportID,N); //56286669451.8528
|
||||
```
|
||||
|
||||
### `sumOfNReport(exp, report_id, n)`
|
||||
## `sumOfNReport(exp, report_id, n)`
|
||||
|
||||
当前时间ReportID向前推N年,返回从ReportID-N到ReportID时间报告期Exp指标和,与系统参数(股票)相关。
|
||||
|
||||
@@ -438,7 +438,7 @@ return StdOfNReport2(Exp,ReportID,N); //56286669451.8528
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
计算平安银行2015年报与2014年报营业收入的和
|
||||
@@ -446,7 +446,7 @@ SetSysParam(pn_stock(),'SZ000001');
|
||||
return SumOfNReport(@reportofall(46002,GetSysParam('DefaultRepID')),20151231,2);
|
||||
```
|
||||
|
||||
### `sumOfNReport2(exp, report_id, n)`
|
||||
## `sumOfNReport2(exp, report_id, n)`
|
||||
|
||||
N个季度报告期数据之和,与系统证券相关
|
||||
|
||||
@@ -458,7 +458,7 @@ N个季度报告期数据之和,与系统证券相关
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600000");
|
||||
@@ -468,7 +468,7 @@ N:=8;
|
||||
return SumOfNReport2(Exp,ReportID,N); //983299000000
|
||||
```
|
||||
|
||||
### `turnPositiveOfNReport(exp, report_id, n, report_type)`
|
||||
## `turnPositiveOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
N期转正拐点:最近N期中,前N-1期数据小于0,第N期数据大于0
|
||||
|
||||
@@ -481,7 +481,7 @@ N期转正拐点:最近N期中,前N-1期数据小于0,第N期数据大于0
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SH600110");
|
||||
@@ -493,20 +493,20 @@ t:=TurnPositiveOfNReport(Exp,ReportID,N,ReportType);
|
||||
return t; //1
|
||||
```
|
||||
|
||||
### `robustGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
## `robustGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
|
||||
过去N期稳健增速,与系统证券相关
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `exp` | TExpression | 表达式类型,计算相关财务指标,一般与报告期相关,通常以增长率来表示增速. |
|
||||
| `report_id` | RDate | 报告期 |
|
||||
| `n` | Int | 整数,最近N期 |
|
||||
| `report_type` | Int | 报告期类型 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | ----------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | 表达式类型,计算相关财务指标,一般与报告期相关,通常以增长率来表示增速. |
|
||||
| `report_id` | RDate | 报告期 |
|
||||
| `n` | Int | 整数,最近N期 |
|
||||
| `report_type` | Int | 报告期类型 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setSysParam(pn_stock(),"SH600519");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / N日
|
||||
|
||||
### `deltaOfNDay(exp, n)`
|
||||
## `deltaOfNDay(exp, n)`
|
||||
|
||||
当前值-前N日值。
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -19,7 +19,7 @@ SetSysParam(pn_date(),20231010T);
|
||||
return DeltaOfNDay(@close(),5);
|
||||
```
|
||||
|
||||
### `percentRankOfNDay(exp, n, cache_str)`
|
||||
## `percentRankOfNDay(exp, n, cache_str)`
|
||||
|
||||
当前值在最近N天的百分位排名,Nan值不参与排名。
|
||||
|
||||
@@ -31,7 +31,7 @@ return DeltaOfNDay(@close(),5);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -39,7 +39,7 @@ SetSysParam(pn_date(),20231030T);
|
||||
return PercentRankOfNDay(@close(),10,"");
|
||||
```
|
||||
|
||||
### `signedPower(exp, n)`
|
||||
## `signedPower(exp, n)`
|
||||
|
||||
符号次方。特殊当x=0时,N<0,返回Nan;N=0, 返回1;N>0, 返回0。
|
||||
|
||||
@@ -50,7 +50,7 @@ return PercentRankOfNDay(@close(),10,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -58,7 +58,7 @@ SetSysParam(pn_date(),20231030T);
|
||||
return SignedPower(@close(),3);
|
||||
```
|
||||
|
||||
### `slopeofNday(exp1, exp2, n, cache_str)`
|
||||
## `slopeofNday(exp1, exp2, n, cache_str)`
|
||||
|
||||
N日线性回归系数。
|
||||
|
||||
@@ -71,7 +71,7 @@ N日线性回归系数。
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -79,7 +79,7 @@ SetSysParam(pn_date(),20231030T);
|
||||
return SlopeofNday(@close(),@open(),30,"");
|
||||
```
|
||||
|
||||
### `wmaofNday(exp, n, cache_astr)`
|
||||
## `wmaofNday(exp, n, cache_astr)`
|
||||
|
||||
N日衰减加权。最新值权重最大,权重归一化,结果同DecayAvgOfNDay。
|
||||
|
||||
@@ -91,11 +91,10 @@ N日衰减加权。最新值权重最大,权重归一化,结果同DecayAvgOf
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
SetSysParam(pn_date(),20231030T);
|
||||
return WmaofNday(@open(),30,"");
|
||||
```
|
||||
|
||||
|
||||
@@ -1,186 +1,186 @@
|
||||
# 数据仓库 / 周期函数
|
||||
|
||||
### `cy10M()`
|
||||
## `Cy_10m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy10S()`
|
||||
## `Cy_10s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy120M()`
|
||||
## `Cy_120m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy12S()`
|
||||
## `Cy_12s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy15M()`
|
||||
## `Cy_15m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy15S()`
|
||||
## `Cy_15s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy1M()`
|
||||
## `Cy_1m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy1S()`
|
||||
## `Cy_1s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy20M()`
|
||||
## `Cy_20m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy20S()`
|
||||
## `Cy_20s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy2M()`
|
||||
## `Cy_2m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy2S()`
|
||||
## `Cy_2s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy30M()`
|
||||
## `Cy_30m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy30S()`
|
||||
## `Cy_30s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy3M()`
|
||||
## `Cy_3m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy3S()`
|
||||
## `Cy_3s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy40M()`
|
||||
## `Cy_40m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy4S()`
|
||||
## `Cy_4s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy5M()`
|
||||
## `Cy_5m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy5S()`
|
||||
## `Cy_5s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy60M()`
|
||||
## `Cy_60m()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cy6S()`
|
||||
## `Cy_6s()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyDay()`
|
||||
## `Cy_day()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyDetail()`
|
||||
## `Cy_Detail()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyHalfs()`
|
||||
## `Cy_Halfs()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyHalfYear()`
|
||||
## `Cy_HalfYear()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyMonth()`
|
||||
## `Cy_month()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyQuarter()`
|
||||
## `Cy_Quarter()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyTwoYear()`
|
||||
## `Cy_TwoYear()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyWeek()`
|
||||
## `Cy_week()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `cyYear()`
|
||||
## `Cy_Year()`
|
||||
|
||||
周期函数相关函数。
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
||||
# 数据仓库 / 判定函数
|
||||
|
||||
### `baseExists(info_id, _order)`
|
||||
## `baseExists(info_id, _order)`
|
||||
|
||||
返回是否存在某项和报告期无关的数据,例如公司简称、注册地址等
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --------- | ---- | ----------------------------------------------------------------------- |
|
||||
| `info_id` | int | 信息类别代码,infoID参见附录。 |
|
||||
| `_order` | int | 省略此参数取最后一次更新,否则为第几条数据。0表示第一条,-1表示最后一条 |
|
||||
| `_order` | int | 省略此参数取最后一次更新,否则为第几条数据。0表示第一条,-1表示最后一条 |
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ000002');
|
||||
@@ -19,7 +19,7 @@ if BaseExists(10002) then
|
||||
return base(10002);
|
||||
```
|
||||
|
||||
### `basicIdExists(id)`
|
||||
## `basicIdExists(id)`
|
||||
|
||||
返回某信息ID是否存在
|
||||
|
||||
@@ -29,7 +29,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `continuedMatchOfRepPeriod(expr, beg_report, end_year)`
|
||||
## `continuedMatchOfRepPeriod(expr, beg_report, end_year)`
|
||||
|
||||
判断在区间BegReport到EndYear中是否存在运行表达式Exp的值,若存在返回1,否则返回0。
|
||||
|
||||
@@ -41,7 +41,7 @@ return base(10002);
|
||||
|
||||
返回:any
|
||||
|
||||
### `getExpCaceStr(exp, cache_str)`
|
||||
## `getExpCaceStr(exp, cache_str)`
|
||||
|
||||
判断是否缓存以及返回缓存串。
|
||||
|
||||
@@ -52,7 +52,7 @@ return base(10002);
|
||||
|
||||
返回:string
|
||||
|
||||
### `isBalanceInfoId(infold)`
|
||||
## `isBalanceInfoId(infold)`
|
||||
|
||||
是否是资产负债表指标。是则返回1,否则返回0。
|
||||
|
||||
@@ -62,7 +62,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isCashFlowInfoId(infold)`
|
||||
## `isCashFlowInfoId(infold)`
|
||||
|
||||
判断是否是现金流量表指标,如果是则返回1,否则返回0。
|
||||
|
||||
@@ -72,7 +72,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isFinancialInfoId(info_id)`
|
||||
## `isFinancialInfoId(info_id)`
|
||||
|
||||
是否是主要财务指标(仅Wind适用),兼容Wind的主要财务指标也计算最近12个月的数据。
|
||||
|
||||
@@ -82,7 +82,7 @@ return base(10002);
|
||||
|
||||
返回:int
|
||||
|
||||
### `isFundBalanceSheetInfoId(infold)`
|
||||
## `isFundBalanceSheetInfoId(infold)`
|
||||
|
||||
是否是基金资产负债表字段。是则返回1,否则返回0。
|
||||
|
||||
@@ -92,7 +92,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isFundInterestInfoId(infold)`
|
||||
## `isFundInterestInfoId(infold)`
|
||||
|
||||
是否是基金利润分配表表字段。是则返回1,否则返回0。
|
||||
|
||||
@@ -102,7 +102,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isInterestInfoId(infold)`
|
||||
## `isInterestInfoId(infold)`
|
||||
|
||||
是否是利润分配表指标。是则返回1,否则返回0。
|
||||
|
||||
@@ -112,7 +112,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isMainReportId(infold)`
|
||||
## `isMainReportId(infold)`
|
||||
|
||||
判断是否是主要报告指标,如果是返回1,否则返回0。指标包括资产负债表,利润分配表,现金流量表,基金资产负债表,基金利润分配表,股票财务指标。
|
||||
|
||||
@@ -122,7 +122,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isStock(stock_id)`
|
||||
## `isStock(stock_id)`
|
||||
|
||||
判定函数相关函数。
|
||||
|
||||
@@ -132,7 +132,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isStockFinancialItem(infold)`
|
||||
## `isStockFinancialItem(infold)`
|
||||
|
||||
是否是股票财务指标。是则返回1,否则返回0。
|
||||
|
||||
@@ -142,7 +142,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isTimePeriodInfoId(info_id)`
|
||||
## `isTimePeriodInfoId(info_id)`
|
||||
|
||||
是否是时段指标。
|
||||
|
||||
@@ -152,7 +152,7 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isTradeDay(date)`
|
||||
## `isTradeDay(date)`
|
||||
|
||||
如果当前股票在Date指定日交易则返回1,否则返回0。 该函数的判断是依据指定日是否有日线行情数据,不管当日是否有成交量。 比如期货不活跃时,当日可能没有成交量,但是也有行情数据,则判断当日也是交易日。 一般用于判断当前股票在指定日是否停牌。 支持周期:日线及更低频,比如周线、月线等。若是周线,则判断这一周内是否有日线数据,若有则为真,若一条都没有则为假。即,不支持高频的判定。
|
||||
|
||||
@@ -162,14 +162,14 @@ return base(10002);
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ000002');
|
||||
return IsTradeDay(inttodate(20110828));//返回0
|
||||
```
|
||||
|
||||
### `isValidCode(id, full_id)`
|
||||
## `isValidCode(id, full_id)`
|
||||
|
||||
判断是否为合法的代码。判断是否合法代码的规则与isstock类似。如果ID是合法的代码,FullID返回的值为标准化后的天软代码,否则为0。
|
||||
|
||||
@@ -180,7 +180,7 @@ return IsTradeDay(inttodate(20110828));//返回0
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isValidPositiveValue(v)`
|
||||
## `isValidPositiveValue(v)`
|
||||
|
||||
判断是否为大于0的实数,如果是返回1,否则返回0。
|
||||
|
||||
@@ -190,7 +190,7 @@ return IsTradeDay(inttodate(20110828));//返回0
|
||||
|
||||
返回:bool
|
||||
|
||||
### `isValidValue(v)`
|
||||
## `isValidValue(v)`
|
||||
|
||||
判断V是否是一个数字类型(整数或者实数),如果是非空实数,则返回1,否则返回0。
|
||||
|
||||
@@ -200,7 +200,7 @@ return IsTradeDay(inttodate(20110828));//返回0
|
||||
|
||||
返回:bool
|
||||
|
||||
### `reportExists(info_id, report_id)`
|
||||
## `reportExists(info_id, report_id)`
|
||||
|
||||
返回是否存在某个报告期的某项财务指标
|
||||
|
||||
@@ -211,14 +211,14 @@ return IsTradeDay(inttodate(20110828));//返回0
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SH601888');
|
||||
return ReportExists(18007,20101231); //返回1,是
|
||||
```
|
||||
|
||||
### `reportHistExists(infoid)`
|
||||
## `reportHistExists(infoid)`
|
||||
|
||||
返回某项数据是否存在有报告
|
||||
|
||||
@@ -228,14 +228,14 @@ return ReportExists(18007,20101231); //返回1,是
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ300002');
|
||||
return ReportHistExists(18007);
|
||||
```
|
||||
|
||||
### `testStock(stock_id)`
|
||||
## `testStock(stock_id)`
|
||||
|
||||
判定函数相关函数。
|
||||
|
||||
@@ -245,7 +245,7 @@ return ReportHistExists(18007);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `validFullCode(stock_id)`
|
||||
## `validFullCode(stock_id)`
|
||||
|
||||
判定函数相关函数。
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 区间
|
||||
|
||||
### `avgOfRepPeriod(exp, begreport, end_year)`
|
||||
## `avgOfRepPeriod(exp, begreport, end_year)`
|
||||
|
||||
返回当前股票从报告期BegReport到EndYear同季度报告期的Expr指标的平均值,与系统参数(股票)相关。
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
平安银行2015到2018四个一季报营业收入的平均值
|
||||
@@ -20,7 +20,7 @@ SetSysParam(pn_stock(),'sz000001');
|
||||
return AvgOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);
|
||||
```
|
||||
|
||||
### `avgOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
## `avgOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
|
||||
表达式区间平均
|
||||
|
||||
@@ -33,14 +33,14 @@ return AvgOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return AvgOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
|
||||
```
|
||||
|
||||
### `growthOfRepPeriod2(exp, beg_report, end_report, return_type, report_type)`
|
||||
## `growthOfRepPeriod2(exp, beg_report, end_report, return_type, report_type)`
|
||||
|
||||
表达式区间增长
|
||||
|
||||
@@ -54,14 +54,14 @@ return AvgOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return GrowthOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,1);
|
||||
```
|
||||
|
||||
### `highestOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
## `highestOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
|
||||
表达式区间最高
|
||||
|
||||
@@ -74,14 +74,14 @@ return GrowthOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),202012
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return HighestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
|
||||
```
|
||||
|
||||
### `kurtosisOfPeriod(exp, beg_date, end_date)`
|
||||
## `kurtosisOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间峰度
|
||||
|
||||
@@ -93,14 +93,14 @@ return HighestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return KurtosisOfPeriod(@close(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `lowestOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
## `lowestOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
|
||||
表达式区间最低
|
||||
|
||||
@@ -113,14 +113,14 @@ return KurtosisOfPeriod(@close(),20230101T,20231010T);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return LowestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
|
||||
```
|
||||
|
||||
### `medianOfPeriod(exp, beg_date, end_date)`
|
||||
## `medianOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间中位数
|
||||
|
||||
@@ -132,14 +132,14 @@ return LowestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),202012
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return MedianOfPeriod(@close(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `occuredOfPeriod(exp, beg_date, end_date)`
|
||||
## `occuredOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间发生次数
|
||||
|
||||
@@ -151,14 +151,14 @@ return MedianOfPeriod(@close(),20230101T,20231010T);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return OccuredOfPeriod(@IsUp(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `occuredOfRepPeriod(exp, begreport, end_year)`
|
||||
## `occuredOfRepPeriod(exp, begreport, end_year)`
|
||||
|
||||
返回当前股票从BegReport到EndYear的同季度报告期数,与系统参数(股票)相关。
|
||||
|
||||
@@ -170,14 +170,14 @@ return OccuredOfPeriod(@IsUp(),20230101T,20231010T);
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),'SZ000001');
|
||||
return OccuredOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);//即返回2015年到2018年一季报的数量
|
||||
```
|
||||
|
||||
### `percentRankOfPeriod(exp, beg_date, end_date)`
|
||||
## `percentRankOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间分位数
|
||||
|
||||
@@ -189,14 +189,14 @@ return OccuredOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),201503
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return PercentRankOfPeriod(@close(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `skewnessOfPeriod(exp, beg_date, end_date)`
|
||||
## `skewnessOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间偏度
|
||||
|
||||
@@ -208,14 +208,14 @@ return PercentRankOfPeriod(@close(),20230101T,20231010T);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return SkewnessOfPeriod(@close(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `stdOfPeriod(exp, beg_date, end_date)`
|
||||
## `stdOfPeriod(exp, beg_date, end_date)`
|
||||
|
||||
表达式区间标准差
|
||||
|
||||
@@ -227,14 +227,14 @@ return SkewnessOfPeriod(@close(),20230101T,20231010T);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
return StdOfPeriod(@close(),20230101T,20231010T);
|
||||
```
|
||||
|
||||
### `stdOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
## `stdOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
|
||||
表达式区间标准差
|
||||
|
||||
@@ -247,14 +247,14 @@ return StdOfPeriod(@close(),20230101T,20231010T);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return StdOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
|
||||
```
|
||||
|
||||
### `sumOfRepPeriod(exp, begreport, end_year)`
|
||||
## `sumOfRepPeriod(exp, begreport, end_year)`
|
||||
|
||||
返回当前股票Expr指标从报告期BegReport到EndYear同季度报告期的和,与系统参数(股票)相关。
|
||||
|
||||
@@ -266,7 +266,7 @@ return StdOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
平安银行2015到2018四个一季报营业收入的和
|
||||
@@ -274,7 +274,7 @@ SetSysParam(pn_stock(),'sz000001');
|
||||
return SumOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);
|
||||
```
|
||||
|
||||
### `sumOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
## `sumOfRepPeriod2(exp, beg_report, end_report, report_type)`
|
||||
|
||||
表达式区间和
|
||||
|
||||
@@ -287,10 +287,9 @@ return SumOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SZ000001");
|
||||
return SumOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
|
||||
```
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# 数据仓库 / 选股与取数
|
||||
|
||||
### `defaultRepId()`
|
||||
## `defaultRepId()`
|
||||
|
||||
选股与取数相关函数。
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
oV:=BackUpSystemParameters2();
|
||||
@@ -16,7 +16,7 @@ V:=ReportNew(46002,RDate);
|
||||
return v;
|
||||
```
|
||||
|
||||
### `evalstring(s)`
|
||||
## `evalstring(s)`
|
||||
|
||||
内核使用,返回表达式s的值。
|
||||
|
||||
@@ -26,7 +26,7 @@ return v;
|
||||
|
||||
返回:int
|
||||
|
||||
### `queryBk(arg1, arg2, expression_3, arg4, arg5, expression_6, arg7, expression_8, arg9, expression_10, arg11, expression_12)`
|
||||
## `queryBk(arg1, arg2, expression_3, arg4, arg5, expression_6, arg7, expression_8, arg9, expression_10, arg11, expression_12)`
|
||||
|
||||
选股与取数相关函数。
|
||||
|
||||
@@ -47,7 +47,7 @@ return v;
|
||||
|
||||
返回:array
|
||||
|
||||
### `queryBkWithPeriod(arg1, arg2, expression_3, arg4, arg5, expression_6, arg7, expression_8, arg9, expression_10)`
|
||||
## `queryBkWithPeriod(arg1, arg2, expression_3, arg4, arg5, expression_6, arg7, expression_8, arg9, expression_10)`
|
||||
|
||||
选股与取数相关函数。
|
||||
|
||||
@@ -66,7 +66,7 @@ return v;
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_begt(),inttodate(20120801));
|
||||
@@ -78,28 +78,28 @@ QueryBKWithPeriod("深证A股","",@True,"","换手率(%)(加权,只考虑A股)",
|
||||
"成交金额(万)(只考虑A股)",@Bk_AmountSum3(1));
|
||||
```
|
||||
|
||||
### `qwpMaxCount()`
|
||||
## `qwpMaxCount()`
|
||||
|
||||
选股与取数相关函数。
|
||||
|
||||
返回:int
|
||||
|
||||
### `query(market_list, stock_id_list, condition, sort_field, field_name_n, expression_n)`
|
||||
## `query(market_list, stock_id_list, condition, sort_field, field_name_n, expression_n)`
|
||||
|
||||
报表生成函数,在指定的市场列表MarketList和股票列表内满足条件的股票列出来,并按照SortName排序,并列出相关的数据信息
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | ------------------------------------------------------------- |
|
||||
| `market_list` | String | 市场板块列表,字符串 |
|
||||
| `stock_id_list` | string | 股票ID列表,字符串 |
|
||||
| `condition` | Boolean | 布尔型,选股条件,如果只取值,没有条件限制,则condition取true |
|
||||
| `sort_field` | String | 字符串,排序字段 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --------------- | ----------- | ------------------------------------------------------------- |
|
||||
| `market_list` | String | 市场板块列表,字符串 |
|
||||
| `stock_id_list` | string | 股票ID列表,字符串 |
|
||||
| `condition` | Boolean | 布尔型,选股条件,如果只取值,没有条件限制,则condition取true |
|
||||
| `sort_field` | String | 字符串,排序字段 |
|
||||
| `field_name_n` | String | 字符串,字段名称 |
|
||||
| `expression_n` | texpression | TExpression表达式,字段内容 |
|
||||
| `expression_n` | texpression | TExpression表达式,字段内容 |
|
||||
|
||||
返回:array,tablearray
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//查询指定日期,在板块上证A股;创业板以及SZ000001;SZ000002;SZ000997中满足
|
||||
@@ -114,18 +114,18 @@ return data;
|
||||
结果:
|
||||
```
|
||||
|
||||
### `getDataByMd(stockid, n)`
|
||||
## `getDataByMd(stockid, n)`
|
||||
|
||||
使用Md获取指定日数据,与系统参数(时间)相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `stockid` | String | 字符串。证券代码 |
|
||||
| `n` | Integer | 整数。第几个数据 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --------- | ------- | ---------------- |
|
||||
| `stockid` | String | 字符串。证券代码 |
|
||||
| `n` | Integer | 整数。第几个数据 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
// "MA110C2375"在20210322日的开仓手续费额
|
||||
@@ -134,18 +134,18 @@ return getDataByMd("MA110C2375.SP",1);
|
||||
//结果:0.5
|
||||
```
|
||||
|
||||
### `getDataByMd2(stockid, n)`
|
||||
## `getDataByMd2(stockid, n)`
|
||||
|
||||
使用Md获取指定日数据(考虑交易日),与系统参数(时间)相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `stockid` | String | 字符串。证券代码 |
|
||||
| `n` | Integer | 整数。第几个数据 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --------- | ------- | ---------------- |
|
||||
| `stockid` | String | 字符串。证券代码 |
|
||||
| `n` | Integer | 整数。第几个数据 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
// "MA110C2375"在20210322日的开仓手续费额
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 系统参数设置和获取函数
|
||||
|
||||
### `cyclefilter()`
|
||||
## `cyclefilter()`
|
||||
|
||||
设置周期过滤器以及集合竞价分离器。它是系统参数键,不是函数调用。
|
||||
|
||||
@@ -10,32 +10,29 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `getSysParam(param_name)`
|
||||
## `getSysParam(param_name)`
|
||||
|
||||
返回系统参数的值。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ----------- | ---------- | ------------------------ |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------ | ---------- | ------------------------ |
|
||||
| `param_name` | widestring | 字符串类型,系统参数名。 |
|
||||
|
||||
返回:any
|
||||
|
||||
|
||||
### `setSysParam(param_name, param_value)`
|
||||
## `setSysParam(param_name, param_value)`
|
||||
|
||||
设置系统参数,既对本地执行有效,也对平台执行有效。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------ | ---------- | ------------------------ |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ---------- | ------------------------ |
|
||||
| `param_name` | WideString | 字符串类型,系统参数名。 |
|
||||
| `param_value` | olevariant | 要设置的系统参数值。 |
|
||||
|
||||
返回:any
|
||||
|
||||
|
||||
### `nDay()`
|
||||
## `nDay()`
|
||||
|
||||
整数类型,NDAY默认返回的点数系统参数,读写。
|
||||
|
||||
返回:any
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 系统参数名称函数
|
||||
|
||||
### `pnCalcCtrlWord(return_value)`
|
||||
## `pn_CalcCTRLWord(return_value)`
|
||||
|
||||
系统参数常量"CalcCTRLWord"; 控制nil参与计算以及浮点除0的警告或者出错
|
||||
|
||||
@@ -10,97 +10,97 @@
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnChangedDateMode()`
|
||||
## `pn_ChangedDateMode()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnCycle()`
|
||||
## `pn_Cycle()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnDate()`
|
||||
## `pn_Date()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnEmptymode()`
|
||||
## `Pn_Emptymode()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnFreeCycle()`
|
||||
## `pn_FreeCycle()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnI64Trans()`
|
||||
## `Pn_I64Trans()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnNDay()`
|
||||
## `pn_nDay()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnNilTrans()`
|
||||
## `pn_NilTrans()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnNoRaiseNoData()`
|
||||
## `pn_NoRaiseNoData()`
|
||||
|
||||
获取/设置“无数据不抛异常”的系统参数键。
|
||||
|
||||
返回:array
|
||||
|
||||
### `pnPrecision()`
|
||||
## `pn_Precision()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnRate()`
|
||||
## `pn_Rate()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnRateDay()`
|
||||
## `pn_RateDay()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnReportMode()`
|
||||
## `pn_ReportMode()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnReportType()`
|
||||
## `pnReportType()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnStock()`
|
||||
## `pn_Stock()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
返回:string
|
||||
|
||||
### `pnViewPoint()`
|
||||
## `pn_ViewPoint()`
|
||||
|
||||
返回数据仓库相关系统参数名。
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 时间相关函数
|
||||
|
||||
### `firstDay(stock_id)`
|
||||
## `firstDay(stock_id)`
|
||||
|
||||
时间相关函数相关函数。
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
返回:datetime
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ000002');
|
||||
Return firstday();//33240(1991-01-02);
|
||||
```
|
||||
|
||||
### `lastDay(stock_id)`
|
||||
## `lastDay(stock_id)`
|
||||
|
||||
时间相关函数相关函数。
|
||||
|
||||
@@ -27,10 +27,9 @@ Return firstday();//33240(1991-01-02);
|
||||
|
||||
返回:datetime
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),'SZ000002');
|
||||
return lastday();//40794 (2011-09-08)
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 时间序列统计
|
||||
|
||||
### `spMedian(arg1, arg2)`
|
||||
## `sp_median(arg1, arg2)`
|
||||
|
||||
时间序列统计相关函数。
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `spMode(arg1, arg2)`
|
||||
## `sp_mode(arg1, arg2)`
|
||||
|
||||
时间序列统计相关函数。
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `spNorm(stock_id, arg2)`
|
||||
## `sp_norm(stock_id, arg2)`
|
||||
|
||||
时间序列统计相关函数。
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `spProduct(stock_id, arg2)`
|
||||
## `sp_product(stock_id, arg2)`
|
||||
|
||||
时间序列统计相关函数。
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `spRank(arg1, arg2, arg3)`
|
||||
## `sp_rank(arg1, arg2, arg3)`
|
||||
|
||||
时间序列统计相关函数。
|
||||
|
||||
@@ -56,19 +56,19 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `hhv(exp, n, cache_string)`
|
||||
## `hhv(exp, n, cache_string)`
|
||||
|
||||
返回N日最高的Exp的值,与系统参数(股票、时间、周期等相关),查看相关行情数据说明。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,从上市日算起;注意,计算上市以来的最高/最低时,0必须用常量。比如hhv(high(),0)。不能以变量的方式传递:N:=0; hhv(high(),N),会报错。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,从上市日算起;注意,计算上市以来的最高/最低时,0必须用常量。比如hhv(high(),0)。不能以变量的方式传递:N:=0; hhv(high(),N),会报错。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//获取万科A(SZ000002)截止2011-09-09日14个交易日内的最高,最低的收盘价以及
|
||||
@@ -85,33 +85,31 @@ return r;
|
||||
结果:
|
||||
```
|
||||
|
||||
|
||||
### `llv(exp, n, cache_string)`
|
||||
## `llv(exp, n, cache_string)`
|
||||
|
||||
返回N日最低的Exp的值,与系统参数(股票、时间、周期等相关),查看相关行情数据说明。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,从上市日算起;N为负数时无效。注意,计算上市以来的最高/最低时,0必须用常量。比如llv(close(),0)。不能以变量的方式:N:=0; llv(close(),N),会报错。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,从上市日算起;N为负数时无效。注意,计算上市以来的最高/最低时,0必须用常量。比如llv(close(),0)。不能以变量的方式:N:=0; llv(close(),N),会报错。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
|
||||
### `ma(exp, n, cache_string)`
|
||||
## `ma(exp, n, cache_string)`
|
||||
|
||||
返回N日Exp的平均值,与系统参数(股票、时间、周期等相关)。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,返回当天值;N为-1时无效。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数。N为0时,返回当天值;N为-1时无效。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
范例一:
|
||||
@@ -130,20 +128,19 @@ return t;
|
||||
结果:
|
||||
```
|
||||
|
||||
|
||||
### `ema(exp, n, cache_string)`
|
||||
## `ema(exp, n, cache_string)`
|
||||
|
||||
返回N日Exp的移动平均,与系统参数(股票、时间、周期等相关)。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式; |
|
||||
| `n` | integer | 整数,天数;N为-1,0时无效。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式; |
|
||||
| `n` | integer | 整数,天数;N为-1,0时无效。 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//获得万科A(SZ000002)在2011-09-09日的10日平滑移动均价
|
||||
@@ -154,21 +151,20 @@ return ema(close(),n);
|
||||
// 结果:8.1158
|
||||
```
|
||||
|
||||
|
||||
### `sma(exp, n, m, cache_string)`
|
||||
## `sma(exp, n, m, cache_string)`
|
||||
|
||||
求Exp的N日平滑移动平均,M为权重。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数 |
|
||||
| `m` | integer | 整数,权重 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,天数 |
|
||||
| `m` | integer | 整数,权重 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//获得万科A(SZ000002)在2011-09-09日的10日平滑移动均价,3为权重
|
||||
@@ -179,20 +175,19 @@ m := 3;
|
||||
return sma(close(),n,m);//返回8.0914
|
||||
```
|
||||
|
||||
|
||||
### `count(exp, n, cache_string)`
|
||||
## `count(exp, n, cache_string)`
|
||||
|
||||
统计N天中表达式Exp值为真的天数。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | 表达式类型 |
|
||||
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | 表达式类型 |
|
||||
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:integer
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//上证指数在最近100天内的上涨天数;
|
||||
@@ -202,20 +197,19 @@ return count(isUp(),100);
|
||||
//返回47。
|
||||
```
|
||||
|
||||
|
||||
### `sumN(exp, n, cache_string)`
|
||||
## `sumN(exp, n, cache_string)`
|
||||
|
||||
求Exp的N日累加和。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| -------------- | ----------- | --------------------------------------------------------------------- |
|
||||
| `exp` | TExpression | TExpression型表达式 |
|
||||
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
|
||||
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
|
||||
|
||||
返回:real
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//获得万科A(SZ000002)在2011-09-09日的5日总成交量
|
||||
@@ -224,8 +218,7 @@ setSysParam(pn_date(),intToDate(20110909));
|
||||
return sumN(vol(),5); // 返回152502152
|
||||
```
|
||||
|
||||
|
||||
### `cross(a, b)`
|
||||
## `cross(a, b)`
|
||||
|
||||
A线从下面穿越B线时返回1,从A上面向下穿越B时返回-1,否则返回0。与系统参数(股票、时间、周期等相关)
|
||||
|
||||
@@ -236,7 +229,7 @@ A线从下面穿越B线时返回1,从A上面向下穿越B时返回-1,否则
|
||||
|
||||
返回:integer
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
//万科在指定区间内的均线穿越情况;
|
||||
@@ -266,4 +259,3 @@ end;
|
||||
return r;
|
||||
返回结果:
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 交易日历
|
||||
|
||||
### `continuedMatchOfNDay(exp, n)`
|
||||
## `continuedMatchOfNDay(exp, n)`
|
||||
|
||||
判断Exp在过去N个交易日是否取得指标值,若取得返回1,否则返回0,与系统参数(股票,日期)相关。
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
返回:bool
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),'SH000001');
|
||||
@@ -19,7 +19,7 @@ SetSysParam(pn_date(),20180801t);
|
||||
return ContinuedMatchOfNDay(@close(),3);
|
||||
```
|
||||
|
||||
### `correlOfNDay(exp1, exp2, n, cache_str)`
|
||||
## `correlOfNDay(exp1, exp2, n, cache_str)`
|
||||
|
||||
过去N日相关系数,其中N日表示市场交易日。注:剔除非交易日,例如求过去20天开盘价与成交量的相关系数,但是期间有10天停牌,则取非停牌日10天的相关系数。
|
||||
|
||||
@@ -32,7 +32,7 @@ return ContinuedMatchOfNDay(@close(),3);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -40,7 +40,7 @@ SetSysParam(pn_date(),20231010T);
|
||||
return CorrelOfNDay(@stockpjcj3(),@RefValue(@close(),5),10,"");
|
||||
```
|
||||
|
||||
### `covarOfNDay(exp1, exp2, n, cache_str)`
|
||||
## `covarOfNDay(exp1, exp2, n, cache_str)`
|
||||
|
||||
过去N日协方差。N日表示市场交易日。注:剔除非交易日,例如求过去20天开盘价与成交量的协方差,但是期间有10天停牌,则取非停牌日10天的协方差。
|
||||
|
||||
@@ -53,7 +53,7 @@ return CorrelOfNDay(@stockpjcj3(),@RefValue(@close(),5),10,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -61,7 +61,7 @@ SetSysParam(pn_date(),20231030T);
|
||||
return CovarOfNDay(@close(),@open(),30,"");
|
||||
```
|
||||
|
||||
### `productOfNDay(exp, n, cache_str)`
|
||||
## `productOfNDay(exp, n, cache_str)`
|
||||
|
||||
过去N日乘积。N日表示市场交易日。注:剔除非交易日(停牌或未上市)数据指标。
|
||||
|
||||
@@ -73,7 +73,7 @@ return CovarOfNDay(@close(),@open(),30,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
@@ -81,7 +81,7 @@ SetSysParam(pn_date(),20231030T);
|
||||
return ProductOfNDay(@close(),3,"");
|
||||
```
|
||||
|
||||
### `smaofNDay(exp, n, m, cache_str)`
|
||||
## `smaofNDay(exp, n, m, cache_str)`
|
||||
|
||||
过去N日平滑移动平均。N日表示市场交易日。注:剔除非交易日(停牌或未上市)数据指标。
|
||||
|
||||
@@ -94,7 +94,7 @@ return ProductOfNDay(@close(),3,"");
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"SH600585");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 数据仓库 / 向导函数
|
||||
|
||||
### `compositeRatioValue(v1, v2, n)`
|
||||
## `compositeRatioValue(v1, v2, n)`
|
||||
|
||||
返回初值V1到末值V2的复合增长率。
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
返回:float
|
||||
|
||||
### `growthOfRepPeriod(expr, r_date, result_type)`
|
||||
## `growthOfRepPeriod(expr, r_date, result_type)`
|
||||
|
||||
表达式Exp某个指标在报告期Rdate的同比增长,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
返回:any
|
||||
|
||||
### `growthWithLowestOfPeriod(exp, beg_date, end_date, return_type)`
|
||||
## `growthWithLowestOfPeriod(exp, beg_date, end_date, return_type)`
|
||||
|
||||
返回表达式Exp在区间BegDate到EndDate中的最小值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。。
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),'SZ000001');
|
||||
return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
|
||||
```
|
||||
|
||||
### `isNull(arg1)`
|
||||
## `isNull(arg1)`
|
||||
|
||||
判断条件是否成立。
|
||||
|
||||
@@ -54,7 +54,7 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
|
||||
|
||||
返回:bool
|
||||
|
||||
### `occuredRepIdOfRepPeriod(expr, beg_report, end_year)`
|
||||
## `occuredRepIdOfRepPeriod(expr, beg_report, end_year)`
|
||||
|
||||
在区间BegReport到EndYear年中,与BegReport报告期同比的报告期中返回表达式exp为真的报告期。
|
||||
|
||||
@@ -66,26 +66,26 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
|
||||
|
||||
返回:any
|
||||
|
||||
### `positionOfIndustry()`
|
||||
## `positionOfIndustry()`
|
||||
|
||||
向导函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `ratioValueByType(v1, v2, _type, n)`
|
||||
## `ratioValueByType(v1, v2, _type, n)`
|
||||
|
||||
依据返回类型type,返回初值V1到末值V2的增长/增长率/复合增长率。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------ | ---- | ------------------------ |
|
||||
| `v1` | int | 实数,初值 |
|
||||
| `v2` | int | 实数,末值 |
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | ---- | ------------------------ |
|
||||
| `v1` | int | 实数,初值 |
|
||||
| `v2` | int | 实数,末值 |
|
||||
| `_type` | int | 用户自定义,返回数据类型 |
|
||||
| `n` | int | 整数,期数或交易天数 |
|
||||
| `n` | int | 整数,期数或交易天数 |
|
||||
|
||||
返回:float
|
||||
|
||||
### `reduceWithHighestOfPeriod(exp, beg_date, end_date, return_type)`
|
||||
## `reduceWithHighestOfPeriod(exp, beg_date, end_date, return_type)`
|
||||
|
||||
返回表达式Exp在区间BegDate到EndDate中的最大值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。
|
||||
|
||||
@@ -98,20 +98,20 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),'SZ000001');
|
||||
return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
```
|
||||
|
||||
### `relativeStrengthOfIndustry()`
|
||||
## `relativeStrengthOfIndustry()`
|
||||
|
||||
向导函数相关函数。
|
||||
|
||||
返回:any
|
||||
|
||||
### `reportOfListed(id, report_id)`
|
||||
## `reportOfListed(id, report_id)`
|
||||
|
||||
返回指定报告期ReportID的基本面ID数据。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。
|
||||
|
||||
@@ -122,7 +122,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
|
||||
返回:any
|
||||
|
||||
### `reportPerShareOfListed(id, report_id)`
|
||||
## `reportPerShareOfListed(id, report_id)`
|
||||
|
||||
指定报告期ReportID的基本面ID数据/总股本。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。
|
||||
|
||||
@@ -133,7 +133,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
|
||||
返回:any
|
||||
|
||||
### `reportValueOfPeriod(exp, beg_report, end_report, report_type, reportvalue)`
|
||||
## `reportValueOfPeriod(exp, beg_report, end_report, report_type, reportvalue)`
|
||||
|
||||
区间财务数据
|
||||
|
||||
@@ -147,7 +147,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
|
||||
返回:array
|
||||
|
||||
### `simplyRatioValue(v1, v2)`
|
||||
## `simplyRatioValue(v1, v2)`
|
||||
|
||||
返回初值V1到末值V2的增长率。若V1<0,则直接返回0。
|
||||
|
||||
@@ -158,7 +158,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
|
||||
返回:float
|
||||
|
||||
### `stockTrailingAvgByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
|
||||
## `stockTrailingAvgByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
|
||||
|
||||
获取基于指定日推移阶段的日均指标
|
||||
|
||||
@@ -172,7 +172,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
获取万科A过去1年的日均成交金额
|
||||
@@ -183,7 +183,7 @@ exp := "Amount()";
|
||||
return StockTrailingAvgByEndT(Endt,RefType,Exp);
|
||||
```
|
||||
|
||||
### `stockTrailingStdByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
|
||||
## `stockTrailingStdByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
|
||||
|
||||
获取基于指定日推移阶段的指标标准差
|
||||
|
||||
@@ -197,7 +197,7 @@ return StockTrailingAvgByEndT(Endt,RefType,Exp);
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
### 示例
|
||||
|
||||
```tsl
|
||||
获取万科A过去1年的日收益率标准差
|
||||
@@ -208,7 +208,7 @@ exp := "stockzf3()";
|
||||
return StockTrailingStdByEndT(Endt,RefType,Exp); // 1.69
|
||||
```
|
||||
|
||||
### `techCalUnit(expression)`
|
||||
## `TechCal_Unit(expression)`
|
||||
|
||||
向导函数相关函数。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user