1234567891011121314151617181920212223242526272829303132333435 |
- login(`admin, `123456)
- loadPlugin("ODBC")
- clearCachedModules()
- use fundit::dataPuller
- use fundit::returnCalculator
- use fundit::indicatorCalculator
- use fundit::navCalculator
- very_old_date = 1990.01.01;
- /* TEST CASE 1, calculation_method = 1 */
- portfolio_ids = '166002,166114';
- cal_method = 1;
- /* TEST CASE 2, calculation_method = 2
- portfolio_ids = '364771';
- portfolio_ids = '364771,364772,364773,364774,364775,364776,364777,365070,364778,364779,365179,365180,365181,365164,365189,365198,365199,365200,365204,365205,365165,365166,365186,365187,365197,365201,365206,365167,365168,365171,365182,365183,365169,365170,365172,365173,365174,365175,365178,365194,365176,365177,365184,365185,365188,365190,365191,365192,365193,365195,365196,365202,365203';
- cal_method = 2;
- */
- // calculate navs
- tb_portfolio_ret = cal_portfolio_return(portfolio_ids, very_old_date, cal_method);
- tb_portfolio_ret.sortBy!(['portfolio_id', 'price_date'], [1, 1]);
- // calculate indicators
- end_day = 2024.08.31
- tb_indicators = cal_portfolio_indicators(portfolio_ids, end_day, cal_method, true);
- select * from tb_indicators[0]
|