|
@@ -302,14 +302,14 @@ def match_mc_bfi(entity_type, entity_info) {
|
|
start_day = entity_info.price_date.min();
|
|
start_day = entity_info.price_date.min();
|
|
|
|
|
|
// 取数据集每个基金组合指定日期之前5年至今的周净值
|
|
// 取数据集每个基金组合指定日期之前5年至今的周净值
|
|
- s_json = (SELECT entity_id, curve_type, strategy, price_date.temporalAdd(-5y).temporalFormat('yyyy-MM') AS end_date FROM entity_info).toStdJson();
|
|
|
|
|
|
+ s_json = (SELECT entity_id, curve_type, strategy, price_date.temporalAdd(-5y).temporalFormat('yyyy-MM') AS effective_date FROM entity_info).toStdJson();
|
|
nav_entity = get_mc_nav_for_return_calculation(entity_type, s_json, 2);
|
|
nav_entity = get_mc_nav_for_return_calculation(entity_type, s_json, 2);
|
|
|
|
|
|
if(nav_entity.isVoid() || nav_entity.size() == 0) return null;
|
|
if(nav_entity.isVoid() || nav_entity.size() == 0) return null;
|
|
// fund_manager_fitted_curve 和 company_fitted_curve 表里没有price_date, 这里用 businessMonthEnd 日期填充
|
|
// fund_manager_fitted_curve 和 company_fitted_curve 表里没有price_date, 这里用 businessMonthEnd 日期填充
|
|
nav_entity = SELECT entity_id, curve_type, strategy,
|
|
nav_entity = SELECT entity_id, curve_type, strategy,
|
|
- temporalParse(end_date, 'yyyy-MM').month() AS end_date,
|
|
|
|
- temporalParse(end_date+'-01', 'yyyy-MM-dd').businessMonthEnd() AS price_date, cumulative_nav AS nav
|
|
|
|
|
|
+ temporalParse(effective_date, 'yyyy-MM').month() AS effective_date,
|
|
|
|
+ temporalParse(effective_date+'-01', 'yyyy-MM-dd').businessMonthEnd() AS price_date, cumulative_nav AS nav
|
|
FROM nav_entity;
|
|
FROM nav_entity;
|
|
|
|
|
|
// 取相关性计算及BFI用得到的指数/因子列表
|
|
// 取相关性计算及BFI用得到的指数/因子列表
|
|
@@ -330,7 +330,7 @@ def match_mc_bfi(entity_type, entity_info) {
|
|
|
|
|
|
t_ei = SELECT entity_id, price_date.month() AS end_date, price_date FROM entity_info WHERE curve_type = cur AND strategy = 0;
|
|
t_ei = SELECT entity_id, price_date.month() AS end_date, price_date FROM entity_info WHERE curve_type = cur AND strategy = 0;
|
|
|
|
|
|
- t_ne = SELECT entity_id, end_date, price_date, nav FROM nav_entity WHERE curve_type = cur AND strategy = 0;
|
|
|
|
|
|
+ t_ne = SELECT entity_id, effective_date AS end_date, price_date, nav FROM nav_entity WHERE curve_type = cur AND strategy = 0;
|
|
|
|
|
|
t_coe = create_mc_index_coe().dropColumns!(['curve_type', 'strategy']);
|
|
t_coe = create_mc_index_coe().dropColumns!(['curve_type', 'strategy']);
|
|
|
|
|
|
@@ -348,4 +348,4 @@ def match_mc_bfi(entity_type, entity_info) {
|
|
}
|
|
}
|
|
|
|
|
|
return t_factor_bfi;
|
|
return t_factor_bfi;
|
|
-}
|
|
|
|
|
|
+}
|