3.4 KiB
3.4 KiB
金融 / 金融工程 / 指数研究
indexKLine_adjustSampleByDate_ii(t, index_name, end_t, first_value, rate_type, show_type)
声明:function
返回复合指数(按日期调整样本),手算过程见: www.tinysoft.com.cn/download/doc/Index_UserDefinedSampleAndDate.xls
| 参数 | 类型 | 说明 |
|---|---|---|
t |
table_array | 数据表,自定义样本 |
index_name |
string | 字符串,指数代码 |
end_t |
datetime | 日期型时间,截止时间 |
first_value |
integer | 用户自定义,开始日指数取值,含义如下表: |
rate_type |
integer | 用户自定义,计算方法,含义如下表: |
show_type |
integer | 用户自定义,返回类型,含义如下表: |
返回:table_array
示例
范例01:调用 IndexKLine_AdjustSampleByDate_II
t := array(
("日期":39080.00, "代码":"SH600550", "名称":"天威保变"),
("日期":39080.00, "代码":"SH600331", "名称":"宏达股份"),
("日期":39080.00, "代码":"SH601398", "名称":"工商银行"),
("日期":39080.00, "代码":"SH600030", "名称":"中信证券"),
("日期":39080.00, "代码":"SH600016", "名称":"民生银行"),
("日期":39080.00, "代码":"SH600036", "名称":"招商银行"),
("日期":39172.00, "代码":"SH600418", "名称":"江淮汽车"),
("日期":39172.00, "代码":"SH600649", "名称":"原水股份"),
("日期":39172.00, "代码":"SH600362", "名称":"江西铜业"),
("日期":39172.00, "代码":"SH600550", "名称":"天威保变"),
("日期":39172.00, "代码":"SH600011", "名称":"华能国际"),
);
return IndexKLine_AdjustSampleByDate_II(t,
'SH000001',
INTTODATE(20120613),
1000, 0, 1);
manyBksKLine_ii(user_def_arr, index_name, first_value, beg_t, end_t, show_cycle_name, show_type)
声明:function
返回板块指数(自定义权重)
| 参数 | 类型 | 说明 |
|---|---|---|
user_def_arr |
table_array | 数据表,股票及投资比例 |
index_name |
string | 字符串,指数代码 |
first_value |
intger | 用户自定义,开始日指数取值,含义如下表: |
beg_t |
datetime | 日期型时间,开始时间 |
end_t |
datetime | 日期型时间,截止时间 |
show_cycle_name |
string | 字符串,显示周期 |
show_type |
ingter | 用户自定义,返回类型,含义如下表: |
返回:table_array
示例
范例01:调用 ManyBksKLine_II
UserDefArr := array(('代码':'SZ000001', '名称':'平安银行', '比例(%)':40), ('代码':'SH6000010', '名称':'浦发银行', '比例(%)':30), ('代码':'SZ000002', '名称':'万科A', '比例(%)':30));
RETURN ManyBksKLine_II(UserDefArr,
'SH000001',
-1,
inttodate(20120818),
inttodate(20120918),
CY_DAY(), 1);