sample_cal_return.dos 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. login(`admin, `123456)
  2. loadPlugin("ODBC")
  3. clearCachedModules()
  4. use fundit::fundCalculator
  5. use fundit::dataPuller
  6. use fundit::returnCalculator
  7. use fundit::sqlUtilities
  8. // TEST CASE 1
  9. fund_ids = "'HF000004KN','HF00018WXG','HF000103EU'"
  10. // TEST CASE 2 取有净值更新的所有私募基金
  11. tb_fund_list = get_fund_list_by_nav_updatetime(null, 2024.07.19T10:00:00);
  12. fund_ids = tb_fund_list.fund_id.concat("','")$STRING
  13. fund_ids = "'" + fund_ids$STRING + "'"
  14. // 取基金净值
  15. tb_nav = get_nav_by_price_date('HF', fund_ids, 1990.01.01, true)
  16. save_hedge_fund_nav_to_local(tb_nav)
  17. // 计算基金月收益
  18. tb_fund_performance = cal_fund_monthly_returns('HF', fund_ids, false)
  19. save_table(tb_fund_performance, "mfdb.fund_performance", false)
  20. // 计算基金周收益
  21. tb_fund_performance_weekly = cal_hedge_fund_weekly_returns(fund_ids, false)
  22. save_table(tb_fund_performance_weekly, "mfdb.fund_performance_weekly", false)
  23. // 计算基金最新收益
  24. tb_fund_latest_nav_performance = cal_hedge_fund_latest_returns(fund_ids, false)
  25. save_table(tb_fund_latest_nav_performance, "mfdb.fund_latest_nav_performance", false)