📝 docs(tsl): complete and lint codegen reference

This commit is contained in:
csh
2026-07-07 16:46:51 +08:00
parent 16e0992dd2
commit bbf6977f57
232 changed files with 39191 additions and 29763 deletions
+18 -18
View File
@@ -1,18 +1,18 @@
# 期货 / 基本信息
### `futuresdeliverydateendt()`
## `futuresdeliverydateendt()`
指定日的期货最后交割日,与系统参数(期货代码、日期)相关
返回:int
### `futuresMinimumTradingMarginRateEndT()`
## `futuresMinimumTradingMarginRateEndT()`
指定日期货的最低交易保证金(%),与证券代码、时间相关。
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"bc2401");
@@ -20,13 +20,13 @@ SetSysParam(PN_Date(),20231215T);
return FuturesMinimumTradingMarginRateEndT();
```
### `futuresTickSizeEndT()`
## `futuresTickSizeEndT()`
指定日期货的最小变动价位,与证券代码、时间相关。
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"OI1807");
@@ -34,13 +34,13 @@ SetSysParam(PN_Date(),20180520T);
return FuturesTickSizeEndT();
```
### `futuresMultiplierEndT()`
## `futuresMultiplierEndT()`
指定日期货的合约乘数,与证券代码、时间相关
返回:real
#### 示例
### 示例
```tsl
//计算期货合约FB2009在20190920的合约乘数。
@@ -50,13 +50,13 @@ setSysParam(pn_date(),endt);
return futuresMultiplierEndT (); //结果:500
```
### `futuresDeliveryDateEndT2()`
## `futuresDeliveryDateEndT2()`
指定日期货主力或者连续合约的交割日与系统参数(期货代码、日期)相关:
返回:INTEGER
#### 示例
### 示例
```tsl
IF01在20201207的真实合约的交割日
@@ -65,13 +65,13 @@ setSysParam(pn_date(),20201207T);
return futuresDeliveryDateEndT2(); //返回:20201218
```
### `futuresLastDateEndT()`
## `futuresLastDateEndT()`
指定期货最后交易日,与系统参数(期货代码、日期)相关
返回:INTEGER
#### 示例
### 示例
```tsl
//得到CU2101的最后交易日
@@ -79,13 +79,13 @@ setSysParam(pn_stock(),'CU2101');
return futuresLastDateEndT(); //返回20210115
```
### `futuresPriceUpperLimitEndT()`
## `futuresPriceUpperLimitEndT()`
指定日期货价格的最大波动上限(%),与证券代码、时间相关。
返回:Real
#### 示例
### 示例
```tsl
// "OI1807"在2018-06-29的每日价格最大波动上限(%)
@@ -95,13 +95,13 @@ return futuresPriceUpperLimitEndT();
//结果:4.0
```
### `futuresPriceLowerLimitEndT()`
## `futuresPriceLowerLimitEndT()`
指定日期货价格的最大波动下限(%),与证券代码、时间相关。
返回:Real
#### 示例
### 示例
```tsl
// "OI1807"在2018-06-29的每日价格最大波动下限(%)
@@ -111,12 +111,12 @@ return futuresPriceLowerLimitEndT();
//结果:-4.0
```
### `futuresbivalue(endt)`
## `futuresbivalue(endt)`
期货基本信息数据
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------ | ---- | ----------- |
| `endt` | Date | 日期,指定日 |
返回:ARRAY
+33 -33
View File
@@ -1,12 +1,12 @@
# 期货 / 期货代码
### `futuresAllPzCode()`
## `futuresAllPzCode()`
所有期货代码对照表,若有新品种上市数据也会更新,此说明不再更新。
返回:array
### `futuresCodeToPz(stockid)`
## `futuresCodeToPz(stockid)`
期货代码->期货品种,支持通过期货合约代码、主力代码、指数代码、连续代码得到期货品种代码 若无参数stockid,则取当前证券为指定代码。
@@ -16,7 +16,7 @@
返回:any
### `futurescodetopzendt(stockid)`
## `futurescodetopzendt(stockid)`
期货代码->期货品种(时间相关),支持通过期货合约代码、主力代码、指数代码、连续代码得到期货品种代码 若无参数stockid,则取当前证券为指定代码。1)期货合约代码->期货品种:基本面-交易代码 2)其它代码->期货品种:708表 3)若无参数stockid,则取当前证券为指定代码。 有些期货品种换过品种代码,所以品种代码与系统时间相关;
@@ -26,59 +26,59 @@
返回:string
### `futuresContinueCode()`
## `futuresContinueCode()`
指定期货合约的连续代码,与系统参数(期货代码)相关
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'CU2101');
return FuturesContinueCode(); //返回'LXCU00'
```
### `futuresContinueCode1()`
## `futuresContinueCode1()`
指定期货合约的连一代码,与系统参数(期货代码)相关
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'CU2101');
return FuturesContinueCode1(); //返回'LXCU01'
```
### `futuresContinueCode2()`
## `futuresContinueCode2()`
指定期货合约的连二代码,与系统参数(期货代码)相关
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'CU2101');
return FuturesContinueCode2(); //返回'LXCU02'
```
### `futuresContinueCode4()`
## `futuresContinueCode4()`
指定期货合约的连四代码,与系统参数(期货代码)相关。
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'CU2101');
return FuturesContinueCode4();
```
### `futuresGetJysCode(futures_id)`
## `futuresGetJysCode(futures_id)`
天软期货代码转换为交易所代码
@@ -88,7 +88,7 @@ return FuturesContinueCode4();
返回:string
### `futuresGetTsCode(futures_id)`
## `futuresGetTsCode(futures_id)`
交易所代码转换为天软期货代码
@@ -98,39 +98,39 @@ return FuturesContinueCode4();
返回:string
### `futuresIdToCzl()`
## `futuresIdToCzl()`
根据期货合约得到次主力线,与系统参数(期货代码)相关。
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'cu2401');
return FuturesIDToCZL();
```
### `futuresIndexCode()`
## `futuresIndexCode()`
指定期货合约的指数线代码,与系统参数(期货代码)相关
返回:string
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'IF00');
return FuturesIndexCode(); //返回'IFInd'
```
### `futuresSettlement()`
## `futuresSettlement()`
实时结算价(期货),与系统参数(证券代码,时间)相关,证券代码需使用期货实际合约,时间需要具体时间点。
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"sc2506");
@@ -138,18 +138,18 @@ SetSysParam(PN_Date(),strtodatetime('2025-04-14 11:00:00'));
return FuturesSettlement(); //结果:468.8
```
### `getFuturesBkbydate(bk_name, endt)`
## `getFuturesBkbydate(bk_name, endt)`
指定日指定板块在市交易的期货合约,期货板块具体请查看Q:天软公用市场板块说明文档或平台中的板块工具。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `bk_name` | String | 字符串,板块名称,多个板块可用;分隔 |
| `endt` | DateTime | 日期类型,截止日 |
| 参数 | 类型 | 说明 |
| --------- | -------- | ----------------------------------- |
| `bk_name` | String | 字符串,板块名称,多个板块可用;分隔 |
| `endt` | DateTime | 日期类型,截止日 |
返回:String
#### 示例
### 示例
```tsl
//取2020-2-1日,所有期货还在市交易的合给
@@ -160,13 +160,13 @@ return getFuturesBkbydate('沪深300指数;10年期国债',20200201T);
return getFuturesBkbydate('大连商品交易所',20200201T);
```
### `futuresContinueCode3()`
## `futuresContinueCode3()`
指定期货合约的连四代码,与系统参数(期货代码)相关
返回:STRING
#### 示例
### 示例
```tsl
//得到CU2101的连四代码
@@ -174,19 +174,19 @@ setSysParam(pn_stock(),'CU2101');
return futuresContinueCode4(); //返回'LXCU04'
```
### `getFuturesDerivedIdByEndt(end_t, future_type, id_type)`
## `getFuturesDerivedIdByEndt(end_t, future_type, id_type)`
指定日已上市的期货衍生代码
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `end_t` | Date | 日期, 截止日 |
| 参数 | 类型 | 说明 |
| ------------- | ---------- | ----------------------------- |
| `end_t` | Date | 日期, 截止日 |
| `future_type` | UserDefine | 用户自定义, 期货类型,默认为0 |
| `id_type` | UserDefine | 用户自定义, 代码类型,默认为0 |
| `id_type` | UserDefine | 用户自定义, 代码类型,默认为0 |
返回:array
#### 示例
### 示例
```tsl
//指定日已上市的股指期货的品种代码
@@ -1,6 +1,6 @@
# 期货 / 国债期货可交割债券
### `futuresConverFactor(bond_id)`
## `futuresConverFactor(bond_id)`
指定国债的转换因子,与系统参数(证券)相关。如果返回0,说明不是可交割债券期货。
@@ -10,14 +10,14 @@
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesConverFactor("BK210007");
```
### `futuresDeliverBondValue(bond_id)`
## `futuresDeliverBondValue(bond_id)`
国债期货的指定可交割债券的数据,与系统参数(证券)相关。如果返回array(),说明无相关数据。
@@ -27,14 +27,14 @@ return FuturesConverFactor("BK210007");
返回:array
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesDeliverBondValue("BK210007");
```
### `futuresIsDeliverBond(bond_id)`
## `futuresIsDeliverBond(bond_id)`
当前国债是否可交割债券,与系统参数(证券)相关。
@@ -44,7 +44,7 @@ return FuturesDeliverBondValue("BK210007");
返回:int
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
+12 -12
View File
@@ -1,6 +1,6 @@
# 期货 / 期货手续费
### `futuresfeeamount(endt, feeamounttype)`
## `futuresfeeamount(endt, feeamounttype)`
获得指定日期货合约手续费(元/手),与系统参数(期货合约代码)相关
@@ -11,14 +11,14 @@
返回:float
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),"cu1404");
return FuturesFeeAmount(inttodate(20140328),0);
```
### `futuresfeerate(endt, feeratetype)`
## `futuresfeerate(endt, feeratetype)`
获得指定日期货合约手续费(交易额万分之),与系统参数(期货合约代码)相关
@@ -29,14 +29,14 @@ return FuturesFeeAmount(inttodate(20140328),0);
返回:float
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),"cu1404");
return FuturesFeeRate(inttodate(20140328),0);
```
### `futuresspfeeunit(endt, feetype)`
## `futuresspfeeunit(endt, feetype)`
期货手续费单位,与系统参数(期货合约代码)相关
@@ -47,15 +47,15 @@ return FuturesFeeRate(inttodate(20140328),0);
返回:string
### `futuresspfeecost(endt, feetype, amount, vol)`
## `futuresspfeecost(endt, feetype, amount, vol)`
期货手续费单位,与系统参数(期货合约代码)相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | date | date,指定日 |
| `feetype` | usrdefine | usrdefine,手续费类型 |
| `amount` | number | number,资金总额(元) |
| `vol` | integer | integer,资金总量(手) |
| 参数 | 类型 | 说明 |
| --------- | --------- | --------------------- |
| `endt` | date | date,指定日 |
| `feetype` | usrdefine | usrdefine,手续费类型 |
| `amount` | number | number,资金总额(元) |
| `vol` | integer | integer,资金总量(手) |
返回:real
@@ -1,6 +1,6 @@
# 期货 / 结算会员成交持仓排名
### `futuresmtpavgvol(begt, endt)`
## `futuresmtpavgvol(begt, endt)`
区间机构平均成交量,单位:手,与系统参数(证券)相关。 双边成交量数据。
@@ -11,7 +11,7 @@
返回:float
### `futuresMtpInstitutNetOi(end_t, name)`
## `futuresMtpInstitutNetOi(end_t, name)`
指定日指定机构净持仓量,与系统参数(证券)相关。单位:手。如果返回0,说明无相关数据。
@@ -22,14 +22,14 @@
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutNetOI(20240201T,'东证期货');
```
### `futuresMtpInstitutOi(end_t, name, _type)`
## `futuresMtpInstitutOi(end_t, name, _type)`
指定日指定机构持仓量,与系统参数(证券)相关。单位:手
@@ -37,30 +37,30 @@ return FuturesMTPInstitutNetOI(20240201T,'东证期货');
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `name` | string | 字符串。机构简称 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutOI(20240201T,'东证期货',1);
```
### `futuresmtpinstitutoigrow(endt, name, _type)`
## `futuresmtpinstitutoigrow(endt, name, _type)`
指定日指定机构持仓量变动,单位:手,与系统参数(证券)相关。
| 参数 | 类型 | 说明 |
| ------ | --------- | ---------------------------------------------- |
| `endt` | datetime | 截止日期, |
| `name` | string | 机构简称, |
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------------------------------------------- |
| `endt` | datetime | 截止日期, |
| `name` | string | 机构简称, |
| `_type` | usrdefine | 持仓类型持买单量排名=1持卖单量排名=2,usrdefine |
返回:float
### `futuresMtpInstitutOiPercent(end_t, name, _type)`
## `futuresMtpInstitutOiPercent(end_t, name, _type)`
指定日指定机构持仓量占总持仓比(%),与系统参数(证券)相关
@@ -68,18 +68,18 @@ return FuturesMTPInstitutOI(20240201T,'东证期货',1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `name` | string | 字符串。机构简称 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutOIPercent(20240201T,'东证期货',1);
```
### `futuresMtpInstitutOiRank(end_t, name, _type)`
## `futuresMtpInstitutOiRank(end_t, name, _type)`
指定日指定机构持仓量排名,与系统参数(证券)相关。如果返回0,说明无相关数据。
@@ -87,18 +87,18 @@ return FuturesMTPInstitutOIPercent(20240201T,'东证期货',1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `name` | string | 字符串。机构简称 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:int
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutOIRank(20240201T,'东证期货',1);
```
### `futuresMtpInstitutRank(end_t, name)`
## `futuresMtpInstitutRank(end_t, name)`
指定日指定机构成交量排名,与系统参数(证券)相关。
@@ -109,14 +109,14 @@ return FuturesMTPInstitutOIRank(20240201T,'东证期货',1);
返回:int
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutRank(20240201T,'东证期货');
```
### `futuresMtpInstitutVol(end_t, name)`
## `futuresMtpInstitutVol(end_t, name)`
指定日指定机构成交量,与系统参数(证券)相关。双边成交量数据,单位:手。如果返回0,说明无相关数据
@@ -127,14 +127,14 @@ return FuturesMTPInstitutRank(20240201T,'东证期货');
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPInstitutVol(20240201T,'东证期货');
```
### `futuresMtpNoNName(end_t, top_n)`
## `futuresMtpNoNName(end_t, top_n)`
指定日第N名成交量排名的机构名称,与系统参数(证券)相关。
@@ -145,14 +145,14 @@ return FuturesMTPInstitutVol(20240201T,'东证期货');
返回:string
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPNoNName(20240201T,1);
```
### `futuresMtpNoNoi(end_t, top_n, _type)`
## `futuresMtpNoNoi(end_t, top_n, _type)`
指定日第N名机构持买单/卖单量,与系统参数(证券)相关。单位:手
@@ -160,18 +160,18 @@ return FuturesMTPNoNName(20240201T,1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `top_n` | int | 整数。第N名 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPNoNOI(20240201T,1,1);
```
### `futuresMtpNoNoiPercent(end_t, top_n, _type)`
## `futuresMtpNoNoiPercent(end_t, top_n, _type)`
指定日第N名机构持仓量占总持仓比(%),与系统参数(证券)相关。
@@ -179,18 +179,18 @@ return FuturesMTPNoNOI(20240201T,1,1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `top_n` | int | 整数。第N名 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPNoNOIPercent(20240201T,3,1);
```
### `futuresMtpNoNPercent(end_t, top_n)`
## `futuresMtpNoNPercent(end_t, top_n)`
指定日第N名机构成交量占总成交量比(%),与系统参数(证券)相关。其中行情中的成交量为单边数据,结算会员成交持仓排名的成交量为双边数据。如果返回0,说明无相关数据。
@@ -201,14 +201,14 @@ return FuturesMTPNoNOIPercent(20240201T,3,1);
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPNoNPercent(20240201T,3);
```
### `futuresMtpNoNVol(end_t, top_n)`
## `futuresMtpNoNVol(end_t, top_n)`
指定日第N名机构成交量,与系统参数(证券)相关。双边成交量数据,单位:手。如果返回0,说明无相关数据
@@ -219,14 +219,14 @@ return FuturesMTPNoNPercent(20240201T,3);
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPNoNVol(20240201T,1);
```
### `futuresmtpnonvolgrow(endt, topn)`
## `futuresmtpnonvolgrow(endt, topn)`
指定日第N名机构成交量变动,单位:手,与系统参数(证券)相关。 双边成交量数据。
@@ -237,7 +237,7 @@ return FuturesMTPNoNVol(20240201T,1);
返回:float
### `futuresMtpSumNoi(end_t, top_n, _type)`
## `futuresMtpSumNoi(end_t, top_n, _type)`
指定日前N名机构持买单/卖单量,与系统参数(证券)相关。单位:手
@@ -245,30 +245,30 @@ return FuturesMTPNoNVol(20240201T,1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `top_n` | int | 整数。前N名 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPSumNOI(20240201T,1,1);
```
### `futuresmtpsumnoigrow(endt, topn, _type)`
## `futuresmtpsumnoigrow(endt, topn, _type)`
指定日前N名机构持仓量变动,单位:手,与系统参数(证券)相关。
| 参数 | 类型 | 说明 |
| ------ | --------- | -------------------------------------- |
| `endt` | datetime | 截止日期, |
| `topn` | int | 前N名, |
| 参数 | 类型 | 说明 |
| ------- | --------- | -------------------------------------- |
| `endt` | datetime | 截止日期, |
| `topn` | int | 前N名, |
| `_type` | usrdefine | 持仓类型持买单量=1持卖单量=2,usrdefine |
返回:float
### `futuresMtpSumNoiPercent(end_t, top_n, _type)`
## `futuresMtpSumNoiPercent(end_t, top_n, _type)`
指定日前N名机构持仓量占总持仓比(%),与系统参数(证券)相关。
@@ -276,18 +276,18 @@ return FuturesMTPSumNOI(20240201T,1,1);
| ------- | -------- | ------------------------------- |
| `end_t` | datetime | 日期。截止日期 |
| `top_n` | int | 整数。前N名 |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
| `_type` | int | 用户自定义。持仓类型,取值如下: |
返回:float
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'TF2403');
return FuturesMTPSumNOIPercent(20240201T,1,1);
```
### `futuresmtpsumnvolgrow(endt, topn)`
## `futuresmtpsumnvolgrow(endt, topn)`
指定日前N名机构成交量变动,单位:手,与系统参数(证券)相关。 双边成交量数据。
@@ -298,41 +298,41 @@ return FuturesMTPSumNOIPercent(20240201T,1,1);
返回:float
### `futuresmtpnonoigrow(endt, topn, _type)`
## `futuresmtpnonoigrow(endt, topn, _type)`
指定日第N名机构持仓量变动,单位:手,与系统参数(证券)相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | date | 截止日期, |
| `topn` | integer | 第N名, |
| 参数 | 类型 | 说明 |
| ------- | -------- | -------------------------------------- |
| `endt` | date | 截止日期, |
| `topn` | integer | 第N名, |
| `_type` | usrdeine | 持仓类型持买单量=1持卖单量=2,usrdefine |
返回:real
### `futuresmtpinstitutvolgrow(endt, name)`
## `futuresmtpinstitutvolgrow(endt, name)`
指定日指定机构成交量变动,单位:手,与系统参数(证券)相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | date | 截止日期 |
| 参数 | 类型 | 说明 |
| ------ | ------ | -------- |
| `endt` | date | 截止日期 |
| `name` | string | 机构简称 |
返回:real
### `futuresMtpSumNPercent(end_t, top_n)`
## `futuresMtpSumNPercent(end_t, top_n)`
指定日前N名机构成交量占总成交量比(%),与系统参数(证券)相关。其中行情中的成交量为单边数据,结算会员成交持仓排名的成交量为双边数据。如果返回0,说明无相关数据
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | --------- | -------------- |
| `end_t` | TDateTime | 日期。截止日期 |
| `top_n` | Integer | 整数。前N名 |
| `top_n` | Integer | 整数。前N名 |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),'TF2403');
@@ -340,18 +340,18 @@ return futuresMtpSumNPercent(20240201T,3);
//结果:57.27
```
### `futuresMtpSumNVol(end_t, top_n)`
## `futuresMtpSumNVol(end_t, top_n)`
指定日前N名机构成交量,与系统参数(证券)相关。双边成交量数据,单位:手。如果返回0,说明无相关数据。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | --------- | -------------- |
| `end_t` | TDateTime | 日期。截止日期 |
| `top_n` | Integer | 整数。前N名 |
| `top_n` | Integer | 整数。前N名 |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),'TF2403');
@@ -359,18 +359,18 @@ return futuresMtpSumNVol(20240201T,3);
//结果:45405
```
### `futuresMtpInstitutPercent(end_t, name)`
## `futuresMtpInstitutPercent(end_t, name)`
指定日指定机构成交量占总成交量比(%),与系统参数(证券)相关。其中行情中的成交量为单边数据,结算会员成交持仓排名的成交量为双边数据。如果返回0,说明无相关数据。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `end_t` | TDateTime | 日期。截止日期 |
| `name` | String | 字符串。机构简称 |
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------------- |
| `end_t` | TDateTime | 日期。截止日期 |
| `name` | String | 字符串。机构简称 |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),'TF2403');
@@ -378,19 +378,19 @@ return futuresMtpInstitutPercent(20240201T,'东证期货');
//结果:29.36
```
### `futuresMtpNoNoiName(end_t, top_n, _type)`
## `futuresMtpNoNoiName(end_t, top_n, _type)`
指定日第N名持仓量排名的机构名称,与系统参数(证券)相关。其中行情中的成交量为单边数据,结算会员成交持仓排名的成交量为双边数据。如果返回空字符串,说明无相关数据。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `end_t` | TDateTime | 日期。截止日期 |
| `top_n` | Integer | 整数。第N名 |
| `_type` | Integer | 用户自定义。持仓类型,取值如下: |
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------------------------- |
| `end_t` | TDateTime | 日期。截止日期 |
| `top_n` | Integer | 整数。第N名 |
| `_type` | Integer | 用户自定义。持仓类型,取值如下: |
返回:String
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),'TF2403');
@@ -398,35 +398,35 @@ return futuresMtpNoNoiName(20240201T,2,2);
//结果:银河期货
```
### `futuresMtpInstitutValue(future_id, end_t, name, field, rank_type)`
## `futuresMtpInstitutValue(future_id, end_t, name, field, rank_type)`
指定日指定机构成交量相关数据。如果返回0,说明无相关数据。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `future_id` | String | 字符串。期货代码 |
| `end_t` | TDateTime | 日期。截止日期 |
| `name` | String | 字符串。机构简称 |
| `field` | String | 字符串。列名 |
| `rank_type` | Integer | 用户自定义。排名类型,取值如下: |
| 参数 | 类型 | 说明 |
| ----------- | --------- | ------------------------------- |
| `future_id` | String | 字符串。期货代码 |
| `end_t` | TDateTime | 日期。截止日期 |
| `name` | String | 字符串。机构简称 |
| `field` | String | 字符串。列名 |
| `rank_type` | Integer | 用户自定义。排名类型,取值如下: |
返回:Real
#### 示例
### 示例
```tsl
return futuresMtpInstitutValue('TF2403',20240201T,'东证期货','数量',0);
//结果:23278
```
### `futuresmtpavgoi(begt, endt, ranktype)`
## `futuresmtpavgoi(begt, endt, ranktype)`
区间机构平均持仓量,单位:手,与系统参数(证券)相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `begt` | date | 开始日期, |
| `endt` | date | 截止日期, |
| 参数 | 类型 | 说明 |
| ---------- | --------- | ------------------------------------------ |
| `begt` | date | 开始日期, |
| `endt` | date | 截止日期, |
| `ranktype` | usrdefine | 持仓类型,持买单量=1,持卖单量=2,usrdefine |
返回:real
+121 -121
View File
@@ -1,6 +1,6 @@
# 期货 / 其他
### `futureslimitschangecount2(n)`
## `futureslimitschangecount2(n)`
N日涨跌停板变化次数,与系统参数(期货合约代码,时间)相关
@@ -10,13 +10,13 @@ N日涨跌停板变化次数,与系统参数(期货合约代码,时间)相关
返回:float
### `futureslimitsrange()`
## `futureslimitsrange()`
指定日涨跌停板幅度,与系统参数(期货合约代码,时间)相关
返回:float
### `futuresMaintenanceMarginRate(end_t, margin_rate_type)`
## `futuresMaintenanceMarginRate(end_t, margin_rate_type)`
期货结算保证金率(%),取自期货结算参数(表704)中小于或等于EndT的最后一条数据,与系统证券pn_stock()有关。
@@ -27,14 +27,14 @@ N日涨跌停板变化次数,与系统参数(期货合约代码,时间)相关
返回:float
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),"cu1404");
return FuturesMaintenanceMarginRate(inttodate(20140331),0);
```
### `futuresPremiumRate(annual)`
## `futuresPremiumRate(annual)`
指定日升贴水率(%),与系统参数(证券代码、时间、周期、复权、基准)相关。目前仅支持股指期货,可使用主力连续代码。
@@ -44,7 +44,7 @@ return FuturesMaintenanceMarginRate(inttodate(20140331),0);
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"IC00");
@@ -52,7 +52,7 @@ SetSysParam(pn_date(),20230403T);
return FuturesPremiumRate(1);
```
### `futuresTradingMarginRate(end_t, margin_rate_type)`
## `futuresTradingMarginRate(end_t, margin_rate_type)`
期货交易保证金率(%),取自期货结算参数(表704)中小于或等于EndT-1的最后一条数据,与系统证券pn_stock()有关。
@@ -63,14 +63,14 @@ return FuturesPremiumRate(1);
返回:float
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),"cu1404");
return FuturesTradingMarginRate(inttodate(20140331),0);
```
### `getFuturesTradeRankingByDate(end_t, t)`
## `getFuturesTradeRankingByDate(end_t, t)`
指定日期货日成交持仓排名 模型从数据库中提取系统证券pn_stock的成交持仓排名数据,按照排名类型、数量降序排序。注意,设置系统参数pn_stock只能用实际的合约,比如IF1508,而不能用虚拟合约代码,IF01、IF00等。 数据详细说明及查询案例见:关于增加期货日成交持仓排名数据及访问方法
@@ -81,7 +81,7 @@ return FuturesTradingMarginRate(inttodate(20140331),0);
返回:float
#### 示例
### 示例
```tsl
setsysparam(pn_stock(),'IF1508');
@@ -89,24 +89,24 @@ GetFuturesTradeRankingByDate(20150722T,t);
return t;
```
### `futureslimitsischanged()`
## `futureslimitsischanged()`
涨跌停板幅度是否有变化,与系统参数(期货合约代码,时间)相关
返回:boolean
### `futureslimitschangecount(begt, endt)`
## `futureslimitschangecount(begt, endt)`
区间涨跌停板变化次数,与系统参数(期货合约代码,时间)相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------ | ---- | ------------- |
| `begt` | date | date,开始日期 |
| `endt` | date | date,截止日期 |
返回:real
### `qhLastTradeDay(id)`
## `qh_LastTradeDay(id)`
按照期货合约规则得到期货的最后交易日。
@@ -116,18 +116,18 @@ return t;
返回:datetime
### `futuresdeliverydaysbyendt(futuresid, endt)`
## `futuresdeliverydaysbyendt(futuresid, endt)`
计算指定日期货离交割日的交易天数
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------- | -------- | ----------------- |
| `futuresid` | security | security,期货合约 |
| `endt` | date | date,指定日 |
| `endt` | date | date,指定日 |
返回:integer
#### 示例
### 示例
```tsl
//获取CU2101在2020-3-20日距离交割日的交易天数
@@ -135,13 +135,13 @@ return futuresdeliverydaysbyendt('CU2101',20200320T);
//返回209
```
### `futuresBasis()`
## `futuresBasis()`
指定日期现基差,与系统参数(证券代码、时间、周期、复权、基准)相关。目前仅支持股指期货,可使用主力连续代码。
返回:Real
#### 示例
### 示例
```tsl
//IC00在20230403的基差
@@ -151,13 +151,13 @@ return futuresBasis();
//结果:-63.8073
```
### `futuresSpotAmountRatio()`
## `futuresSpotAmountRatio()`
指定日期现成交比,与系统参数(证券代码、时间、周期、复权、基准)相关。目前仅支持股指期货,可使用主力连续代码。
返回:Real
#### 示例
### 示例
```tsl
//IC00在20230331的期现成交比
@@ -167,13 +167,13 @@ return futuresSpotAmountRatio();
//结果:0.0914685663852422
```
### `futuresDeliverBondNum()`
## `futuresDeliverBondNum()`
当前国债期货可交割债券数,与系统参数(证券)相关。
返回:Integer
#### 示例
### 示例
```tsl
setSysParam(pn_stock(),"TF2012");
@@ -181,192 +181,192 @@ return futuresDeliverBondNum();
//结果:6
```
### `futureFeeRateField(_type)`
## `Future_FeeRateField(_type)`
结算参数-手续费(交易额万分之)。根据Type\_的取值返回对应的值
| 参数 | 类型 | 说明 |
| ------ | ---- | ---- |
| 参数 | 类型 | 说明 |
| ------- | ---- | ---- |
| `_type` | any | 整数 |
返回:string
### `futureMarginRateField(_type)`
## `Future_MarginRateField(_type)`
结算参数-保证金率。根据Type\_的取值返回对应的值
| 参数 | 类型 | 说明 |
| ------ | ---- | ---- |
| 参数 | 类型 | 说明 |
| ------- | ---- | ---- |
| `_type` | any | 整数 |
返回:string
### `futureFeeAmountField(_type)`
## `Future_FeeAmountField(_type)`
结算参数-手续费(元/手)。根据Type\_的取值返回对应的值
| 参数 | 类型 | 说明 |
| ------ | ---- | ---- |
| 参数 | 类型 | 说明 |
| ------- | ---- | ---- |
| `_type` | any | 整数 |
返回:string
### `cuTMarketValueField()`
## `CU_TMarketValueField()`
市价总值字段。
返回:string
### `cuDetailField()`
## `CU_DetailField()`
详情字段。
返回:string
### `cuEndDateField()`
## `CU_EndDateField()`
截止日字段。
返回:string
### `cuMarketValueField()`
## `CU_MarketValueField()`
市值字段。
返回:string
### `cuNMarketValueField()`
## `CU_NMarketValueField()`
流通市值字段。
返回:string
### `cuIndustryNameField()`
## `CU_IndustryNameField()`
行业名称。
返回:string
### `cuNotGetFinancialDataBeforeListField()`
## `CU_NOTGetFinancialDataBeforeListField()`
不返回上市前数据。
返回:string
### `cuValueField()`
## `CU_ValueField()`
数值字段。
返回:string|float
### `cuTtmField()`
## `CU_TTMField()`
TTM。
返回:string
### `cuChangeDateField()`
## `CU_ChangeDateField()`
变动日字段。根据数据库提供商返回对应的值
返回:string
### `cuTypeField()`
## `CU_TypeField()`
类型字段。
返回:string
### `cuItemField()`
## `CU_ItemField()`
项目字段。
返回:string
### `cuSourceField()`
## `CU_SourceField()`
来源字段。
返回:string
### `cuRemarkField()`
## `CU_RemarkField()`
备注。
返回:string
### `cuDateField()`
## `CU_DateField()`
日期字段。
返回:string|datetime
### `cuChangePercentField()`
## `CU_ChangePercentField()`
变比字段。
返回:string
### `cuChangeValueField()`
## `CU_ChangeValueField()`
变动值字段。
返回:string
### `cuReasonField()`
## `CU_ReasonField()`
原因字段。
返回:string
### `cuIndustryValueField()`
## `CU_IndustryValueField()`
行业字段。
返回:string
### `cuCompanyValueField()`
## `CU_CompanyValueField()`
公司字段。
返回:string
### `cuBegDateField()`
## `CU_BegDateField()`
开始日字段。
返回:string
### `cuPercentField()`
## `CU_PercentField()`
比例字段。
返回:string
### `cuVolumnField()`
## `CU_VolumnField()`
数量字段。 名称字段。
返回:string
### `cuNameField()`
## `cuNameField()`
返回'Integer'字符串。
返回:string
### `qhlsrF(n, _type)`
## `QHLSR_f(n, _type)`
阻力指标
| 参数 | 类型 | 说明 |
| ------ | ---- | -------- |
| `n` | any | 天数 |
| 参数 | 类型 | 说明 |
| ------- | ---- | -------- |
| `n` | any | 天数 |
| `_type` | any | 结果类型 |
返回:float
### `qhlsrV(n)`
## `QHLSR_v(n)`
阻力指标,根据量增价涨,量减价跌的走势特征,先计算出QHL值,QHL值较小说明有较强的支撑和阻力,较大说明较弱的支撑和阻力。QHLSR阻力指标在实战应用中只是判断个股和市场阻力作为参考使用,要灵活结合K线,均线等技术分析综合使用。与系统证券pn_stock()、系统时间pn_date()、系统周期pn_cycle()、复权方式pn_rate()和复权基准日pn_rateday()相关。调用时需注意设置系统参数。
@@ -376,7 +376,7 @@ TTM。
返回:float
### `qhzfXz(stock_id, begt, endt, cy)`
## `QHZF_XZ(stock_id, begt, endt, cy)`
对于期货主力线和连续线的涨幅修正。更换合约时,使用当天实际代码计算涨幅。
@@ -389,7 +389,7 @@ TTM。
返回:any
### `cumTimeZf(rsp_cycle, b_time, e_time, n)`
## `cumTimeZf(rsp_cycle, b_time, e_time, n)`
过去N个日内累计时点涨幅(%)
@@ -402,7 +402,7 @@ TTM。
返回:float
### `futuresSpotSpread(bond_id)`
## `futuresSpotSpread(bond_id)`
返回指定期货相对于指定债券标的期现价差,与系统证券代码时间周期相关。
@@ -412,18 +412,18 @@ TTM。
返回:float
### `futuresDividentPredict(endt, predict_type)`
## `futuresDividentPredict(endt, predict_type)`
股指期货合约的存续期内分红,是指从当前时间到合约到期日之间的指数的分红点位,与系统证券代码相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | Date | 日期类型,截止日 |
| `predict_type` | Int | 整型,预测方式 |
| 参数 | 类型 | 说明 |
| -------------- | ---- | ---------------- |
| `endt` | Date | 日期类型,截止日 |
| `predict_type` | Int | 整型,预测方式 |
返回:Real
#### 示例
### 示例
```tsl
//IF2409在合约期内的分红点位
@@ -432,19 +432,19 @@ end_t := 20240301T;
return futuresDividentPredict(end_t); //73.9048
```
### `futuresImpliedRate(endt, return_method, annual)`
## `futuresImpliedRate(endt, return_method, annual)`
隐含利率(%),与系统证券代码相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | Date | 日期类型,截止日 |
| `return_method` | Integer | 整型,计算收益率方法 |
| `annual` | Integer | 整型,是否年化,默认年化 |
| 参数 | 类型 | 说明 |
| --------------- | ------- | ------------------------ |
| `endt` | Date | 日期类型,截止日 |
| `return_method` | Integer | 整型,计算收益率方法 |
| `annual` | Integer | 整型,是否年化,默认年化 |
返回:Real
#### 示例
### 示例
```tsl
//IF2409在合约期内的隐含利率(%)
@@ -455,18 +455,18 @@ annual := 1;
return futuresImpliedRate(end_t,return_method,annual);  //1.3291
```
### `futuresCorrectedBasis(endt, predict_type)`
## `futuresCorrectedBasis(endt, predict_type)`
矫正基差,当前基差加上期内分红得到矫正基差,它可以剔除分红对基差影响。与系统证券代码相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | Date | 日期类型,截止日 |
| `predict_type` | Int | 整型,预测方式 |
| 参数 | 类型 | 说明 |
| -------------- | ---- | ---------------- |
| `endt` | Date | 日期类型,截止日 |
| `predict_type` | Int | 整型,预测方式 |
返回:Real
#### 示例
### 示例
```tsl
//IF2409在合约期内的矫正基差
@@ -475,19 +475,19 @@ end_t := 20240301T;
return futuresCorrectedBasis(end_t); //26.301
```
### `futuresTimeValue(endt, r, predict_type)`
## `futuresTimeValue(endt, r, predict_type)`
时间价值,与系统证券代码相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | Date | 日期类型,截止日 |
| `r` | Real | 实数型,年化利率(%)。支持用户传入,用户没传入时,使用隐含利率(%)模型FuturesImpliedRate。 |
| `predict_type` | Int | 整型,预测方式 |
| 参数 | 类型 | 说明 |
| -------------- | ---- | ---------------------------------------------------------------------------------------- |
| `endt` | Date | 日期类型,截止日 |
| `r` | Real | 实数型,年化利率(%)。支持用户传入,用户没传入时,使用隐含利率(%)模型FuturesImpliedRate。 |
| `predict_type` | Int | 整型,预测方式 |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),"IF2409");
@@ -495,19 +495,19 @@ end_t := 20240301T;
return futuresTimeValue(endt);    //26.3782
```
### `futuresTheoryBasis(endt, r, predict_type)`
## `futuresTheoryBasis(endt, r, predict_type)`
理论基差,与系统证券代码相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | Date | 日期类型,截止日 |
| `r` | Real | 实数型,年化利率(%)。支持用户传入,用户没传入时,使用隐含利率(%)模型FuturesImpliedRate。 |
| `predict_type` | Int | 整型,预测方式 |
| 参数 | 类型 | 说明 |
| -------------- | ---- | ---------------------------------------------------------------------------------------- |
| `endt` | Date | 日期类型,截止日 |
| `r` | Real | 实数型,年化利率(%)。支持用户传入,用户没传入时,使用隐含利率(%)模型FuturesImpliedRate。 |
| `predict_type` | Int | 整型,预测方式 |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),"IF2409");
@@ -515,13 +515,13 @@ end_t := 20240301T;
return futuresTheoryBasis(endt);    //-47.5267
```
### `futuresBasisRatio()`
## `futuresBasisRatio()`
基差占比(%),与系统证券代码、时间相关
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),"IF2409");
@@ -530,13 +530,13 @@ return futuresBasisRatio();  //-1.3456
//返回:-1.3456
```
### `futureBaseinfo()`
## `future_baseinfo()`
基本信息
返回:bool
### `futureWarehouseDaily(pz_id, beg_t, end_t)`
## `future_WarehouseDaily(pz_id, beg_t, end_t)`
期货仓单日报,适用于大商所、上期所、郑商所、广期所的期货品种
@@ -548,7 +548,7 @@ return futuresBasisRatio();  //-1.3456
返回:bool
### `futureDtList(end_t)`
## `future_DTList(end_t)`
结算会员成交持仓排名
@@ -558,7 +558,7 @@ return futuresBasisRatio();  //-1.3456
返回:bool
### `futuresDtList(pz_id, end_t, show_type)`
## `futures_DTList(pz_id, end_t, show_type)`
期货品种结算会员成交持仓排名
@@ -570,45 +570,45 @@ return futuresBasisRatio();  //-1.3456
返回:bool
### `futuresBaseinfo()`
## `futures_baseinfo()`
期货品种基本信息
返回:bool
### `getFuturesTradeRankingDate(futurearr, end_t)`
## `getFuturesTradeRankingDate(futurearr, end_t)`
指定日期货列表成交持仓排名最新数据日,与系统参数当前证券相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `futurearr` | Array | 一维字符串数组,期货合约列表 |
| `end_t` | TDateTime | 日期,截止日期 |
| 参数 | 类型 | 说明 |
| ----------- | --------- | --------------------------- |
| `futurearr` | Array | 一维字符串数组,期货合约列表 |
| `end_t` | TDateTime | 日期,截止日期 |
返回:Boolean
### `getFutureTradeRankingDate(end_t)`
## `getFutureTradeRankingDate(end_t)`
指定日期货成交持仓排名最新数据日,与系统参数当前证券相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------- |
| `end_t` | TDateTime | 日期,截止日期 |
返回:Boolean
### `getFuturesTradeRankingByDate3(end_t, t)`
## `getFuturesTradeRankingByDate3(end_t, t)`
指定日最新期货成交持仓排名,与系统参数当前证券相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `end_t` | TDateTime | 日期,截止日期 |
| `t` | Array | 数据表类型,返回结果 |
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------------- |
| `end_t` | TDateTime | 日期,截止日期 |
| `t` | Array | 数据表类型,返回结果 |
返回:Boolean
#### 示例
### 示例
```tsl
//"IF1211" 在截至日20121026的成交持仓排名
+5 -5
View File
@@ -1,6 +1,6 @@
# 期货 / 指定日
### `futuresMtpGetData(future_id, end_t, _type)`
## `futuresMtpGetData(future_id, end_t, _type)`
结算会员成交持仓排名相关数据。如果返回array(),说明无相关数据。
@@ -8,11 +8,11 @@
| ----------- | -------- | ------------------------------- |
| `future_id` | string | 字符串。期货代码 |
| `end_t` | datetime | 日期。截止日期 |
| `_type` | int | 用户自定义。排名类型,取值如下: |
| `_type` | int | 用户自定义。排名类型,取值如下: |
返回:array
### `futuresMtpGetDataQj(future_id, begt, end_t, rank_type)`
## `futuresMtpGetDataQj(future_id, begt, end_t, rank_type)`
结算会员成交持仓排名相关数据。如果返回array(),说明无相关数据。
@@ -25,7 +25,7 @@
返回:array
### `futuresMtpNoNVolValue(future_id, end_t, top_n, field, rank_type)`
## `futuresMtpNoNVolValue(future_id, end_t, top_n, field, rank_type)`
指定日第N名机构成交量相关数据。如果返回0,说明无相关数据。
@@ -39,7 +39,7 @@
返回:float
### `futuresMtpSumNVolValue(future_id, end_t, top_n, field, rank_type)`
## `futuresMtpSumNVolValue(future_id, end_t, top_n, field, rank_type)`
指定日前N名机构成交量相关数据。如果返回0,说明无相关数据
@@ -1,6 +1,6 @@
# 期货 / 仓单日报
### `futuresRegion(warehouse)`
## `futuresRegion(warehouse)`
仓库所在的地区,与系统参数(期货品种代码、时间)相关。注:本函数只用于上海期货交易所。
@@ -10,7 +10,7 @@
返回:string
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"CU");
@@ -18,7 +18,7 @@ setsysparam(pn_date(),20210401T);
return FuturesRegion("南储仓储");
```
### `futuresWarehouse(sign, warehouse, region)`
## `futuresWarehouse(sign, warehouse, region)`
仓单日报数据汇总(按条件),与系统参数(期货品种代码、日期)相关。 单位:上期所:黄金、白银:千克,其他品种:吨; 大商所:手 郑商所:张
@@ -30,7 +30,7 @@ return FuturesRegion("南储仓储");
返回:实数
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'cu');
@@ -38,7 +38,7 @@ SetSysParam(PN_date(),20210401T);
Return FuturesWarehouse(0,'南储仓储','广东');
```
### `futuresWarehouseChange(warehouse, region)`
## `futuresWarehouseChange(warehouse, region)`
与系统参数(期货品种代码、时间)相关 1、当Warehouse、Region为空时,为仓单净变动量; 2、当Warehouse为空、Region为地区名时,为上期所-指定地区仓单净变动量; 3、当Warehouse为仓库名、Region为空时,为指定仓库仓单净变动量; 4、当Warehouse为仓库名、Region为地区名时,为上期所-指定地区仓库仓单净变动量, 5、单位: 1)上期所:黄金、白银:千克,其他品种:吨; 2)大商所:手 3)郑商所:张
@@ -49,7 +49,7 @@ Return FuturesWarehouse(0,'南储仓储','广东');
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),'sn');
@@ -57,7 +57,7 @@ SetSysParam(pn_date(),20200518T);
return FuturesWarehouseChange("","上海");
```
### `futuresWarehousePredictionVol(warehouse)`
## `futuresWarehousePredictionVol(warehouse)`
与系统参数(期货品种代码、时间)相关 1、当Warehouse为空时,为有效预报总量; 2、当Warehouse为仓库名时,为指定仓库有效预报总量, 3、注:本函数只用于郑州商品交易所 4、单位: 1)上期所:黄金、白银:千克,其他品种:吨; 2)大商所:手 3)郑商所:张
@@ -67,7 +67,7 @@ return FuturesWarehouseChange("","上海");
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),'SR');
@@ -75,7 +75,7 @@ SetSysParam(pn_date(),20200518T);
return FuturesWarehousePredictionVol();
```
### `futuresWarehouseRatio(warehouse, region)`
## `futuresWarehouseRatio(warehouse, region)`
与系统参数(期货品种代码、时间)相关。 1、当Warehouse、Region为空时,为仓单变比(%) 2、当Warehouse为空、Region为地区名时,为上期所-指定地区仓单变比(%); 3、当Warehouse为仓库名、Region为空时,为指定仓库仓单变比(%); 4、当Warehouse为仓库名、Region为地区名时,为上期所-指定地区仓库仓单变比(%), 5、算法:仓单净变动量/前一交易日仓单总量\*100%
@@ -86,7 +86,7 @@ return FuturesWarehousePredictionVol();
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),'sn');
@@ -94,19 +94,19 @@ SetSysParam(pn_date(),20200518T);
return FuturesWarehouseRatio();
```
### `getFuturesDailyWarehouse(beg_t, end_t, t)`
## `getFuturesDailyWarehouse(beg_t, end_t, t)`
获得指定品种指定时间段的仓单日报数据。注意,设置系统参数pn_stock为品种代码,比如setsysparam(pn_stock(),'CF'),参考范例。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `beg_t` | TDateTime | 开始日 |
| `end_t` | TDateTime | 截止日 |
| `t` | Array | 返回满足查询条件的仓单日报数据 |
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------------------------ |
| `beg_t` | TDateTime | 开始日 |
| `end_t` | TDateTime | 截止日 |
| `t` | Array | 返回满足查询条件的仓单日报数据 |
返回:Bool
#### 示例
### 示例
```tsl
//获取"CF"品种一段时间的仓单日报
@@ -120,18 +120,18 @@ else
return "获取数据失败";
```
### `futuresWarehouseVol(warehouse, region)`
## `futuresWarehouseVol(warehouse, region)`
与系统参数(期货品种代码、时间)相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------- | ------ | ------ |
| `warehouse` | String | 仓库名 |
| `region` | String | 地区名 |
| `region` | String | 地区名 |
返回:real
#### 示例
### 示例
```tsl
//返回截止日为20200518,仓库国储天威关于SN(锡)的仓单总量
@@ -140,18 +140,18 @@ setSysParam(pn_date(),20200518T);
return futuresWarehouseVol("国储天威");
```
### `futuresWarehouseRatio2(warehouse, region)`
## `futuresWarehouseRatio2(warehouse, region)`
与系统参数(期货品种代码、时间)相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------- | ------ | ------ |
| `warehouse` | String | 仓库名 |
| `region` | String | 地区名 |
| `region` | String | 地区名 |
返回:real
#### 示例
### 示例
```tsl
//返回截止日为20200518,仓库国储天威关于SN(锡)的仓单变比(%)
@@ -160,17 +160,17 @@ setSysParam(pn_date(),20200518T);
return futuresWarehouseRatio2("国储天威");
```
### `futuresTheWarehouseVolRatio(warehouse)`
## `futuresTheWarehouseVolRatio(warehouse)`
与系统参数(期货品种代码、时间)相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------- | ------ | ------ |
| `warehouse` | String | 仓库名 |
返回:real
#### 示例
### 示例
```tsl
//返回截止日为20200518,仓库国储天威关于SN(锡)占该地区仓单总量比(%)