Squashed 'docs/standards/playbook/' changes from b529012..a854534
a854534 ✨ feat(plan_progress): auto-detect env for blocked plans 0d9a8ec 🐛 fix(playbook): honor no_backup for sync 2d401fa ✅ test(templates): update prompts validation e23474e 📝 docs(playbook): update prompts and sync notes 60ff3cd 🐛 fix(playbook): sync templates per file 816f036 ✅ test(playbook): add sync and vendor coverage 625cabb 📝 docs(memory_bank): reformat templates 2554c87 📝 docs(prompts): refresh prompt templates 6774a9d ✨ feat(plan_progress): track plan status in progress.md 73d5c26 🔧 chore(playbook): split sync_templates into sections 278750e ✨ feat(playbook): add plan progress tracking and rules updates 6efd637 🐛 fix(sync): keep agents block blank lines ea00d43 🐛 fix(playbook): support toml without tomllib ab0dd11 📝 docs(playbook): drop docs/plans snapshots 398696c ✨ feat(playbook): merge unified cli d959f80 🎨 style(docs): format markdown b4f712a 🗑️ remove(legacy): drop old scripts and tests 0c4cd0e ✨ feat(actions): add install_skills and format_md 3d1582c ✨ feat(sync): add templates and standards actions 49bbfa1 ✨ feat(vendor): add playbook snapshot generation 8cfcc25 ✨ feat(cli): parse toml config and dispatch actions 05903c3 ✨ feat(cli): add toml config and dispatch order 65d216e ✅ test(cli): add basic playbook cli tests f0bcf54 📝 docs(plans): add unified playbook cli plan 0885309 📝 docs(plans): add unified playbook cli design 3483d8a 🔧 chore(git): ignore .worktrees dir eb75036 🔧 chore(templates): align agent templates and docs efb93f1 📝 docs(playbook): drop todo/confirm mentions 4a85306 🗑️ remove(workflow): drop todo/confirm artifacts 9c5ee9f 🎨 style(markdown): format docs with prettier 5a2925f 🐛 fix(scripts): repair windows script parsing 26a35e0 ✅ test(ci): update required skills list 8df3883 🐛 fix(test): skip external root doc links b067fc1 📦 deps(skills): sync superpowers c03cda0 🔧 chore(ci): sync from origin main 55e05cb 🔧 chore(ci): use superpowers sync script 73c97f3 🔧 chore(ci): centralize superpowers sync 945704f 🔧 chore(ci): add superpowers sync workflow e5d2c93 🗑️ remove(skills): drop duplicate workflows 3ae9708 🐛 fix(ci): update tests for flag-only scripts c44b9aa 🔧 chore(scripts): require flag-driven args e4e1d14 🔧 chore(scripts): unify single-dash options b2eb475 ✅ test(templates): add template coverage fc230b7 🎨 style(markdown): format markdown files 8dc8924 🔧 chore(markdown): add prettier config and usage 2045dd4 ✨ feat(vendor_playbook): add apply-templates option 872d8cf ✨ feat(templates): add sync templates scaffolding 5b1ca45 📝 docs(skills): clarify todo-plan template 054967a ✨ feat(skills): add todo-plan skill cc340f1 🔧 chore(ci): align standards-check workflow template e9de0aa 🔧 chore(ci): drop removed skill check e5dd7d9 🔧 fix(sync): avoid backtick expansion 087b0b9 🔧 chore(sync): align agents block across ps1/bat 9481510 🔧 chore(sync): scope agents block to existing langs b0ca842 🔧 fix(sync): rewrite docs path in agents c98d65c 🔧 chore(sync): rewrite agents docs paths c33611c 🗑️ remove(skills): drop unused skills and update references 2b37860 🎨 style(markdown): format markdown files e3ecd26 📝 docs(tsl): align syntax annotations and examples 37546fe 🐛 fix(playbook): enforce rulesets to agents flow f2df89d 🐛 fix(scripts): include language list in AGENTS.md c0d0737 🐛 fix(playbook): add agents mirror for sync 3b8b99b 🎨 style(markdown): normalize md headings and lists 31f3000 ♻️ refactor(playbook): rename agents template directory to rulesets 11b2bed ✨ feat(markdown): add ruleset and sync support 5b89580 ✅ test(scripts): quiet git init warnings 5822a87 ♻️ refactor(playbook): streamline agents and refresh tsl docs git-subtree-dir: docs/standards/playbook git-subtree-split: a85453439f65b0c0aa05a5bbece773a02216ce76
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -10,40 +10,29 @@
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
// "MA110C2375"在20210322日的开仓手续费额
|
||||
|
||||
|
||||
SetSysParam(PN_Date(),20210322T);
|
||||
|
||||
|
||||
return GetDataByMd("MA110C2375.SP",1);
|
||||
|
||||
//结果:0.5
|
||||
SetSysParam(PN_Date(), 20210322T);
|
||||
return GetDataByMd("MA110C2375.SP", 1);
|
||||
// 结果:0.5
|
||||
```
|
||||
|
||||
##### GetDataByMd2
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
// "MA110C2375"在20210322日的开仓手续费额
|
||||
|
||||
|
||||
SetSysParam(PN_Date(),20210322T);
|
||||
|
||||
|
||||
return GetDataByMd2("MA110C2375.SP",1);
|
||||
|
||||
//结果:0.5
|
||||
SetSysParam(PN_Date(), 20210322T);
|
||||
return GetDataByMd2("MA110C2375.SP", 1);
|
||||
// 结果:0.5
|
||||
```
|
||||
|
||||
##### StockIndustryLowerArr
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
// 在20201207的申万一级行业列表
|
||||
|
||||
return StockIndustryLowerArr("SWHY110000",20201207T);
|
||||
return StockIndustryLowerArr("SWHY110000", 20201207T);
|
||||
```
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
data:=spec(FundNAWZFQk(20240308t,20240831t,cy_day(),0,0), "OF000001");
|
||||
|
||||
t := sselect ["净值收益率(%)"] from data end;
|
||||
|
||||
return Hurst(t);// 0.47
|
||||
```tsl
|
||||
data := spec(FundNAWZFQk(20240308t, 20240831t, cy_day(), 0, 0), "OF000001");
|
||||
t := sselect ["净值收益率(%)"] from data end;
|
||||
return Hurst(t); // 0.47
|
||||
```
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -15,101 +15,78 @@
|
||||
|
||||
###### ForExrateMidPrice
|
||||
|
||||
用途:汇率相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//2020年4月20日美元/人民币的中间价
|
||||
|
||||
SetSysParam(PN_Stock(),'FXUSDCNY');
|
||||
|
||||
return ForExrateMidPrice(20200420T);
|
||||
|
||||
//返回7.0657
|
||||
```tsl
|
||||
// 2020年4月20日美元/人民币的中间价
|
||||
SetSysParam(PN_Stock(), 'FXUSDCNY');
|
||||
return ForExrateMidPrice(20200420T);
|
||||
// 返回7.0657
|
||||
```
|
||||
|
||||
###### ForExrateMidPriceBegTEndT
|
||||
|
||||
用途:汇率相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//2020年4月20日到4月30日美元/人民币的中间价数据
|
||||
|
||||
SetSysParam(PN_Stock(),'FXUSDCNY');
|
||||
|
||||
begt:=20200420T;
|
||||
|
||||
endt:=20200430T;
|
||||
|
||||
return ForExrateMidPriceBegTEndT(begt,endt);
|
||||
```tsl
|
||||
// 2020年4月20日到4月30日美元/人民币的中间价数据
|
||||
SetSysParam(PN_Stock(), 'FXUSDCNY');
|
||||
begt := 20200420T;
|
||||
endt := 20200430T;
|
||||
return ForExrateMidPriceBegTEndT(begt, endt);
|
||||
```
|
||||
|
||||
//返回:
|
||||
|
||||
<table><tbody><tr><td>
|
||||
日期</td><td>
|
||||
代码</td><td>
|
||||
中间价</td></tr><tr><td>
|
||||
20200420</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0657</td></tr><tr><td>
|
||||
20200421</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0752</td></tr><tr><td>
|
||||
20200422</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0903</td></tr><tr><td>
|
||||
20200423</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0887</td></tr><tr><td>
|
||||
20200424</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0803</td></tr><tr><td>
|
||||
20200427</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0703</td></tr><tr><td>
|
||||
20200428</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.071</td></tr><tr><td>
|
||||
20200429</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0704</td></tr><tr><td>
|
||||
20200430</td><td>
|
||||
FXUSDCNY</td><td>
|
||||
7.0571</td></tr></tbody></table>
|
||||
| 日期 | 代码 | 中间价 |
|
||||
| -------- | -------- | ------ |
|
||||
| 20200420 | FXUSDCNY | 7.0657 |
|
||||
| 20200421 | FXUSDCNY | 7.0752 |
|
||||
| 20200422 | FXUSDCNY | 7.0903 |
|
||||
| 20200423 | FXUSDCNY | 7.0887 |
|
||||
| 20200424 | FXUSDCNY | 7.0803 |
|
||||
| 20200427 | FXUSDCNY | 7.0703 |
|
||||
| 20200428 | FXUSDCNY | 7.071 |
|
||||
| 20200429 | FXUSDCNY | 7.0704 |
|
||||
| 20200430 | FXUSDCNY | 7.0571 |
|
||||
|
||||
###### GetCurrencyCodeBySecurityCode
|
||||
|
||||
用途:汇率相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//港股长和00001对应的货币对代码
|
||||
|
||||
```tsl
|
||||
// 港股长和00001对应的货币对代码
|
||||
return GetCurrencyCodeBySecurityCode('HK00001');
|
||||
|
||||
//返回 HKD
|
||||
// 返回 HKD
|
||||
```
|
||||
|
||||
###### ForExRateZf
|
||||
|
||||
用途:汇率相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
算法
|
||||
|
||||
(V2-V1)/V1
|
||||
|
||||
其中V2是货币对在endt的中间价,V1是begt(需要大于首个交易日,否则begt=首个交易日)的中间价。范例
|
||||
|
||||
```text
|
||||
//2020年4月20日到4月30日美元/人民币的收益率
|
||||
|
||||
SetSysParam(PN_Stock(),'FXUSDCNY');
|
||||
|
||||
|
||||
begt:=20200420T;
|
||||
|
||||
|
||||
endt:=20200430T;
|
||||
|
||||
|
||||
return ForExRateZf(BegT,EndT);
|
||||
|
||||
//返回 -0.20786786956644
|
||||
```tsl
|
||||
// 2020年4月20日到4月30日美元/人民币的收益率
|
||||
SetSysParam(PN_Stock(), 'FXUSDCNY');
|
||||
begt := 20200420T;
|
||||
endt := 20200430T;
|
||||
return ForExRateZf(BegT, EndT);
|
||||
// 返回 -0.20786786956644
|
||||
```
|
||||
|
||||
@@ -19,28 +19,23 @@
|
||||
|
||||
####### GetTreeSumByClassPath
|
||||
|
||||
用途:进行数值统计计算。
|
||||
参数:arg1,arg2,arg3,arg4,arg5,arg6(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Data:=array(
|
||||
|
||||
("名称":"风格收益(%)","取值":1.2,"分类路径":"总收益(%)"),
|
||||
|
||||
("名称":"Alpha(%)","取值":0.6,"分类路径":"总收益(%)\\选股Alpha(%)"),
|
||||
|
||||
("名称":"残差(%)","取值":0.2,"分类路径":"总收益(%)\\选股Alpha(%)"));
|
||||
|
||||
NodeName:="名称";
|
||||
|
||||
PathName:="分类路径";
|
||||
|
||||
SumName:="取值";
|
||||
|
||||
IfLever0:=0;
|
||||
|
||||
IfTreeID:=1;
|
||||
|
||||
return GetTreeSumByClassPath(Data,NodeName,PathName,SumName,IfLever0,IfTreeID);
|
||||
```tsl
|
||||
Data := array(
|
||||
("名称":"风格收益(%)", "取值":1.2, "分类路径":"总收益(%)"),
|
||||
("名称":"Alpha(%)", "取值":0.6, "分类路径":"总收益(%)\\选股Alpha(%)"),
|
||||
("名称":"残差(%)", "取值":0.2, "分类路径":"总收益(%)\\选股Alpha(%)"));
|
||||
NodeName := "名称";
|
||||
PathName := "分类路径";
|
||||
SumName := "取值";
|
||||
IfLever0 := 0;
|
||||
IfTreeID := 1;
|
||||
return GetTreeSumByClassPath(Data, NodeName, PathName, SumName, IfLever0, IfTreeID);
|
||||
```
|
||||
|
||||
##### 参数调整
|
||||
@@ -51,20 +46,22 @@ Data:=array(
|
||||
|
||||
###### pmstand_array
|
||||
|
||||
用途:参数调整相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
范例1
|
||||
|
||||
```text
|
||||
V:=2;
|
||||
|
||||
return pmstand_array(v);//array(2);
|
||||
```tsl
|
||||
V := 2;
|
||||
return pmstand_array(v); // array(2);
|
||||
```
|
||||
|
||||
范例2
|
||||
|
||||
```text
|
||||
V:="abc";
|
||||
|
||||
return pmstand_array(v);//array("abc");
|
||||
```tsl
|
||||
V := "abc";
|
||||
return pmstand_array(v); // array("abc");
|
||||
```
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,47 +10,17 @@
|
||||
|
||||
接口汇总:
|
||||
|
||||
<table><tbody><tr><td>
|
||||
所属分类</td><td>
|
||||
接口名称</td><td>
|
||||
说明</td><td>
|
||||
备注</td></tr><tr><td>
|
||||
总接口</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=Fastmap" target="_blank">fastmap</a></td><td>
|
||||
调用网格执行函数</td><td>
|
||||
</td></tr><tr><td>
|
||||
日志</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=GridLogo" target="_blank">gridLogo</a></td><td>
|
||||
网格写日志</td><td>
|
||||
</td></tr><tr><td>
|
||||
等分划分方式</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=SplitDiv" target="_blank">splitDiv</a></td><td>
|
||||
度等分划分</td><td>
|
||||
参数为度(int)</td></tr><tr><td>
|
||||
</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=SplitDiv2" target="_blank">splitDiv2</a></td><td>
|
||||
长度等分划分</td><td>
|
||||
</td></tr><tr><td>
|
||||
</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=DeleteTablebyReg" target="_blank">SplitArrayQK</a></td><td>
|
||||
数组等分划分</td><td>
|
||||
参数为数组(array)</td></tr><tr><td>
|
||||
</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=SplitArrayQK2" target="_blank">SplitArrayQK2</a></td><td>
|
||||
数组等分划分</td><td>
|
||||
</td></tr><tr><td>
|
||||
用户数据相关</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=DeleteTablebyReg" target="_blank">DeleteTablebyReg</a></td><td>
|
||||
批量删除用户数据</td><td>
|
||||
正则匹配</td></tr><tr><td>
|
||||
</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=GettablebyReg" target="_blank">GettablebyReg</a></td><td>
|
||||
获取用户数据</td><td>
|
||||
正则匹配</td></tr><tr><td>
|
||||
</td><td>
|
||||
<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/SearchContent.tsl?KeyWord=TryInsetTable" target="_blank">TryInsetTable</a></td><td>
|
||||
添加用户数据</td><td>
|
||||
正则匹配</td></tr></tbody></table>
|
||||
| 所属分类 | 接口名称 | 说明 | 备注 |
|
||||
| ------------ | ---------------- | ---------------- | ------------------- |
|
||||
| 总接口 | fastmap | 调用网格执行函数 | |
|
||||
| 日志 | gridLogo | 网格写日志 | |
|
||||
| 等分划分方式 | splitDiv | 度等分划分 | 参数为度(int) |
|
||||
| | splitDiv2 | 长度等分划分 | |
|
||||
| | SplitArrayQK | 数组等分划分 | 参数为数组(array) |
|
||||
| | SplitArrayQK2 | 数组等分划分 | |
|
||||
| 用户数据相关 | DeleteTablebyReg | 批量删除用户数据 | 正则匹配 |
|
||||
| | GettablebyReg | 获取用户数据 | 正则匹配 |
|
||||
| | TryInsetTable | 添加用户数据 | 正则匹配 |
|
||||
|
||||
网格使用经验:
|
||||
|
||||
@@ -86,127 +56,67 @@ VS 0.4s
|
||||
|
||||
####### 提取50的5日涨幅
|
||||
|
||||
```text
|
||||
//**********************参数设置***********************//
|
||||
|
||||
N := 5;
|
||||
|
||||
endt := today();
|
||||
|
||||
stocks := getbk("上证50");
|
||||
|
||||
|
||||
//**********************网格模版*********************//
|
||||
|
||||
gridNo := 3; //网格个数,0:表示只使用本地服务器
|
||||
|
||||
func := FunctionName() + '.tsubbystocks'; //网格函数
|
||||
|
||||
parms := array(N,endt,stocks);
|
||||
|
||||
parmstype := array(0, 0, 1);
|
||||
|
||||
return unit(MultiProc_unit).fastmap(gridNo,func,parms,parmstype);
|
||||
|
||||
//***********************子函数**********************//
|
||||
|
||||
function tsubbystocks(N, endt,stocks);
|
||||
|
||||
```tsl
|
||||
// **********************参数设置***********************//
|
||||
N := 5;
|
||||
endt := today();
|
||||
stocks := getbk("上证50");
|
||||
// **********************网格模版*********************//
|
||||
gridNo := 3; // 网格个数,0:表示只使用本地服务器
|
||||
func := FunctionName() + '.tsubbystocks'; // 网格函数
|
||||
parms := array(N, endt, stocks);
|
||||
parmstype := array(0, 0, 1);
|
||||
return unit(MultiProc_unit).fastmap(gridNo, func, parms, parmstype);
|
||||
// ***********************子函数**********************//
|
||||
function tsubbystocks(N, endt, stocks);
|
||||
begin
|
||||
|
||||
sp_s(pn_date(),endt);
|
||||
|
||||
i := 0;
|
||||
|
||||
ret := array();
|
||||
|
||||
|
||||
for _,stk in stocks do
|
||||
|
||||
begin
|
||||
|
||||
sp_s(PN_Stock(),stk);
|
||||
|
||||
for j := 0 to N do
|
||||
|
||||
begin
|
||||
|
||||
ret[I,'截止日'] := ref(sp_time(),j);
|
||||
|
||||
ret[i,'代码'] := stk;
|
||||
|
||||
ret[i,'名称'] := stockname(stk);
|
||||
|
||||
ret[I,'涨幅(%)'] := ref(stockzf3(),j);
|
||||
|
||||
i++;
|
||||
|
||||
end
|
||||
|
||||
|
||||
end;
|
||||
|
||||
return ret;
|
||||
|
||||
sp_s(pn_date(), endt);
|
||||
i := 0;
|
||||
ret := array();
|
||||
for _, stk in stocks do
|
||||
begin
|
||||
sp_s(PN_Stock(), stk);
|
||||
for j := 0 to N do
|
||||
begin
|
||||
ret[I, '截止日'] := ref(sp_time(), j);
|
||||
ret[i, '代码'] := stk;
|
||||
ret[i, '名称'] := stockname(stk);
|
||||
ret[I, '涨幅(%)'] := ref(stockzf3(), j);
|
||||
i++;
|
||||
end;
|
||||
end;
|
||||
return ret;
|
||||
end;
|
||||
```
|
||||
|
||||
//返回
|
||||
返回
|
||||
|
||||
####### 提取50的历史涨幅矩阵
|
||||
|
||||
```text
|
||||
//**********************参数设置***********************//
|
||||
|
||||
N := 5;
|
||||
|
||||
endt := today();
|
||||
|
||||
stocks := getbk("上证50");
|
||||
|
||||
|
||||
//**********************网格模版*********************//
|
||||
|
||||
|
||||
//**********************网格模版*********************//
|
||||
|
||||
gridNo := 3; //网格个数,0:表示只使用本地服务器
|
||||
|
||||
func := FunctionName() + '.tsubbystock'; //网格函数
|
||||
|
||||
parms := array(N,endt,stocks);
|
||||
|
||||
parmstype := array(0, 0, 2);
|
||||
|
||||
return unit(MultiProc_unit).fastmap(gridNo,func,parms,parmstype);
|
||||
|
||||
|
||||
```tsl
|
||||
// **********************参数设置***********************//
|
||||
N := 5;
|
||||
endt := today();
|
||||
stocks := getbk("上证50");
|
||||
// **********************网格模版*********************//
|
||||
// **********************网格模版*********************//
|
||||
gridNo := 3; // 网格个数,0:表示只使用本地服务器
|
||||
func := FunctionName() + '.tsubbystock'; // 网格函数
|
||||
parms := array(N, endt, stocks);
|
||||
parmstype := array(0, 0, 2);
|
||||
return unit(MultiProc_unit).fastmap(gridNo, func, parms, parmstype);
|
||||
end;
|
||||
|
||||
function tsubbystock(N, endt,stock);
|
||||
|
||||
function tsubbystock(N, endt, stock);
|
||||
begin
|
||||
|
||||
sp_s(PN_Stock(),stock);
|
||||
|
||||
sp_s(pn_date(),endt);
|
||||
|
||||
ret := array(
|
||||
|
||||
"代码":stock,
|
||||
|
||||
"名称":stockname(stock),
|
||||
|
||||
"截止日":endt,
|
||||
|
||||
);
|
||||
|
||||
for i := 1 to N do
|
||||
|
||||
ret["T_" $ i] := ref(stockzf3(),i);
|
||||
|
||||
return ret;
|
||||
|
||||
sp_s(PN_Stock(), stock);
|
||||
sp_s(pn_date(), endt);
|
||||
ret := array(
|
||||
"代码":stock,
|
||||
"名称":stockname(stock),
|
||||
"截止日":endt,
|
||||
);
|
||||
for i := 1 to N do ret["T_"$ i] := ref(stockzf3(), i);
|
||||
return ret;
|
||||
end;
|
||||
```
|
||||
|
||||
@@ -218,12 +128,15 @@ end;
|
||||
|
||||
####### GridLogo
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//在C:\\temp\\Gridlog默认路径下写日志文件
|
||||
|
||||
Return unit(MultiProc_unit).gridLogo('测试');
|
||||
```tsl
|
||||
// 在C:\\temp\\Gridlog默认路径下写日志文件
|
||||
return unit(MultiProc_unit).gridLogo('测试');
|
||||
```
|
||||
|
||||
###### 中间函数
|
||||
@@ -242,60 +155,77 @@ Return unit(MultiProc_unit).gridLogo('测试');
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Return unit(MultiProc_unit).splitDiv(14,5); // array(0,2,4,6,8,14)
|
||||
```tsl
|
||||
return unit(MultiProc_unit).splitDiv(14, 5); // array(0,2,4,6,8,14)
|
||||
```
|
||||
|
||||
####### SplitDiv2
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Return unit(MultiProc_unit).splitDiv2(14,5); // array(0,3,6,9,12,14)
|
||||
```tsl
|
||||
return unit(MultiProc_unit).splitDiv2(14, 5); // array(0,3,6,9,12,14)
|
||||
```
|
||||
|
||||
####### SplitArrayQK
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
arr := array(2,1,3,4,9,5,7,8,9,10,11,12,13,15);
|
||||
|
||||
return unit(MultiProc_unit).SplitArrayQK(arr,5); //array((2,1),(3,4),(9,5),(7,8),(9,15))
|
||||
```tsl
|
||||
arr := array(2, 1, 3, 4, 9, 5, 7, 8, 9, 10, 11, 12, 13, 15);
|
||||
return unit(MultiProc_unit).SplitArrayQK(arr, 5); // array((2,1),(3,4),(9,5),(7,8),(9,15))
|
||||
```
|
||||
|
||||
####### SplitArrayQK2
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
arr := array(2,1,3,4,9,5,7,8,9,10,11,12,13,15);
|
||||
|
||||
return unit(MultiProc_unit).SplitArrayQK2(arr,5);
|
||||
|
||||
```tsl
|
||||
arr := array(2, 1, 3, 4, 9, 5, 7, 8, 9, 10, 11, 12, 13, 15);
|
||||
return unit(MultiProc_unit).SplitArrayQK2(arr, 5);
|
||||
// array((2,3),(4,5),(7,9),(10,12),(13,15))
|
||||
```
|
||||
|
||||
####### DeleteTablebyReg
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Return unit(MultiProc_unit).DeleteTablebyReg('test');
|
||||
```tsl
|
||||
return unit(MultiProc_unit).DeleteTablebyReg('test');
|
||||
```
|
||||
|
||||
####### GettablebyReg
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Return unit(MultiProc_unit).GettablebyReg('test');
|
||||
```tsl
|
||||
return unit(MultiProc_unit).GettablebyReg('test');
|
||||
```
|
||||
|
||||
####### TryInsetTable
|
||||
|
||||
用途:MultiProc_unit相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
Return unit(MultiProc_unit).TryInsetTable('test',array(1,2,3));
|
||||
```tsl
|
||||
return unit(MultiProc_unit).TryInsetTable('test', array(1, 2, 3));
|
||||
```
|
||||
|
||||
@@ -31,10 +31,12 @@
|
||||
### 财务与基本面
|
||||
|
||||
- **[财务分析](./financial_analysis.md)** (46,778行) ⚠️ **最大文件**
|
||||
|
||||
- 资产负债表、利润表、现金流量表
|
||||
- 财务比率、财务指标、财务预测
|
||||
|
||||
- **[基本面](./fundamentals.md)** (6,139行)
|
||||
|
||||
- 公司基本信息、行业分类、股东结构
|
||||
- 分红、配股、增发等公司行为
|
||||
|
||||
@@ -49,10 +51,12 @@
|
||||
### 量化分析
|
||||
|
||||
- **[金融工程](./financial_engineering.md)** (6,564行)
|
||||
|
||||
- 风险模型、因子模型、组合优化
|
||||
- 回测框架、绩效归因
|
||||
|
||||
- **[组合评价](./portfolio_evaluation.md)** (3,656行)
|
||||
|
||||
- 夏普比率、最大回撤、收益波动
|
||||
- 组合绩效评估、风险调整收益
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,42 +11,33 @@
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
logger_debug(1234);
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
```
|
||||
|
||||
//结果:
|
||||
|
||||
##### logger_info
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
logger_info("当前执行第100个");
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
```
|
||||
|
||||
//结果:
|
||||
|
||||
##### logger_warning
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
logger_warning("当前执行第100个");
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
```
|
||||
|
||||
//结果:
|
||||
|
||||
##### logger_info2
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
logger_info2("异常","类型不能大于",3);
|
||||
```tsl
|
||||
logger_info2("异常", "类型不能大于", 3);
|
||||
```
|
||||
|
||||
@@ -22,12 +22,15 @@
|
||||
|
||||
###### CU_ChinaCode
|
||||
|
||||
用途:基本信息相关函数。
|
||||
参数:无。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
return CU_ChinaCode();
|
||||
|
||||
//结果:SS.000001
|
||||
// 结果:SS.000001
|
||||
```
|
||||
|
||||
##### 财政支出
|
||||
@@ -280,34 +283,40 @@ return CU_ChinaCode();
|
||||
|
||||
###### HG_StockSettlementBalance
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间证券交易结算资金余额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_StockSettlementBalance(20170101T,20181008T);
|
||||
|
||||
//结果:
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间证券交易结算资金余额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_StockSettlementBalance(20170101T, 20181008T);
|
||||
// 结果:
|
||||
```
|
||||
|
||||
###### HG_StockSettlementBalanceByEndT
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2018年10月8日的证券交易结算资金余额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_StockSettlementBalanceByEndT(20181008T);
|
||||
|
||||
//结果:1220500000000
|
||||
```tsl
|
||||
// 返回2018年10月8日的证券交易结算资金余额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_StockSettlementBalanceByEndT(20181008T);
|
||||
// 结果:1220500000000
|
||||
```
|
||||
|
||||
###### HG_StockPeriodBalance
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
算法
|
||||
|
||||
从证券及股票期权投资者资金余额及变动(813)表中获取三个表:
|
||||
@@ -321,108 +330,112 @@ setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
返回三个表中‘截止日’相同的数据。范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间证券交易结算资金、融资融券担保资金、股票期权保证金余额情况
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_StockPeriodBalance(20170101T,20181008T);
|
||||
|
||||
//结果:
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间证券交易结算资金、融资融券担保资金、股票期权保证金余额情况
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_StockPeriodBalance(20170101T, 20181008T);
|
||||
// 结果:
|
||||
```
|
||||
|
||||
###### HG_OptionMarginBalanceByEndT
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2018年10月8日的股票期权保证金余额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_OptionMarginBalanceByEndT(20181008T);
|
||||
|
||||
//结果:5974000000
|
||||
```tsl
|
||||
// 返回2018年10月8日的股票期权保证金余额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_OptionMarginBalanceByEndT(20181008T);
|
||||
// 结果:5974000000
|
||||
```
|
||||
|
||||
###### HG_MoneyRollIn
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间资金转入额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_MoneyRollIn(20170101T,20181008T);
|
||||
|
||||
//结果:11452969000000
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间资金转入额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_MoneyRollIn(20170101T, 20181008T);
|
||||
// 结果:11452969000000
|
||||
```
|
||||
|
||||
###### HG_OptionMarginBalance
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间股票期权保证金余额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_OptionMarginBalance(20170101T,20181008T);
|
||||
|
||||
//结果:
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间股票期权保证金余额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_OptionMarginBalance(20170101T, 20181008T);
|
||||
// 结果:
|
||||
```
|
||||
|
||||
###### HG_StockGuaranteeBalanceByEndT
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2018年10月8日的融资融券担保资金余额
|
||||
|
||||
setsysparam(pn_stock(),"HG000001");
|
||||
|
||||
Return HG_StockGuaranteeBalanceByEndT(20181008T);
|
||||
|
||||
//结果:147600000000
|
||||
```tsl
|
||||
// 返回2018年10月8日的融资融券担保资金余额
|
||||
setsysparam(pn_stock(), "HG000001");
|
||||
return HG_StockGuaranteeBalanceByEndT(20181008T);
|
||||
// 结果:147600000000
|
||||
```
|
||||
|
||||
###### HG_MoneyNetRollIn
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间资金净转入额
|
||||
|
||||
|
||||
Return HG_MoneyNetRollIn(20170101T,20181008T);
|
||||
|
||||
|
||||
//结果:-248651000000
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间资金净转入额
|
||||
return HG_MoneyNetRollIn(20170101T, 20181008T);
|
||||
// 结果:-248651000000
|
||||
```
|
||||
|
||||
###### HG_MoneyRollOut
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间资金转出额
|
||||
|
||||
|
||||
Return HG_MoneyRollOut(20170101T,20181008T);
|
||||
|
||||
//结果:11701620000000
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间资金转出额
|
||||
return HG_MoneyRollOut(20170101T, 20181008T);
|
||||
// 结果:11701620000000
|
||||
```
|
||||
|
||||
###### HG_StockGuaranteeBalance
|
||||
|
||||
用途:银证转账相关函数。
|
||||
参数:arg1,arg2(按示例顺序传入)。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//返回2017年1月1日到2018年10月8日的区间融资融券担保资金余额列表。
|
||||
|
||||
|
||||
Return HG_StockGuaranteeBalance(20170101T,20181008T);
|
||||
```tsl
|
||||
// 返回2017年1月1日到2018年10月8日的区间融资融券担保资金余额列表。
|
||||
return HG_StockGuaranteeBalance(20170101T, 20181008T);
|
||||
```
|
||||
|
||||
##### 行业宏观
|
||||
@@ -776,14 +789,15 @@ Return HG_MoneyRollOut(20170101T,20181008T);
|
||||
|
||||
###### HG_DL_InterestRate
|
||||
|
||||
用途:人民币存贷款利率相关函数。
|
||||
参数:无。
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
//活期存款在20210302的人民币存贷款利率
|
||||
|
||||
setsysparam(pn_stock(),"IR000001");
|
||||
|
||||
setsysparam(pn_date(),20210302T);
|
||||
|
||||
return HG_DL_InterestRate(); //结果: 0.35
|
||||
```tsl
|
||||
// 活期存款在20210302的人民币存贷款利率
|
||||
setsysparam(pn_stock(), "IR000001");
|
||||
setsysparam(pn_date(), 20210302T);
|
||||
return HG_DL_InterestRate(); // 结果: 0.35
|
||||
```
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -42,34 +42,29 @@
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
ManagerID := "1533";
|
||||
|
||||
FMtype := 1; //股混型
|
||||
|
||||
RDate := 20220630;
|
||||
|
||||
return FundManager_GetStockHoldings(ManagerID,FMtype,RDate);
|
||||
FMtype := 1; // 股混型
|
||||
RDate := 20220630;
|
||||
return FundManager_GetStockHoldings(ManagerID, FMtype, RDate);
|
||||
```
|
||||
|
||||
########## FundManager_js_gpgmjz
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
EndT := 20220812T;
|
||||
|
||||
return FundManager_js_gpgmjz(EndT);
|
||||
return FundManager_js_gpgmjz(EndT);
|
||||
```
|
||||
|
||||
########## FundManager_js_hyjqd
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
RDate := 20220630;
|
||||
|
||||
return FundManager_js_hyjqd(RDate);
|
||||
return FundManager_js_hyjqd(RDate);
|
||||
```
|
||||
|
||||
##### 基金
|
||||
@@ -96,16 +91,12 @@ RDate := 20220630;
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
FundID := "OF000001";
|
||||
|
||||
begt := 20200101t;
|
||||
|
||||
endt := 20240301t;
|
||||
|
||||
RollNYearArr := array(1,3); //持有1年,持有3年
|
||||
|
||||
return Fund_PF_HoldFeeling_Stat(FundID,begt,endt,RollNYearArr);
|
||||
begt := 20200101t;
|
||||
endt := 20240301t;
|
||||
RollNYearArr := array(1, 3); // 持有1年,持有3年
|
||||
return Fund_PF_HoldFeeling_Stat(FundID, begt, endt, RollNYearArr);
|
||||
```
|
||||
|
||||
返回:
|
||||
@@ -114,18 +105,13 @@ FundID := "OF000001";
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
FundID := "OF000001";
|
||||
|
||||
begt := 20200101t;
|
||||
|
||||
endt := 20240301t;
|
||||
|
||||
MANum := 60;
|
||||
|
||||
delta := 20;
|
||||
|
||||
return Fund_PF_HoldFeeling_Trend(FundID,begt,endt,MANum,delta);
|
||||
```tsl
|
||||
FundID := "OF000001";
|
||||
begt := 20200101t;
|
||||
endt := 20240301t;
|
||||
MANum := 60;
|
||||
delta := 20;
|
||||
return Fund_PF_HoldFeeling_Trend(FundID, begt, endt, MANum, delta);
|
||||
```
|
||||
|
||||
返回:
|
||||
@@ -138,11 +124,15 @@ FundID := "OF000001";
|
||||
|
||||
####### GetAllThemespools
|
||||
|
||||
用途:基金相关函数。
|
||||
参数:
|
||||
|
||||
返回:处理后的结果值。
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
EndT := 20230919T;
|
||||
|
||||
return GetAllThemespools(EndT);
|
||||
```
|
||||
|
||||
@@ -164,22 +154,18 @@ return GetAllThemespools(EndT);
|
||||
|
||||
范例01:获取指定ETF在指定日的资金净流入
|
||||
|
||||
```text
|
||||
return ETF_MT_NetINflowAmount(20250922T,array("OF512000"));
|
||||
```tsl
|
||||
return ETF_MT_NetINflowAmount(20250922T, array("OF512000"));
|
||||
```
|
||||
|
||||
返回:920.088,单位为:万元
|
||||
|
||||
范例02:获取2022-02-17所有跟踪沪深300ETF基金资金净流入金额
|
||||
|
||||
```text
|
||||
fundArr := getbk("上证基金;深证基金;开放式基金;已退市基金");
|
||||
|
||||
etfArr := sselect ["StockID"] from infotable 302 of fundArr
|
||||
|
||||
where ["交易方式"]="ETF" and ["标的指数代码"]="SH000300"end;
|
||||
|
||||
endt := 20220217t;
|
||||
|
||||
return ETF_MT_NetInflowAmount(endt,ETFArr,r);// -223296.48
|
||||
```tsl
|
||||
fundArr := getbk("上证基金;深证基金;开放式基金;已退市基金");
|
||||
etfArr := sselect ["StockID"] from infotable 302 of fundArr
|
||||
where ["交易方式"] = "ETF" and ["标的指数代码"] = "SH000300"end;
|
||||
endt := 20220217t;
|
||||
return ETF_MT_NetInflowAmount(endt, ETFArr, r); // -223296.48
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user