sample_cal_return.dos 1.1 KB

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