✨ feat(tsl-api-reference): add class and framework API lookup
This commit is contained in:
@@ -61,7 +61,7 @@ return nDay2('时间', dateTimeToStr(sp_time()),
|
||||
'收盘价', close(),
|
||||
'当日高价', high(),
|
||||
'30日均线', ma(close(), 30));
|
||||
返回结果(部分):
|
||||
// 输出:
|
||||
```
|
||||
|
||||
## `nDay3(n, expression)`
|
||||
@@ -85,10 +85,7 @@ return nDay2('时间', dateTimeToStr(sp_time()),
|
||||
|
||||
```tsl
|
||||
// 取得万科截止20110909前30个交易日的价格序列(按交易日升序排列);
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
return nday3(30, close());
|
||||
```
|
||||
|
||||
@@ -382,9 +382,7 @@ Return Cy_TwoYear();
|
||||
|
||||
```tsl
|
||||
BegT := 20250310T;
|
||||
|
||||
EndT := 20260204T;
|
||||
|
||||
return MonthsBetween2(begT, endT);
|
||||
// 输出:10.7845622119816
|
||||
```
|
||||
@@ -410,9 +408,7 @@ return MonthsBetween2(begT, endT);
|
||||
|
||||
```tsl
|
||||
BegT := 20260204T;
|
||||
|
||||
EndT := 20290504T;
|
||||
|
||||
return YearsBetween2(begT, endT);
|
||||
// 输出:3.24657534246575
|
||||
```
|
||||
|
||||
-11
@@ -16,26 +16,15 @@
|
||||
|
||||
```tsl
|
||||
Function YourFunc();
|
||||
|
||||
Begin
|
||||
|
||||
// 取深万科,2013-12-31日的收盘价
|
||||
|
||||
// 备份系统参数
|
||||
|
||||
oV := BackUpSystemParameters();
|
||||
|
||||
SetSysParam(PN_Stock(), 'SZ000002');
|
||||
|
||||
SetSysParam(PN_Date(), 20131231T);
|
||||
|
||||
c := close();
|
||||
|
||||
// 还原系统参数
|
||||
|
||||
RestoreSystemParameters(oV);
|
||||
|
||||
Return c;
|
||||
|
||||
End;
|
||||
```
|
||||
|
||||
+55
-148
@@ -16,15 +16,10 @@
|
||||
|
||||
```tsl
|
||||
endt := 20190404T;
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
v1 := StockTotalShares(endt); // 考虑变动日及公布日
|
||||
|
||||
setsysparam(PN_ChangedDateMode(), 1);
|
||||
|
||||
v2 := StockTotalShares(endt); // 仅考虑变动日
|
||||
|
||||
return array(v1, v2);
|
||||
// 输出:array(11039152001.0,11302143001.0)
|
||||
```
|
||||
@@ -45,13 +40,9 @@ return array(v1, v2);
|
||||
|
||||
```tsl
|
||||
// 取万科A在2019-02-18 11:25:00时的五分钟线成交量
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), 20190218.1125T);
|
||||
|
||||
setsysparam(pn_cycle(), cy_5m());
|
||||
|
||||
return vol();
|
||||
// 输出:1389725
|
||||
```
|
||||
@@ -60,9 +51,7 @@ return vol();
|
||||
|
||||
```tsl
|
||||
// 取上证指数一段时间内的5分钟线数据
|
||||
|
||||
setsysparam(pn_cycle(), cy_5m());
|
||||
|
||||
return select ['date'], ['close'], ['vol'] from markettable datekey 20190218.1030T to 20190218.1120T of 'SH000001' end;
|
||||
```
|
||||
|
||||
@@ -82,9 +71,7 @@ return select ['date'], ['close'], ['vol'] from markettable datekey 20190218.103
|
||||
|
||||
```tsl
|
||||
// 设置当前时间为2019-2-18
|
||||
|
||||
setsysparam(pn_date(), 20190218T);
|
||||
|
||||
return sp_time(); // 或return getsysparam(pn_date());//获取当前时间
|
||||
// 输出:43514,即2019-02-18
|
||||
```
|
||||
@@ -93,11 +80,8 @@ return sp_time(); // 或return getsysparam(pn_date());//获取当前时间
|
||||
|
||||
```tsl
|
||||
// 取指定证券SH60000在指定日2019-02-18这一天的收盘价
|
||||
|
||||
setsysparam(pn_stock(), 'SH600000');
|
||||
|
||||
setsysparam(pn_date(), 20190218T); // 设置当前时间
|
||||
|
||||
return close(); // 取收盘价
|
||||
// 输出:10.84
|
||||
```
|
||||
@@ -118,15 +102,10 @@ return close(); // 取收盘价
|
||||
|
||||
```tsl
|
||||
// 取万科A在2019年的三季报与年报的股东权益合计,笔者执行日期为20191224日,年报还未出
|
||||
|
||||
setsysparam(pn_emptymode(), 5); // 空记录设置为浮点NAN
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
t1 := reportofall(44111, 20190930);
|
||||
|
||||
t2 := reportofall(44111, 20191231);
|
||||
|
||||
return array(t1, t2);
|
||||
```
|
||||
|
||||
@@ -166,11 +145,8 @@ Nday2执行的周期数目,相关数据为整数类型,一般在使用nday2
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(), 'SZ000001');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20140115));
|
||||
|
||||
setsysparam(pn_nday(), 250);
|
||||
|
||||
return nday2('time', datetostr(sp_time()), 'close', close());
|
||||
```
|
||||
|
||||
@@ -190,11 +166,8 @@ NIL在COM中转换的行为。 假如用户在其他的本地应用中与外部C
|
||||
|
||||
```tsl
|
||||
// matlab代码
|
||||
|
||||
ts=actxserver('TSExpert.CoExec')
|
||||
|
||||
ts.SetSysParam('NilTrans', 9)
|
||||
|
||||
ts.RemoteExecute('return array((1,2,nil,4),(2,nil,3,nil));')
|
||||
```
|
||||
|
||||
@@ -214,11 +187,8 @@ ts.RemoteExecute('return array((1,2,nil,4),(2,nil,3,nil));')
|
||||
|
||||
```tsl
|
||||
setsysparam(PN_Precision(), 3); // 设置有效
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
setsysparam(PN_Precision(), 2); // 设置无效,在return 之前被恢复到备份之前的状态
|
||||
|
||||
return rand(2, 3);
|
||||
// 输出:保留3位小数:
|
||||
```
|
||||
@@ -227,13 +197,9 @@ return rand(2, 3);
|
||||
|
||||
```tsl
|
||||
// 提取万科A2019-2-19日的5分钟线收盘价,并保留2位小数结果输出
|
||||
|
||||
setsysparam(PN_Precision(), 2); // 有效
|
||||
|
||||
setsysparam(pn_cycle(), cy_30m());
|
||||
|
||||
return select datetimetostr(['date']) as 'date', ['close']
|
||||
|
||||
from markettable datekey 20190219T to 20190219.16T of 'SZ000002' end;
|
||||
```
|
||||
|
||||
@@ -253,17 +219,11 @@ from markettable datekey 20190219T to 20190219.16T of 'SZ000002' end;
|
||||
|
||||
```tsl
|
||||
// 以第一个交易日为基准进行复杂复权后的截止20110909万科A的收盘价时间序列
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
setsysparam(pn_rate(), rt_complex()); // 复权方式:复杂复权
|
||||
|
||||
setsysparam(pn_rateday(), rd_firstday()); // 复权基准日:第一个交易日
|
||||
|
||||
return nday(30, 'date', datetostr(sp_time()),
|
||||
|
||||
'close', close());
|
||||
```
|
||||
|
||||
@@ -283,15 +243,10 @@ return nday(30, 'date', datetostr(sp_time()),
|
||||
|
||||
```tsl
|
||||
// 设置2018-08-20为复权基准日,小于这个日期的前复权,大于这个日的后复权。
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), 20180905T);
|
||||
|
||||
setsysparam(pn_rate(), 1); // 复权方式:比例复权
|
||||
|
||||
setsysparam(pn_rateday(), 20180820T); // 复权基准日
|
||||
|
||||
return nday(30, 'date', datetostr(sp_time()), 'close', close());
|
||||
```
|
||||
|
||||
@@ -311,73 +266,67 @@ return nday(30, 'date', datetostr(sp_time()), 'close', close());
|
||||
|
||||
```tsl
|
||||
SetSysParam(PN_Stock(), 'SH600170');
|
||||
|
||||
// pn_ReportMode()=-1,返回调整前、调整后
|
||||
|
||||
SetSysParam(pn_ReportMode(), -1);
|
||||
|
||||
return Select ['StockID'], ['StockName'], ['截止日'], ['公布日'], ['营业收入'], ['归属于母公司所有者净利润']
|
||||
|
||||
from infotable 46
|
||||
|
||||
of 'SH600170'
|
||||
|
||||
where ['截止日']>=20171231 end;
|
||||
|
||||
StockID
|
||||
StockName
|
||||
截止日
|
||||
公布日
|
||||
营业收入
|
||||
归属于母公司所有者净利润
|
||||
SH600170
|
||||
上海建工
|
||||
20171231
|
||||
20180328
|
||||
142, 082, 638, 561.83
|
||||
2, 584, 465, 203.87
|
||||
SH600170
|
||||
上海建工
|
||||
20171231
|
||||
20190329
|
||||
142, 082, 638, 561.83
|
||||
2, 584, 465, 203.87
|
||||
SH600170
|
||||
上海建工
|
||||
20180331
|
||||
20180428
|
||||
31, 075, 378, 878.24
|
||||
532, 834, 340.41
|
||||
SH600170
|
||||
上海建工
|
||||
20180331
|
||||
20190430
|
||||
31, 075, 378, 878.24
|
||||
532, 834, 340.41
|
||||
SH600170
|
||||
上海建工
|
||||
20180630
|
||||
20180829
|
||||
78, 290, 436, 984.83
|
||||
1, 289, 780, 254.93
|
||||
SH600170
|
||||
上海建工
|
||||
20180930
|
||||
20181031
|
||||
115, 410, 360, 329.49
|
||||
1, 811, 096, 340.58
|
||||
SH600170
|
||||
上海建工
|
||||
20181231
|
||||
20190329
|
||||
170, 545, 783, 102.81
|
||||
2, 779, 866, 799.83
|
||||
SH600170
|
||||
上海建工
|
||||
20190331
|
||||
20190430
|
||||
47, 099, 976, 904.12
|
||||
1, 317, 287, 587.90
|
||||
// 输出:
|
||||
// StockID
|
||||
// StockName
|
||||
// 截止日
|
||||
// 公布日
|
||||
// 营业收入
|
||||
// 归属于母公司所有者净利润
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20171231
|
||||
// 20180328
|
||||
// 142, 082, 638, 561.83
|
||||
// 2, 584, 465, 203.87
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20171231
|
||||
// 20190329
|
||||
// 142, 082, 638, 561.83
|
||||
// 2, 584, 465, 203.87
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20180331
|
||||
// 20180428
|
||||
// 31, 075, 378, 878.24
|
||||
// 532, 834, 340.41
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20180331
|
||||
// 20190430
|
||||
// 31, 075, 378, 878.24
|
||||
// 532, 834, 340.41
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20180630
|
||||
// 20180829
|
||||
// 78, 290, 436, 984.83
|
||||
// 1, 289, 780, 254.93
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20180930
|
||||
// 20181031
|
||||
// 115, 410, 360, 329.49
|
||||
// 1, 811, 096, 340.58
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20181231
|
||||
// 20190329
|
||||
// 170, 545, 783, 102.81
|
||||
// 2, 779, 866, 799.83
|
||||
// SH600170
|
||||
// 上海建工
|
||||
// 20190331
|
||||
// 20190430
|
||||
// 47, 099, 976, 904.12
|
||||
// 1, 317, 287, 587.90
|
||||
```
|
||||
|
||||
## `pn_reportType()`
|
||||
@@ -396,17 +345,11 @@ SH600170
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_stock(), 'SH688699');
|
||||
|
||||
SetSysParam(pn_date(), EndT);
|
||||
|
||||
SetSysParam(pn_ReportType(), 0); // 财报最新报告期,等价于不设置该系统参数
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20220930, 财报2022年三季报已公布,年报未公布
|
||||
```
|
||||
@@ -415,17 +358,11 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_stock(), 'SH688699');
|
||||
|
||||
SetSysParam(pn_date(), EndT);
|
||||
|
||||
SetSysParam(pn_ReportType(), 1); // 财报>快报>预测
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20221231, 财报和快报2022年年报未公布,预测已公布
|
||||
```
|
||||
@@ -434,17 +371,11 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_stock(), 'SH688699');
|
||||
|
||||
SetSysParam(pn_date(), EndT);
|
||||
|
||||
SetSysParam(pn_ReportType(), 2); // 财报>快报
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20220930,财报和快报2022年年报未公布,财报2022年三季报已公布
|
||||
```
|
||||
@@ -453,17 +384,11 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_stock(), 'SH688699');
|
||||
|
||||
SetSysParam(pn_date(), EndT);
|
||||
|
||||
SetSysParam(pn_ReportType(), 3); // 财报>预测
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20221231,财报2022年年报未公布,预测已公布
|
||||
```
|
||||
@@ -472,13 +397,9 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_ReportType(), 90); // 财报按财报发布规则
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20220930, 按财报公布规则20230121t,2022年年报未公布在4月底才公布,2022年三季报已在2022年10月公布了
|
||||
```
|
||||
@@ -487,15 +408,10 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
EndT := 20230121T;
|
||||
|
||||
ov := BackupSystemParameters2();
|
||||
|
||||
SetSysParam(pn_stock(), 'SH688699');
|
||||
|
||||
SetSysParam(pn_ReportType(), 20221231); // 财报指定报告期已公布
|
||||
|
||||
RDate := NewReportDateOfEndT2(EndT);
|
||||
|
||||
return RDate;
|
||||
// 输出:20220930, 20230121T指定报告期2022年年报未公布,2022年三季报已公布
|
||||
```
|
||||
@@ -516,9 +432,7 @@ return RDate;
|
||||
|
||||
```tsl
|
||||
// 设置当前证券为万科A
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
return getsysparam(pn_stock()); // 获取当前的证券代码
|
||||
// 输出:字符串SZ000002
|
||||
```
|
||||
@@ -527,11 +441,8 @@ return getsysparam(pn_stock()); // 获取当前的证券代码
|
||||
|
||||
```tsl
|
||||
// 取指定证券SH60000在指定日2019-02-18这一天的收盘价
|
||||
|
||||
setsysparam(pn_stock(), 'SH600000');
|
||||
|
||||
setsysparam(pn_date(), 20190218T); // 设置当前时间
|
||||
|
||||
return close(); // 取收盘价
|
||||
// 输出:10.84
|
||||
```
|
||||
@@ -552,12 +463,8 @@ return close(); // 取收盘价
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(), "SH600519");
|
||||
|
||||
setsysparam(pn_cycle(), cy_1m());
|
||||
|
||||
setsysparam(pn_ViewPoint(), 20240702.102942T); // 仿真时间为10:29:42
|
||||
|
||||
setsysparam(pn_date(), 20240702.1030T); // 取分钟线十点半时的价量
|
||||
|
||||
return array(close(), vol());
|
||||
```
|
||||
|
||||
-12
@@ -22,9 +22,7 @@
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "相关系数", Specall(SP_Correl(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
@@ -50,9 +48,7 @@ return nday(10, "日期", SP_time(), "相关系数", Specall(SP_Correl(close(),
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "协方差", Specall(SP_Cov(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
@@ -78,9 +74,7 @@ return nday(10, "日期", SP_time(), "协方差", Specall(SP_Cov(close(), Spec(C
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "回归截距", Specall(SP_intercept(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
@@ -106,9 +100,7 @@ return nday(10, "日期", SP_time(), "回归截距", Specall(SP_intercept(close(
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "系数平方", Specall(SP_RSQ(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
@@ -134,9 +126,7 @@ return nday(10, "日期", SP_time(), "系数平方", Specall(SP_RSQ(close(), Spe
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "回归斜率", Specall(SP_slope(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
@@ -162,8 +152,6 @@ return nday(10, "日期", SP_time(), "回归斜率", Specall(SP_slope(close(), S
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return nday(10, "日期", SP_time(), "相对标准偏差", Specall(SP_steyx(close(), Spec(Close(), "SH000001"), 4800), Array(pn_date():SP_time()+0.99, pn_Cycle():cy_3s())));
|
||||
```
|
||||
|
||||
-89
@@ -49,53 +49,29 @@ A线从下面穿越B线时返回1,从A上面向下穿越B时返回-1,否则
|
||||
|
||||
```tsl
|
||||
// 万科在指定区间内的均线穿越情况;
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
end_date := inttodate(20110829);
|
||||
|
||||
beg_date := IncWeek(end_date, -1); // end_date 前推一个
|
||||
|
||||
r := array();
|
||||
|
||||
i := 0;
|
||||
|
||||
for d := end_date downto beg_date do
|
||||
|
||||
begin
|
||||
|
||||
if not istradeday(d) then continue;
|
||||
|
||||
setsysparam(pn_date(), d);
|
||||
|
||||
r[i]['date'] := datetostr(d);
|
||||
|
||||
case cross(close(), ma(close(), 5)) of
|
||||
|
||||
1:begin
|
||||
|
||||
r[i]['cross_state'] := '突破5日均线';
|
||||
|
||||
end
|
||||
|
||||
-1:begin
|
||||
|
||||
r[i]['cross_state'] := '跌破5日均线';
|
||||
|
||||
end
|
||||
|
||||
0:begin
|
||||
|
||||
r[i]['cross_state'] := '';
|
||||
|
||||
end
|
||||
|
||||
end;
|
||||
|
||||
i++;
|
||||
|
||||
end;
|
||||
|
||||
return r;
|
||||
```
|
||||
|
||||
@@ -150,25 +126,15 @@ return ema(close(), n);
|
||||
|
||||
```tsl
|
||||
// 获取万科A(SZ000002)截止2011-09-09日14个交易日内的最高,最低的收盘价以及
|
||||
|
||||
// 发生日期。
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
N := 14;
|
||||
|
||||
r := array('h_value':hhv(close(), N),
|
||||
|
||||
'h_date':datetostr(GetSysParam('hhvtime')),
|
||||
|
||||
'l_value':llv(close(), N),
|
||||
|
||||
'l_date':datetostr(GetSysparam('llvtime'))
|
||||
|
||||
);
|
||||
|
||||
return r;
|
||||
```
|
||||
|
||||
@@ -210,13 +176,9 @@ return r;
|
||||
|
||||
```tsl
|
||||
// 获得万科A(SZ000002)在2011-09-09日的10日均价
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
N := 10;
|
||||
|
||||
return ma(close(), N);
|
||||
// 输出:8.103
|
||||
```
|
||||
@@ -225,13 +187,9 @@ return ma(close(), N);
|
||||
|
||||
```tsl
|
||||
// 获取万科A一段时间的10日均价
|
||||
|
||||
setsysparam(pn_stock(), "SZ000002");
|
||||
|
||||
setsysparam(pn_date(), strtodate("2014-01-15"));
|
||||
|
||||
t := nday(100, 'time', sp_time(), 'close', close(), 'ma10', ma(close(), 10), 'ma20', ma(close(), 20));
|
||||
|
||||
return t;
|
||||
```
|
||||
|
||||
@@ -319,13 +277,9 @@ return sma(close(), n, m);
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(),
|
||||
|
||||
"几何平均价格", Specall(SP_geomean(Close(), 4),
|
||||
|
||||
Array(Pn_Cycle():Cy_60m(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -350,9 +304,7 @@ return Nday(10, "日期", SP_time(),
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "调和平均价格", Specall(SP_Harmean(Close(), 4800), Array(Pn_Cycle():Cy_3s(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -377,9 +329,7 @@ return Nday(10, "日期", SP_time(), "调和平均价格", Specall(SP_Harmean(Cl
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "峰度", Specall(SP_kurtosis(Close(), 4800), array(pn_date():SP_time()+0.99, pn_Cycle():Cy_3s())));
|
||||
```
|
||||
|
||||
@@ -404,9 +354,7 @@ return Nday(10, "日期", SP_time(), "峰度", Specall(SP_kurtosis(Close(), 4800
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "峰度", Specall(SP_kurtosis2(Close(), 4800), array(pn_date():SP_time()+0.99, pn_Cycle():Cy_3s())));
|
||||
```
|
||||
|
||||
@@ -432,9 +380,7 @@ return Nday(10, "日期", SP_time(), "峰度", Specall(SP_kurtosis2(Close(), 480
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "分钟线最大成交量", Specall(SP_Large(Vol(), 1, 240), Array(Pn_Cycle():Cy_1m(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -460,9 +406,7 @@ return Nday(10, "日期", SP_time(), "分钟线最大成交量", Specall(SP_Larg
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
Return Nday(10, "日期", SP_time(), "价格", SpecAll(SP_percentile(close(), 0.8, 240), Array(pn_Cycle():Cy_1m(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -488,9 +432,7 @@ Return Nday(10, "日期", SP_time(), "价格", SpecAll(SP_percentile(close(), 0.
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
Return Nday(10, "日期", SP_time(), "百分比", SpecAll(SP_percentRank(close(), close(), 240), Array(pn_Cycle():Cy_1m(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -516,9 +458,7 @@ Return Nday(10, "日期", SP_time(), "百分比", SpecAll(SP_percentRank(close()
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "价格", Specall(SP_quartile(Close(), 2, 4800), Array(Pn_Cycle():Cy_3s(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -544,9 +484,7 @@ return Nday(10, "日期", SP_time(), "价格", Specall(SP_quartile(Close(), 2, 4
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
Return Nday(10, "日期", SP_time(), "排名", SpecAll(SP_Rank(close(), close(), 240), Array(pn_Cycle():Cy_1m(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -571,9 +509,7 @@ Return Nday(10, "日期", SP_time(), "排名", SpecAll(SP_Rank(close(), close(),
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "偏度", Specall(SP_skewness(Close(), 4800), array(pn_date():SP_time()+0.99, pn_Cycle():Cy_3s())));
|
||||
```
|
||||
|
||||
@@ -598,9 +534,7 @@ return Nday(10, "日期", SP_time(), "偏度", Specall(SP_skewness(Close(), 4800
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "偏度", Specall(SP_skewness2(Close(), 4800), array(pn_date():SP_time()+0.99, pn_Cycle():Cy_3s())));
|
||||
```
|
||||
|
||||
@@ -626,11 +560,8 @@ return Nday(10, "日期", SP_time(), "偏度", Specall(SP_skewness2(Close(), 480
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
Setsysparam(pn_Cycle(), cy_Month());
|
||||
|
||||
return Nday(12, "日期", SP_time(), "月末5日最小价格", Specall(SP_Small(Close(), 1, 5), Array(Pn_Cycle():Cy_day())));
|
||||
```
|
||||
|
||||
@@ -656,25 +587,15 @@ return Nday(12, "日期", SP_time(), "月末5日最小价格", Specall(SP_Small(
|
||||
|
||||
```tsl
|
||||
// 计算万科A截止20110909前30个交易日股价的统计信息
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
_stat := array();
|
||||
|
||||
_stat := array('标准差':sp_std(close(), 30),
|
||||
|
||||
'总体标准差':sp_stdp(close(), 30),
|
||||
|
||||
'方差':sp_var(close(), 30),
|
||||
|
||||
'总体方差':sp_varp(close(), 30),
|
||||
|
||||
'平均绝对偏差':sp_avedev(close(), 30),
|
||||
|
||||
'偏差平方和':sp_devsq(close(), 30));
|
||||
|
||||
return _stat;
|
||||
```
|
||||
|
||||
@@ -700,11 +621,8 @@ return _stat;
|
||||
|
||||
```tsl
|
||||
// 计算万科截止20110909前30个交易日股票的总体标准差
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
return sp_stdp(close(), 30);
|
||||
// 输出:0.1456
|
||||
```
|
||||
@@ -730,9 +648,7 @@ return sp_stdp(close(), 30);
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "偏差", Specall(SP_totalvariance(Close(), 4800), array(pn_date():SP_time()+0.99, pn_Cycle():Cy_3s())));
|
||||
```
|
||||
|
||||
@@ -758,9 +674,7 @@ return Nday(10, "日期", SP_time(), "偏差", Specall(SP_totalvariance(Close(),
|
||||
|
||||
```tsl
|
||||
Setsysparam(pn_Stock(), "SZ000002");
|
||||
|
||||
Setsysparam(pn_date(), 20181030T);
|
||||
|
||||
return Nday(10, "日期", SP_time(), "平均价格", Specall(SP_trimmean(Close(), 0.8, 4800), Array(Pn_Cycle():Cy_3s(), pn_date():SP_time()+0.99)));
|
||||
```
|
||||
|
||||
@@ -786,11 +700,8 @@ return Nday(10, "日期", SP_time(), "平均价格", Specall(SP_trimmean(Close()
|
||||
|
||||
```tsl
|
||||
// 计算万科截止20110909前30个交易日股票的样本方差
|
||||
|
||||
setsysparam(pn_stock(), 'SZ000002');
|
||||
|
||||
setsysparam(pn_date(), inttodate(20110909));
|
||||
|
||||
return sp_var(close(), 30);
|
||||
// 输出:0.0219
|
||||
```
|
||||
|
||||
+2
-16
@@ -59,33 +59,19 @@ Return GetParm_GroupIndustry_ByEndt(GetBKByDate('SH000300', 20231010T), 20231010
|
||||
|
||||
```tsl
|
||||
A := function (endt);
|
||||
|
||||
begin
|
||||
|
||||
return GetBKByDate('SH000300', endt);
|
||||
|
||||
end
|
||||
|
||||
end;
|
||||
B := function (endt);
|
||||
|
||||
begin
|
||||
|
||||
return GetBKByDate('SH000905', endt);
|
||||
|
||||
end
|
||||
|
||||
end;
|
||||
SetParm_StockArrFunc(B, 'ZZ500');
|
||||
|
||||
SetParm_StockArrFunc(A, 'HS300');
|
||||
|
||||
sp_s(pn_StockArrName(), 'HS300');
|
||||
|
||||
stocks1 := GetParm_StockArr_ByEndt(sp_time(1));
|
||||
|
||||
sp_s(pn_StockArrName(), 'ZZ500');
|
||||
|
||||
stocks2 := GetParm_StockArr_ByEndt(sp_time(1));
|
||||
|
||||
return array(stocks1, stocks2);
|
||||
```
|
||||
|
||||
|
||||
-31
@@ -49,11 +49,8 @@ return IndNeutralize(@open(), 0, "");
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), "SH600519");
|
||||
|
||||
SetSysParam(Pn_date(), 20231010T);
|
||||
|
||||
setsysparam(pn_StockArr(), getbkbydate("SH000300", 20231010T));
|
||||
|
||||
return IndNeutralize2(@open(), 0, "");
|
||||
// 输出:1735.87966666667
|
||||
```
|
||||
@@ -136,19 +133,12 @@ return IndNeutralizeOftheReport(@ReportOfAll(46002, DefaultRepID()), 20221231, 0
|
||||
|
||||
```tsl
|
||||
sp_s(PN_Stock(), 'SH600000');
|
||||
|
||||
endt := 20190701T;
|
||||
|
||||
sp_s(PN_Date(), endt);
|
||||
|
||||
sp_s(PN_Rate(), 1);
|
||||
|
||||
sp_s(PN_RateDay(), endt);
|
||||
|
||||
sp_s(pn_StockArr(), GetBKByDate('SH000300', endt));
|
||||
|
||||
Exp := @close();
|
||||
|
||||
return PercentRankOftheDay(exp);
|
||||
// 输出:0.4615
|
||||
```
|
||||
@@ -174,19 +164,12 @@ return PercentRankOftheDay(exp);
|
||||
|
||||
```tsl
|
||||
sp_s(PN_Stock(), 'SH600000');
|
||||
|
||||
endt := 20190701T;
|
||||
|
||||
sp_s(PN_Date(), endt);
|
||||
|
||||
sp_s(PN_Rate(), 1);
|
||||
|
||||
sp_s(PN_RateDay(), endt);
|
||||
|
||||
sp_s(pn_StockArr(), GetBKByDate('SH000300', endt));
|
||||
|
||||
Exp := @close();
|
||||
|
||||
return PercentRankOftheDay2(exp);
|
||||
// 输出:0.4615
|
||||
```
|
||||
@@ -268,19 +251,12 @@ return PercentRankOftheReport(@ReportOfAll(46002, DefaultRepID()), 20221231);
|
||||
|
||||
```tsl
|
||||
sp_s(PN_Stock(), 'SH600000');
|
||||
|
||||
endt := 20190701T;
|
||||
|
||||
sp_s(PN_Date(), endt);
|
||||
|
||||
sp_s(PN_Rate(), 1);
|
||||
|
||||
sp_s(PN_RateDay(), endt);
|
||||
|
||||
sp_s(pn_StockArr(), GetBKByDate('SH000300', endt));
|
||||
|
||||
Exp := @close();
|
||||
|
||||
return RankOftheDay(exp, 0);
|
||||
// 输出:161
|
||||
```
|
||||
@@ -307,19 +283,12 @@ return RankOftheDay(exp, 0);
|
||||
|
||||
```tsl
|
||||
sp_s(PN_Stock(), 'SH600000');
|
||||
|
||||
endt := 20190701T;
|
||||
|
||||
sp_s(PN_Date(), endt);
|
||||
|
||||
sp_s(PN_Rate(), 1);
|
||||
|
||||
sp_s(PN_RateDay(), endt);
|
||||
|
||||
sp_s(pn_StockArr(), GetBKByDate('SH000300', endt));
|
||||
|
||||
Exp := @close();
|
||||
|
||||
return RankOftheDay2(exp, 0);
|
||||
// 输出:161
|
||||
```
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
范例01:返回:1
|
||||
|
||||
```tsl
|
||||
returnisValidPositiveValue(1);
|
||||
return isValidPositiveValue(1);
|
||||
// 输出:1
|
||||
```
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ SetSysParam(pn_date(), 20180801t);
|
||||
return ContinuedMatchOfNDay(@close(), 3);
|
||||
```
|
||||
|
||||
## `correlOfNDay(exp_1, exp_2, n, cache_str)`
|
||||
## `correlOfNDay(exp_1, exp_2, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -63,7 +63,7 @@ return ContinuedMatchOfNDay(@close(), 3);
|
||||
| `exp_1` | string | 字符串。统计表达式1 |
|
||||
| `exp_2` | string | 字符串。统计表达式2 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:float
|
||||
|
||||
@@ -156,7 +156,7 @@ SetSysParam(pn_date(), 20231010T);
|
||||
return CovOfNDay(@close(), 10, "SH000001");
|
||||
```
|
||||
|
||||
## `decayAvgOfNDay(exp, n, cache_str)`
|
||||
## `decayAvgOfNDay(exp, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -168,7 +168,7 @@ N日线性衰减加权平均,与系统参数(股票,日期,周期,复权
|
||||
| ----------- | ------ | ------------------ |
|
||||
| `exp` | string | 字符串。统计表达式 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:float
|
||||
|
||||
@@ -285,7 +285,7 @@ SetSysParam(pn_date(), 20231010T);
|
||||
return GrowthWithLowestOfNDay(@close(), 100, 0);
|
||||
```
|
||||
|
||||
## `hhvBarsOfNDay(exp, n, cache_str)`
|
||||
## `hhvBarsOfNDay(exp, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -297,7 +297,7 @@ N日最高点到当前的周期数。N日表示市场交易日,当日最低为
|
||||
| ----------- | ------ | ------------------ |
|
||||
| `exp` | string | 字符串。统计表达式 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:int
|
||||
|
||||
@@ -414,7 +414,7 @@ SetSysParam(pn_date(), 20231010T);
|
||||
return KurtosisOfNDay(@close(), 100);
|
||||
```
|
||||
|
||||
## `llvBarsOfNDay(exp, n, cache_str)`
|
||||
## `llvBarsOfNDay(exp, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -426,7 +426,7 @@ N日最低点到当前的周期数。N日表示市场交易日,当日最低为
|
||||
| ----------- | ------ | ------------------ |
|
||||
| `exp` | string | 字符串。统计表达式 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:int
|
||||
|
||||
@@ -436,9 +436,7 @@ N日最低点到当前的周期数。N日表示市场交易日,当日最低为
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), "SH600585");
|
||||
|
||||
SetSysParam(pn_date(), 20231030T);
|
||||
|
||||
return LLVBarsOfNDay(@close(), 10, "");
|
||||
// 输出:4
|
||||
```
|
||||
@@ -518,7 +516,7 @@ SetSysParam(pn_date(), 20180801t);
|
||||
return OccuredOfNDay(@close(), 10);
|
||||
```
|
||||
|
||||
## `percentRankOfNDay(exp, n, cache_str)`
|
||||
## `percentRankOfNDay(exp, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -530,7 +528,7 @@ return OccuredOfNDay(@close(), 10);
|
||||
| ----------- | ------ | ------------------ |
|
||||
| `exp` | string | 字符串。统计表达式 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:float
|
||||
|
||||
@@ -544,7 +542,7 @@ SetSysParam(pn_date(), 20231030T);
|
||||
return PercentRankOfNDay(@close(), 10, "");
|
||||
```
|
||||
|
||||
## `productOfNDay(exp, n, cache_str)`
|
||||
## `productOfNDay(exp, n[, cache_str])`
|
||||
|
||||
声明:function
|
||||
|
||||
@@ -556,7 +554,7 @@ return PercentRankOfNDay(@close(), 10, "");
|
||||
| ----------- | ------ | ------------------ |
|
||||
| `exp` | string | 字符串。统计表达式 |
|
||||
| `n` | int | 整数。天数 |
|
||||
| `cache_str` | string | 字符串。缓存串 |
|
||||
| `cache_str` | string | 可选。字符串,缓存串 |
|
||||
|
||||
返回:float
|
||||
|
||||
@@ -590,7 +588,7 @@ return ProductOfNDay(@close(), 3, "");
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
返回上证指数在2018年7月18号的收盘价
|
||||
// 返回上证指数在2018年7月18号的收盘价
|
||||
SetSysParam(pn_stock(), 'SH000001');
|
||||
SetSysParam(pn_date(), 20180801t);
|
||||
return RefValue(@close(), 10);
|
||||
@@ -850,7 +848,7 @@ return SumifofNday(@open(), 30, "@open()>@close()", "");
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
计算平安银行截止2018年8月1日最近10个交易日的成交量和
|
||||
// 计算平安银行截止2018年8月1日最近10个交易日的成交量和
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
SetSysParam(pn_date(), 20180801t);
|
||||
return SumOfNDay(@vol(), 10);
|
||||
|
||||
+12
-14
@@ -51,7 +51,6 @@ return ACCOfNReport(@Last12MData(DefaultRepID(), 46078), 20201231, 8, 1);
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
|
||||
return AvgOfNReport(@reportofall(46002, DefaultRepID()), 20151231, 2);
|
||||
// 输出:84785000000
|
||||
```
|
||||
@@ -60,7 +59,6 @@ return AvgOfNReport(@reportofall(46002, DefaultRepID()), 20151231, 2);
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
|
||||
return AvgOfNReport(@LastQuarterData(DefaultRepID(), 46002, 0), 20151231, 2, 1);
|
||||
// 输出:24794000000
|
||||
```
|
||||
@@ -86,7 +84,7 @@ return AvgOfNReport(@LastQuarterData(DefaultRepID(), 46002, 0), 20151231, 2, 1);
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
判断2014到2015这两年平安银行年报是否全部存在
|
||||
// 判断2014到2015这两年平安银行年报是否全部存在
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
return ContinuedMatchOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 20151231, 2);
|
||||
```
|
||||
@@ -117,7 +115,7 @@ Exp := @LastQuarterData(DefaultRepID(), 46078);
|
||||
ReportID := 20211231;
|
||||
LastReportType := 0;
|
||||
t := EAAOfNReport(Exp, ReportID, LastReportType);
|
||||
return t; // -0.016
|
||||
return t; // 输出:-0.016
|
||||
```
|
||||
|
||||
## `eavOfNReport(exp, report_id, n, report_type, last_report_type)`
|
||||
@@ -150,7 +148,7 @@ N := 8;
|
||||
ReportType := 1; // 0:年度,1:季度
|
||||
LastReportType := 0;
|
||||
t := EAVOfNReport(Exp, ReportID, N, ReportType, LastReportType);
|
||||
return t; // -0.45
|
||||
return t; // 输出:-0.45
|
||||
```
|
||||
|
||||
## `growthOfNReport(exp, report_id, n, return_type)`
|
||||
@@ -175,7 +173,7 @@ return t; // -0.45
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
返回平安银行2014年与2015年报营业收入增长比例
|
||||
// 返回平安银行2014年与2015年报营业收入增长比例
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
return GrowthOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 20151231, 1, 1);
|
||||
```
|
||||
@@ -236,7 +234,7 @@ N := 5;
|
||||
ReportType := 1; // 0:年度,1:季度
|
||||
Range := 3;
|
||||
t := HighGrowthOfNReport(Exp, ReportID, N, ReportType, Range);
|
||||
return t; // 1
|
||||
return t; // 输出:1
|
||||
```
|
||||
|
||||
## `lowestOfNReport(exp, report_id, n, report_type)`
|
||||
@@ -286,9 +284,9 @@ return lowestOfNReport(@ReportOfAll(46080, DefaultRepID()), 20221231, 5, 0);
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
返回平安银行截止到2015年12月31日的所有年报数量
|
||||
// 返回平安银行截止到2015年12月31日的所有年报数量
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
returnOccuredOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 20151231, 100);
|
||||
return OccuredOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 20151231, 100);
|
||||
```
|
||||
|
||||
## `refReportValue(exp, report_id, n)`
|
||||
@@ -312,7 +310,7 @@ returnOccuredOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 2015123
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
返回平安银行2015年年报营业收入额
|
||||
// 返回平安银行2015年年报营业收入额
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
return RefReportValue(@reportofall(46002, GetSysParam('DefaultRepID')), 20161231, 1);
|
||||
```
|
||||
@@ -341,7 +339,7 @@ N期稳健加速度
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(), "SH600519");
|
||||
return RobustACCOfNReport(@Last12MData(DefaultRepID(), 9900604), 20201231, 8, 0); // -0.0878801178157446
|
||||
return RobustACCOfNReport(@Last12MData(DefaultRepID(), 9900604), 20201231, 8, 0); // 输出:-0.0878801178157446
|
||||
```
|
||||
|
||||
## `robustGrowthOfNReport(exp, report_id, n, report_type)`
|
||||
@@ -399,7 +397,7 @@ ReportID := 20211231;
|
||||
N := 8;
|
||||
ReportType := 1; // 0:年度,1:季度
|
||||
t := StandGrowthOfNReport(Exp, ReportID, N, ReportType);
|
||||
return t; // 1.265
|
||||
return t; // 输出:1.265
|
||||
```
|
||||
|
||||
## `sumOfNReport(exp, report_id, n)`
|
||||
@@ -423,7 +421,7 @@ return t; // 1.265
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
计算平安银行2015年报与2014年报营业收入的和
|
||||
// 计算平安银行2015年报与2014年报营业收入的和
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
return SumOfNReport(@reportofall(46002, GetSysParam('DefaultRepID')), 20151231, 2);
|
||||
```
|
||||
@@ -456,5 +454,5 @@ ReportID := 20210331;
|
||||
N := 5;
|
||||
ReportType := 1; // 0:年度,1:季度
|
||||
t := TurnPositiveOfNReport(Exp, ReportID, N, ReportType);
|
||||
return t; // 1
|
||||
return t; // 输出:1
|
||||
```
|
||||
|
||||
+6
-6
@@ -25,7 +25,7 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(9900002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return RobustACCOfNReport2(Exp, ReportID, N); // -0.2568
|
||||
return RobustACCOfNReport2(Exp, ReportID, N); // 输出:-0.2568
|
||||
```
|
||||
|
||||
## `avgOfNReport2(exp, report_id, n)`
|
||||
@@ -53,7 +53,7 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(46002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return AvgOfNReport2(Exp, ReportID, N); // 122912375000
|
||||
return AvgOfNReport2(Exp, ReportID, N); // 输出:122912375000
|
||||
```
|
||||
|
||||
## `robustACCOfNReport2(exp, report_id, n)`
|
||||
@@ -81,7 +81,7 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(9900002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return RobustACCOfNReport2(Exp, ReportID, N); // -0.2568
|
||||
return RobustACCOfNReport2(Exp, ReportID, N); // 输出:-0.2568
|
||||
```
|
||||
|
||||
## `robustGrowthOfNReport2(exp, report_id, n)`
|
||||
@@ -109,7 +109,7 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(9900002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return RobustGrowthOfNReport2(Exp, ReportID, N); // -0.3269
|
||||
return RobustGrowthOfNReport2(Exp, ReportID, N); // 输出:-0.3269
|
||||
```
|
||||
|
||||
## `stdOfNReport2(exp, report_id, n)`
|
||||
@@ -137,7 +137,7 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(46002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return StdOfNReport2(Exp, ReportID, N); // 56286669451.8528
|
||||
return StdOfNReport2(Exp, ReportID, N); // 输出:56286669451.8528
|
||||
```
|
||||
|
||||
## `sumOfNReport2(exp, report_id, n)`
|
||||
@@ -165,5 +165,5 @@ setsysparam(pn_stock(), "SH600000");
|
||||
Exp := @reportofall(46002, GetSysParam('DefaultRepID'));
|
||||
ReportID := 20211231;
|
||||
N := 8;
|
||||
return SumOfNReport2(Exp, ReportID, N); // 983299000000
|
||||
return SumOfNReport2(Exp, ReportID, N); // 输出:983299000000
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ return AvgOfPeriod(@close(), 20180801T, 20180802T);
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
平安银行2015到2018四个一季报营业收入的平均值
|
||||
// 平安银行2015到2018四个一季报营业收入的平均值
|
||||
SetSysParam(pn_stock(), 'sz000001');
|
||||
return AvgOfRepPeriod(@reportofall(46002, GetSysParam('DefaultRepID')), 20150331, 2018);
|
||||
```
|
||||
@@ -634,7 +634,7 @@ return SumOfPeriod(@close(), 20180801T, 20180802T);
|
||||
范例01:调用函数
|
||||
|
||||
```tsl
|
||||
平安银行2015到2018四个一季报营业收入的和
|
||||
// 平安银行2015到2018四个一季报营业收入的和
|
||||
SetSysParam(pn_stock(), 'sz000001');
|
||||
return SumOfRepPeriod(@reportofall(46002, GetSysParam('DefaultRepID')), 20150331, 2018);
|
||||
```
|
||||
@@ -738,5 +738,5 @@ return TimeOfHighestOfPeriod(@close(), 20180801T, 20180802T);
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), 'SZ000001');
|
||||
returnTimeOfLowestOfPeriod(@close(), 20180801T, 20180802T);
|
||||
return TimeOfLowestOfPeriod(@close(), 20180801T, 20180802T);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user