1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- login(`admin, `123456);
- use fundit::task_fundPerformance;
- use fundit::task_portfolioPerformance;
- use fundit::task_weeklyPerformance;
- use fundit::task_monthlyPerformance;
- /*
- * 定时任务
- *
- * 查询任务运行; getRecentJobs();
- * 查询任务列表:getScheduledJobs('daily_%');
- * 删除任务: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_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('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('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]);
|