feat(tsl-api-reference): add class and framework API lookup

This commit is contained in:
csh
2026-08-20 13:49:55 +08:00
parent 7233646398
commit 651c1f68d2
637 changed files with 25498 additions and 36673 deletions
@@ -1,6 +1,6 @@
# 量化 / 多因子
## `TSMultiFactor`
## `tsMultiFactor`
声明:class
@@ -8,7 +8,7 @@
<!-- tags: 调用 聚合 检查 判定 验证 因子分析 因子指标 历史模拟 -->
### `fBegT`
### `FBegT`
声明:field
@@ -18,7 +18,7 @@
类型:date_time
### `fEndT`
### `FEndT`
声明:field
@@ -28,7 +28,7 @@
类型:date_time
### `fIndexId`
### `FIndexId`
声明:field
@@ -38,7 +38,7 @@
类型:string
### `fCycle`
### `FCycle`
声明:field
@@ -48,7 +48,7 @@
类型:string
### `fFactorArr`
### `FFactorArr`
声明:field
@@ -58,7 +58,7 @@
类型:array
### `fFillMissType`
### `FFillMissType`
声明:field
@@ -68,7 +68,7 @@
类型:integer
### `fAbnormalType`
### `FAbnormalType`
声明:field
@@ -78,7 +78,7 @@
类型:integer
### `fStandarizeType`
### `FStandarizeType`
声明:field
@@ -88,7 +88,7 @@
类型:integer
### `fNeuType`
### `FNeuType`
声明:field
@@ -98,7 +98,7 @@
类型:integer
### `fOrthType`
### `FOrthType`
声明:field
@@ -108,7 +108,7 @@
类型:integer
### `fConstr`
### `FConstr`
声明:field
@@ -118,7 +118,7 @@
类型:string
### `fBuyRatio`
### `FBuyRatio`
声明:field
@@ -128,7 +128,7 @@
类型:numeric
### `fSellRatio`
### `FSellRatio`
声明:field
@@ -138,7 +138,7 @@
类型:numeric
### `fGroupType`
### `FGroupType`
声明:field
@@ -148,7 +148,7 @@
类型:integer
### `fGroups`
### `FGroups`
声明:field
@@ -158,7 +158,7 @@
类型:string
### `fIndustryMethod`
### `FIndustryMethod`
声明:field
@@ -168,7 +168,7 @@
类型:integer
### `fRateType`
### `FRateType`
声明:field
@@ -178,7 +178,7 @@
类型:integer
### `fGridNo`
### `FGridNo`
声明:field
@@ -188,7 +188,7 @@
类型:integer
### `fpriceType`
### `FpriceType`
声明:field
@@ -198,7 +198,7 @@
类型:integer
### `fvolModType`
### `FvolModType`
声明:field
@@ -208,7 +208,7 @@
类型:integer
### `fdividendType`
### `FdividendType`
声明:field
@@ -218,7 +218,7 @@
类型:integer
### `fAllotmentType`
### `FAllotmentType`
声明:field
@@ -228,7 +228,7 @@
类型:integer
### `fBacktestType`
### `FBacktestType`
声明:field
@@ -238,7 +238,7 @@
类型:integer
### `fbmType`
### `FbmType`
声明:field
@@ -248,7 +248,7 @@
类型:integer
### `fbmDetail`
### `FbmDetail`
声明:field
@@ -258,7 +258,7 @@
类型:array
### `backTest()`
### `BackTest()`
声明:function
@@ -268,7 +268,7 @@
可见性:`public`
### `calculateFactorValue()`
### `CalculateFactorValue()`
声明:function
@@ -278,7 +278,7 @@
可见性:`public`
### `getTimeSeries()`
### `GetTimeSeries()`
声明:function
@@ -290,7 +290,7 @@
返回:array
### `getSamples(v_end_t)`
### `GetSamples(v_end_t)`
声明:function
@@ -306,7 +306,7 @@
返回:array
### `getFactors(end_t)`
### `GetFactors(end_t)`
声明:function
@@ -322,7 +322,7 @@
返回:array
### `getFactorParams(end_t, factor_param)`
### `GetFactorParams(end_t, factor_param)`
声明:function
@@ -339,7 +339,7 @@
返回:array
### `getGroupFactorValue()`
### `GetGroupFactorValue()`
声明:function
@@ -351,7 +351,7 @@
返回:var_array
### `getGroupFactorValue(v_end_t)`
### `GetGroupFactorValue(v_end_t)`
声明:function
@@ -367,7 +367,7 @@
返回:var_array
### `getGroupFactorValue(group_id)`
### `GetGroupFactorValue(group_id)`
声明:function
@@ -383,7 +383,7 @@
返回:var_array
### `getGroupFactorValue(group_name)`
### `GetGroupFactorValue(group_name)`
声明:function
@@ -399,7 +399,7 @@
返回:var_array
### `getGroupFactorValue(v_end_t, group_id)`
### `GetGroupFactorValue(v_end_t, group_id)`
声明:function
@@ -416,7 +416,7 @@
返回:var_array
### `factorValue_QueryfactorfullTable(endt, query_typ)`
### `FactorValue_QueryfactorfullTable(endt, query_typ)`
声明:function
@@ -433,7 +433,7 @@
返回:var_array
### `factortccq_quaeyhistory(begt, endt, filtertype)`
### `Factortccq_quaeyhistory(begt, endt, filtertype)`
声明:function
@@ -451,7 +451,7 @@
返回:array
### `getGroupReturn(p_type, cy)`
### `GetGroupReturn(p_type, cy)`
声明:function
@@ -468,7 +468,7 @@
返回:array
### `getGroupTurnOver(weight_type)`
### `GetGroupTurnOver(weight_type)`
声明:function
@@ -482,7 +482,7 @@
| ------------- | ---- | ---------------------------------------------------------------- |
| `weight_type` | int | 换手率计算方法 取值 含义 备注 1 个数法换手率 默认 2 权重法换手率 |
### `getTrailingReturn(cy, if_benchmark)`
### `GetTrailingReturn(cy, if_benchmark)`
声明:function
@@ -499,7 +499,7 @@
返回:array
### `getSignificanceStatistics(cy)`
### `GetSignificanceStatistics(cy)`
声明:function
@@ -515,7 +515,7 @@
返回:array
### `getLongShortStatistics(cy)`
### `GetLongShortStatistics(cy)`
声明:function
@@ -531,7 +531,7 @@
返回:array
### `getInformationCoefficient(ret_type)`
### `GetInformationCoefficient(ret_type)`
声明:function
@@ -547,7 +547,7 @@
返回:array
### `getInformationCoefficientbyICType(ic_type)`
### `GetInformationCoefficientbyICType(ic_type)`
声明:function
@@ -563,7 +563,7 @@
返回:array
### `getSignalStability()`
### `GetSignalStability()`
声明:function
@@ -575,7 +575,7 @@
返回:array
### `getLinearEvaluationResult(show_type)`
### `GetLinearEvaluationResult(show_type)`
声明:function
@@ -591,7 +591,7 @@
返回:array
### `getPrincipalComponentResult(fep, show_type)`
### `GetPrincipalComponentResult(fep, show_type)`
声明:function
@@ -608,7 +608,7 @@
返回:array
### `getDecay_InformationCoefficient(begt, endt, ret_type, lag_n)`
### `GetDecay_InformationCoefficient(begt, endt, ret_type, lag_n)`
声明:function
@@ -627,7 +627,7 @@
返回:array
### `getDecay_SignalStability(begt, endt, ret_type, lag_n)`
### `GetDecay_SignalStability(begt, endt, ret_type, lag_n)`
声明:function
@@ -646,7 +646,7 @@
返回:array
### `getDecay_IC(lag_n, cycle, ret_type)`
### `GetDecay_IC(lag_n, cycle, ret_type)`
声明:function
@@ -664,7 +664,7 @@
返回:array
### `getDecay_ICByICType(lag_n, cycle, ret_type, ic_type)`
### `GetDecay_ICByICType(lag_n, cycle, ret_type, ic_type)`
声明:function
@@ -683,7 +683,7 @@
返回:array
### `getIndustryIC(beg_t, end_t, ret_type, ic_type)`
### `GetIndustryIC(beg_t, end_t, ret_type, ic_type)`
声明:function
@@ -702,7 +702,7 @@
返回:array
### `getStockZoneIC(beg_t, end_t, ret_type, indesx, ic_type)`
### `GetStockZoneIC(beg_t, end_t, ret_type, indesx, ic_type)`
声明:function
@@ -722,7 +722,7 @@
返回:array
### `updateStockInfoData(factor_raw_table, v_endt)`
### `UpdateStockInfoData(factor_raw_table, v_endt)`
声明:function
@@ -737,7 +737,7 @@
| `factor_raw_table` | array | 因子原值,主要包含代码、截止日、因子原值 |
| `v_endt` | datetime | 调仓日 |
### `industrializeData(factortable, v_end_t)`
### `IndustrializeData(factortable, v_end_t)`
声明:function
@@ -754,7 +754,7 @@
返回:array
### `getBenchmarkWeight(v_end_t)`
### `GetBenchmarkWeight(v_end_t)`
声明:function
@@ -770,7 +770,7 @@
返回:array
### `getBenchmarkDailyReturn(v_beg_t, v_end_t)`
### `GetBenchmarkDailyReturn(v_beg_t, v_end_t)`
声明:function
@@ -787,7 +787,7 @@
返回:array
### `fillMissData(factor_matrix, factors, index)`
### `FillMissData(factor_matrix, factors, index)`
声明:function
@@ -805,7 +805,7 @@
返回:array
### `normalizeData(factor_matrix, factors)`
### `NormalizeData(factor_matrix, factors)`
声明:function
@@ -822,7 +822,7 @@
返回:array
### `standarizeData(factor_matrix, factors)`
### `StandarizeData(factor_matrix, factors)`
声明:function
@@ -839,7 +839,7 @@
返回:array
### `neutralizeData(factor_table, factors)`
### `NeutralizeData(factor_table, factors)`
声明:function
@@ -856,7 +856,7 @@
返回:array
### `orthData(factor_table)`
### `OrthData(factor_table)`
声明:function
@@ -872,7 +872,7 @@
返回:array
### `orthDataCore(factor_table, factors)`
### `OrthDataCore(factor_table, factors)`
声明:function
@@ -889,7 +889,7 @@
返回:array
### `scoreData(factor_matrix, my_factor_arr)`
### `ScoreData(factor_matrix, my_factor_arr)`
声明:function
@@ -906,7 +906,7 @@
返回:array
### `groupData(data, v_end_t)`
### `GroupData(data, v_end_t)`
声明:function
@@ -923,7 +923,7 @@
返回:array
### `allocateWeight(data, v_end_t)`
### `AllocateWeight(data, v_end_t)`
声明:function
@@ -940,7 +940,7 @@
返回:array
### `allocateWeightByGroup(data, v_end_t)`
### `AllocateWeightByGroup(data, v_end_t)`
声明:function
@@ -957,7 +957,7 @@
返回:array
### `getShowPeriod()`
### `GetShowPeriod()`
声明:function
@@ -969,7 +969,7 @@
返回:array
### `userCalFactors(data, end_t)`
### `UserCalFactors(data, end_t)`
声明:function
@@ -985,82 +985,3 @@
| `end_t` | datetime | 需要获取并合并本地因子值的指定日期 |
返回:array
### `tsmf_factory_byFactorarr(factorarr, indexid)`
声明:function
多因子评价构造器-01.1-每期固定因子库
<!-- tags: 评估 因子分析 因子指标 -->
可见性:`public`
| 参数 | 类型 | 说明 |
| ----------- | ---------- | ------------------------------ |
| `factorarr` | array | 每期固定的因子库配置数组 |
| `indexid` | index_list | 作为基准指数与选股域的指数标识 |
返回:array
#### 示例
范例01:范例01
```tsl
factors := unit(MF_Demo_Data_YS_03).samplefactors();
mobj := tsmf_factory_byFactorarr(factors,'SZ399903');
mobj.Fcycle := cy_month();
mobj.fbegt := 20200101T;
mobj.fendt := 20210101T;
mobj.backtest();
return mobj.getgroupreturn(1,cy_day());//更多见多因子框架相关文档。
```
范例02:调用示例
```tsl
factorarr := TSUT_Data_factorRandN()['因子库'];
obj := tsmf_factory_byFactorarr(factorarr,'SH000300');
obj.backtest();
return obj.getgroupreturn(1,cy_day());//更多见多因子框架相关文档。
```
### `tsmf_factory_bySigleStockFormula(formula, indexid)`
声明:function
多因子评价构造器-01.2-单个股票因子公式
<!-- tags: 评估 因子分析 因子指标 证券 -->
可见性:`public`
| 参数 | 类型 | 说明 |
| --------- | ---------- | -------------------- |
| `formula` | string | 字符串,因子公式 |
| `indexid` | index_list | 指数,基准指数&选股域 |
返回:array
#### 示例
范例01:调用示例
```tsl
obj := tsmf_factory_bySigleStockFormula('close()','SH000300');
obj.backtest();
return obj.getgroupreturn(1,cy_day());//更多见多因子框架相关文档。
```
范例02:范例01
```tsl
//代码:最近20 日 在沪深300 的表现(数据处理等按默认设置,默认5 组,详见属性汇总)
obj := tsmf_factory_bySigleStockFormula('stockzf2(20)','SH000300');
obj.FBegT := 20250101T;
obj.FEndT := 20260428T;
obj.FCycle := cy_month();
obj.backtest();
return mulfactor_Invoker_ExportfactorBackTestData(obj);//返回常用结果
```