Browse Source

小修小补

Joey 4 months ago
parent
commit
f6b0938d66
1 changed files with 28 additions and 6 deletions
  1. 28 6
      codes/CalculationJobs.dos

+ 28 - 6
codes/CalculationJobs.dos

@@ -2,6 +2,8 @@ login(`admin, `123456);
 
 use fundit::task_fundPerformance;
 use fundit::task_portfolioPerformance;
+use fundit::task_weeklyPerformance;
+use fundit::task_monthlyPerformance;
 
 
 /* 
@@ -9,23 +11,43 @@ use fundit::task_portfolioPerformance;
  *  
  * 查询任务运行; getRecentJobs();
  * 查询任务列表:getScheduledJobs('daily_%');
- * 删除任务:deleteScheduledJob('daily_portfolio_bfi');
+ * 删除任务:deleteScheduledJob('daily_fund_performance');
  * 
  */
 
+
+/* -------------  DAILY JOBS ---------------------------*/
+
 // index and factor calculations go first
 scheduleJob('daily_market_index_performance', "Market Index return and indicator calculation", calFundPerformanceTask{'MI', now().temporalAdd(-3d)}, 22:00m, today(), today()+30, 'D');
 scheduleJob('daily_factor_performance', "Factor nav, return and indicator calculation", CalFactorPerformanceTask{now().temporalAdd(-3d)}, 23:00m, today(), today()+30, 'D');
 
 // standard return and indicator calculation
-scheduleJob('daily_fund_performance', "Mutual fund return and indicator calculation", calFundPerformanceTask{'MF', now().temporalAdd(-3d)}, 00:00m, today(), today()+30, 'D');
+scheduleJob('daily_mutual_fund_performance', "Mutual fund return and indicator calculation", calFundPerformanceTask{'MF', now().temporalAdd(-3d)}, 00:00m, today(), today()+30, 'D');
+scheduleJob('daily_hedge_fund_performance', "Hedge fund return and indicator calculation", calFundPerformanceTask{'HF', now().temporalAdd(-3d)}, 00:30m, today(), today()+30, 'D');
 scheduleJob('daily_portfolio_performance', "Portfolio nav, return and indicator calculation", CalPortfolioPerformanceTask{now().temporalAdd(-3d)}, 01:00m, today(), today()+30, 'D');
 
+
+/* -------------  WEEKLY JOBS ---------------------------*/
+
+// RBSA calculation  (TODO: change them to weekly)
+scheduleJob('weekly_fund_rbsa', "Fund RBSA calculation", CalFundRBSATask{'MF', NULL, now().temporalAdd(-3d)}, 07:00m, today(), today()+30, 'D');
+//scheduleJob('weekly_fund_rbsa', "Fund RBSA calculation", CalFundRBSATask{'MF', NULL, now().temporalAdd(-3d)}, 07:00m, today(), today()+30, 'W', 6);
+
 // BFI MATCHING HERE
-scheduleJob('daily_BFI_fund_matching', "Mutual fund bfi matching", MatchEntityBFITask{'MF', now().temporalAdd(-3d)}, 01:30m, today(), today()+30, 'D');
-scheduleJob('daily_BFI_portfolio_matching', "Portfolio bfi matching", MatchEntityBFITask{'PF', now().temporalAdd(-3d)}, 06:00m, today(), today()+30, 'D');
+scheduleJob('weekly_fund_bfi_matching', "Fund bfi matching", MatchEntityBFITask{'MF', now().temporalAdd(-3d)}, 01:30m, today(), today()+30, 'D');
+scheduleJob('weekly_portfolio_bfi_matching', "Portfolio bfi matching", MatchEntityBFITask{'PF', now().temporalAdd(-3d)}, 06:00m, today(), today()+30, 'D');
 
 // BFI indicator calculation
-scheduleJob('daily_fund_bfi_indicator', "Mutual fund BFI indicator calculation", calEntityBfiIndicatorTask{'MF', now().temporalAdd(-3d)}, 07:00m, today(), today()+30, 'D');
-scheduleJob('daily_portfolio_bfi', "Portfolio BFI indicator calculation", calEntityBfiIndicatorTask{'PF', now().temporalAdd(-3d)}, 08:00m, today(), today()+30, 'D');
+scheduleJob('weekly_fund_bfi_indicator', "Fund BFI indicator calculation", calEntityBfiIndicatorTask{'MF', now().temporalAdd(-3d)}, 07:00m, today(), today()+30, 'D');
+scheduleJob('weekly_portfolio_bfi_indicator', "Portfolio BFI indicator calculation", calEntityBfiIndicatorTask{'PF', now().temporalAdd(-3d)}, 08:00m, today(), today()+30, 'D');
+
+/* -------------  MONTHLY JOBS ---------------------------*/
+
+// fund rankings
+scheduleJob('monthly_fund_ranking', "Fund PBI ranking calculation", CalEntityRankingTask{'MF', now().temporalAdd(-1m).month(), true}, 19:00m, today(), today()+30, 'M', [5, 6]);
+scheduleJob('monthly_fund_bfi_ranking', "Fund BFI ranking calculation", CalEntityBfiRankingTask{'MF', now().temporalAdd(-1m).month(), true}, 20:00m, today(), today()+30, 'M', [5, 6]);
+
+// portfolio rankings (strategy, substrategy, bfi included)
+scheduleJob('monthly_portfolio_ranking', "Portfolio ranking calculation", CalRelativeRankingTask{'PF', NULL, now().temporalAdd(-1m).month(), true}, 21:00m, today(), today()+30, 'M', [5, 6]);