♻️ refactor(playbook): streamline agents and refresh tsl docs

This commit is contained in:
csh
2026-01-10 16:55:44 +08:00
parent b529012c59
commit 5822a8736d
88 changed files with 103561 additions and 130104 deletions
@@ -15,101 +15,83 @@
###### 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
```