Most of the data are crawled from 天天基金网.
python src/crawlFundData.py crawlAllFundData --ifCrawlBasicInformation=True --ifCrawlPortfolio=True --ifCrawlHistoricalValue=True
You can set any arg be False to ignore some informations, all commands are exectued in the root folder of this repo.
Use below commands to get the return and risk in 3 years for all funds.
python src/analyzeData.py analyzeHistoricalValue --ifUseNewIssues=True --ifUseOldIssues=True --ifUseWatchList=False --ifUseAdjustFactorToLatestDay=False --ifPrintFundCode=False
Catogorize the return and risk in near days.
python src/analyzeData.py getAverageSlopeForFundsInSameRange --ifUseAdjustFactorToLatestDay=False
We can get the average of annualized return, it seems the average return varies in different time.
We can use Pearson's correlation method to get the correlation between fund '110011' and other funds.
python src/analyzeData.py getCorrelationMatrixForOneFund --fundCodeToAnalyze=110011
If intermediate file are generated, we can set related flags True.
I analyze the Pearsom's correlation matrix for all funds.
python src/analyzeData.py getCorrelationMatrixForAllFunds
Use cosine between two vectors in this matrix to represent the correlation of two funds.
python src/analyzeData.py analyzeCosineForOneFund --nameFund=110011
Get the relation between cosine relation and Pearson's correlation.
python src/analyzeData.py compareCosineAndPearsonCorr --nameFund '110011'