siat 3.0.40__py3-none-any.whl → 3.0.41__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siat/common.py +1 -1
- siat/exchange_bond_china.pickle +0 -0
- siat/fund_china.pickle +0 -0
- siat/sector_china.py +17 -17
- siat/stock.py +1 -1
- siat/stock_info.pickle +0 -0
- siat/stock_technical.py +8 -3
- siat/translate.py +11 -1
- {siat-3.0.40.dist-info → siat-3.0.41.dist-info}/METADATA +1 -1
- {siat-3.0.40.dist-info → siat-3.0.41.dist-info}/RECORD +12 -12
- {siat-3.0.40.dist-info → siat-3.0.41.dist-info}/WHEEL +1 -1
- {siat-3.0.40.dist-info → siat-3.0.41.dist-info}/top_level.txt +0 -0
siat/common.py
CHANGED
@@ -3789,7 +3789,7 @@ if __name__=='__main__':
|
|
3789
3789
|
upgrade_siat()
|
3790
3790
|
|
3791
3791
|
def upgrade_siat(module_list=['siat','akshare','pandas','pandas_datareader', \
|
3792
|
-
'yfinance','yahooquery','urllib3','tabulate','twine','mplfinance'], \
|
3792
|
+
'yfinance','yahooquery','urllib3','tabulate','twine','mplfinance','openpyxl'], \
|
3793
3793
|
pipcmd="pip install --upgrade"):
|
3794
3794
|
"""
|
3795
3795
|
功能:一次性升级siat及其相关插件
|
siat/exchange_bond_china.pickle
CHANGED
Binary file
|
siat/fund_china.pickle
CHANGED
Binary file
|
siat/sector_china.py
CHANGED
@@ -756,16 +756,16 @@ def display_industry_sw(sw_level='1',numberPerLine=4,colalign='left'):
|
|
756
756
|
|
757
757
|
|
758
758
|
if __name__=='__main__':
|
759
|
-
itype='
|
759
|
+
itype='1'
|
760
760
|
numberPerLine=5
|
761
761
|
colalign='left'
|
762
762
|
|
763
|
-
print_industry_sw(itype='
|
763
|
+
print_industry_sw(itype='1',numberPerLine=5,colalign='right')
|
764
764
|
|
765
|
-
def print_industry_sw(itype='
|
765
|
+
def print_industry_sw(itype='1',numberPerLine=5,colalign='left'):
|
766
766
|
"""
|
767
767
|
功能:按照类别打印申万行业列表,名称(代码)
|
768
|
-
行业分级itype:F
|
768
|
+
行业分级itype:F=市场表征, 1=一级行业, 2=二级行业, 3=三级行业, S="风格指数",B=大类风格,C=金创
|
769
769
|
"""
|
770
770
|
df=industry_sw_list()
|
771
771
|
df1=df[df['type']==itype]
|
@@ -944,12 +944,12 @@ if __name__=='__main__':
|
|
944
944
|
start='2018-1-1'
|
945
945
|
end='2022-10-31'
|
946
946
|
measure='Exp Ret%'
|
947
|
-
itype='
|
947
|
+
itype='1'
|
948
948
|
graph=True
|
949
949
|
axisamp=0.8
|
950
950
|
|
951
951
|
def industry_ranking_sw(start,end,measure='Exp Ret%', \
|
952
|
-
itype='
|
952
|
+
itype='1',period="day", \
|
953
953
|
graph=True,axisamp=0.8):
|
954
954
|
"""
|
955
955
|
完整版,全流程
|
@@ -1048,7 +1048,7 @@ if __name__=='__main__':
|
|
1048
1048
|
start='2018-1-1'
|
1049
1049
|
end='2022-10-31'
|
1050
1050
|
measure='Exp Ret%'
|
1051
|
-
itype='
|
1051
|
+
itype='1'
|
1052
1052
|
graph=True
|
1053
1053
|
axisamp=0.8
|
1054
1054
|
|
@@ -1157,10 +1157,10 @@ if __name__=='__main__':
|
|
1157
1157
|
period="day"
|
1158
1158
|
industry_list='all'
|
1159
1159
|
|
1160
|
-
def get_industry_sw(itype='
|
1160
|
+
def get_industry_sw(itype='1',period="day",industry_list='all'):
|
1161
1161
|
"""
|
1162
1162
|
功能:遍历某类申万指数,下载数据
|
1163
|
-
itype: F表征指数,
|
1163
|
+
itype: F表征指数,n=1/2/3行业指数,S风格指数,B大类风格,C金创类
|
1164
1164
|
period="day"; choice of {"day", "week", "month"}
|
1165
1165
|
industry_list: 允许选择部分行业
|
1166
1166
|
"""
|
@@ -1569,12 +1569,12 @@ if __name__=='__main__':
|
|
1569
1569
|
measure='Exp Ret%'
|
1570
1570
|
start='2020-11-1'
|
1571
1571
|
end='2022-10-31'
|
1572
|
-
itype='
|
1572
|
+
itype='1'
|
1573
1573
|
period="day"
|
1574
1574
|
graph=True
|
1575
1575
|
|
1576
1576
|
def compare_mindustry_sw(industry_list,measure,start,end, \
|
1577
|
-
itype='
|
1577
|
+
itype='1',period="day",graph=True,printout=False,sortby='tpw_mean'):
|
1578
1578
|
"""
|
1579
1579
|
功能:比较多个行业industry_list某个指标measure在时间段start/end的时间序列趋势
|
1580
1580
|
industry_list: 至少有两项,若太多了则生成的曲线过于密集
|
@@ -1685,8 +1685,8 @@ def compare_mindustry_sw(industry_list,measure,start,end, \
|
|
1685
1685
|
else:
|
1686
1686
|
pass
|
1687
1687
|
|
1688
|
-
title_txt=
|
1689
|
-
additional_note="
|
1688
|
+
title_txt=title_txt+':'+y_label+','+sortby_txt
|
1689
|
+
additional_note="注:列表仅显示有星号标记或特定数量的证券。"
|
1690
1690
|
footnote='比较期间:'+start+'至'+end
|
1691
1691
|
ds=descriptive_statistics(df2,title_txt,additional_note+footnote,decimals=4, \
|
1692
1692
|
sortby=sortby,recommend_only=False)
|
@@ -1839,7 +1839,7 @@ if __name__=='__main__':
|
|
1839
1839
|
measure='Exp Ret%'
|
1840
1840
|
start='2020-11-1'
|
1841
1841
|
end='2022-10-31'
|
1842
|
-
itype='
|
1842
|
+
itype='1'
|
1843
1843
|
period="day"
|
1844
1844
|
graph=True
|
1845
1845
|
|
@@ -2160,9 +2160,9 @@ if __name__ =="__main__":
|
|
2160
2160
|
start='2023-1-1'; end='2023-4-10'
|
2161
2161
|
itype='F'
|
2162
2162
|
|
2163
|
-
idf,idfall=get_industry_info_sw(start,end,itype='
|
2163
|
+
idf,idfall=get_industry_info_sw(start,end,itype='1')
|
2164
2164
|
|
2165
|
-
def get_industry_info_sw(start,end,itype='
|
2165
|
+
def get_industry_info_sw(start,end,itype='1'):
|
2166
2166
|
"""
|
2167
2167
|
功能:获得申万行业历史数据
|
2168
2168
|
start: 开始日期
|
@@ -2347,7 +2347,7 @@ if __name__=='__main__':
|
|
2347
2347
|
end='2023-3-22'
|
2348
2348
|
info_type='Close'
|
2349
2349
|
|
2350
|
-
df=get_industry_sw('
|
2350
|
+
df=get_industry_sw('1')
|
2351
2351
|
df=industry_correlation_sw(df,tickers,start,end,info_type='Close')
|
2352
2352
|
|
2353
2353
|
def cm2inch(x,y):
|
siat/stock.py
CHANGED
@@ -1574,7 +1574,7 @@ def compare_msecurity(tickers,measure,start,end, \
|
|
1574
1574
|
print(" #Error(compare_msecurity): support only one measure")
|
1575
1575
|
return None
|
1576
1576
|
|
1577
|
-
print(" Searching for multiple security information for",measure,"\b, it
|
1577
|
+
print(" Searching for multiple security information for",measure,"\b, it may take great time ...")
|
1578
1578
|
#屏蔽函数内print信息输出的类
|
1579
1579
|
import os, sys
|
1580
1580
|
class HiddenPrints:
|
siat/stock_info.pickle
CHANGED
Binary file
|
siat/stock_technical.py
CHANGED
@@ -2003,12 +2003,15 @@ def security_bollinger(ticker,fromdate,todate,boll_days=20, \
|
|
2003
2003
|
|
2004
2004
|
try:
|
2005
2005
|
#pricedf=get_price(ticker,fromdate1,todate)
|
2006
|
-
pricedf=get_price_1ticker_mixed(ticker=ticker,fromdate=fromdate1, \
|
2006
|
+
pricedf,found=get_price_1ticker_mixed(ticker=ticker,fromdate=fromdate1, \
|
2007
2007
|
todate=todate,ticker_type=ticker_type)
|
2008
2008
|
except:
|
2009
2009
|
print(" #Error(security_bollinger): price info not found for",ticker)
|
2010
2010
|
return None
|
2011
|
-
|
2011
|
+
if found not in ['Found']:
|
2012
|
+
print(" #Error(): ticker info either inaccessible or not found for",ticker)
|
2013
|
+
return None
|
2014
|
+
|
2012
2015
|
# 滚动均值与标准差
|
2013
2016
|
pricedf['bmiddle']=pricedf["Close"].rolling(window=boll_days).mean()
|
2014
2017
|
pricedf['bsd']=pricedf["Close"].rolling(window=boll_days).std()
|
@@ -2351,7 +2354,9 @@ def security_technical(ticker,start='default',end='default', \
|
|
2351
2354
|
|
2352
2355
|
if 'Bollinger' in technical1:
|
2353
2356
|
vallist=['MV','PE','PB','ROE']
|
2354
|
-
if val in vallist and val in indicator1: #只能处理股票估值,无需ticker_type
|
2357
|
+
#if val in vallist and val in indicator1: #只能处理股票估值,无需ticker_type
|
2358
|
+
if any(val in indicator1 for val in vallist):
|
2359
|
+
val=list(set(indicator1).intersection(set(vallist)))[0] #找出2个列表中第1个共同元素
|
2355
2360
|
df=security_Bubble(ticker=ticker,start=fromdate,end=todate,boll_years=boll_years, \
|
2356
2361
|
indicator=val, \
|
2357
2362
|
graph=True,smooth=smooth,loc=loc1, \
|
siat/translate.py
CHANGED
@@ -819,7 +819,8 @@ def codetranslate0(code):
|
|
819
819
|
|
820
820
|
['00700.HK','腾讯港股'],['TENCENT','腾讯控股'],
|
821
821
|
['09988.HK','阿里巴巴港股'],['BABA-SW','阿里巴巴港股'],
|
822
|
-
['09618.HK','京东港股'],['JD-SW','京东港股'],
|
822
|
+
['09618.HK','京东港股'],['JD-SW','京东港股'],
|
823
|
+
['02517.HK','锅圈食品'],
|
823
824
|
|
824
825
|
#股票:石油、矿业
|
825
826
|
['SLB','斯伦贝谢'],['BKR','贝克休斯'],['HAL','哈里伯顿'],
|
@@ -1615,6 +1616,8 @@ def codetranslate0(code):
|
|
1615
1616
|
['BRLUSD=X','巴西雷亚尔/美元汇率'],['BRLUSD','巴西雷亚尔/美元汇率'],
|
1616
1617
|
|
1617
1618
|
['INRTUS.M','美联储基准利率'],['USDCNY','美元/人民币汇率'],
|
1619
|
+
['AUDCNY','澳大利亚元/人民币汇率'],['JPYCNY','日元/人民币汇率'],
|
1620
|
+
['USDJPY','美元/日元汇率'],['AUDJPY','澳大利亚元/日元汇率'],
|
1618
1621
|
|
1619
1622
|
['EUR_I','STOOQ欧元指数'],
|
1620
1623
|
['EURUSD=X','欧元/美元汇率'],['EURUSD','欧元/美元汇率'],
|
@@ -2994,12 +2997,19 @@ if __name__=='__main__':
|
|
2994
2997
|
#==============================================================================
|
2995
2998
|
#==============================================================================
|
2996
2999
|
#==============================================================================
|
3000
|
+
if __name__=='__main__':
|
3001
|
+
#更新所有证券名称
|
3002
|
+
update_all_names2files()
|
3003
|
+
|
2997
3004
|
def update_all_names2files():
|
2998
3005
|
"""
|
2999
3006
|
功能:更新股票(中港美)、基金(沪深)和债券(沪深)名称至文件中(S:/siat)
|
3000
3007
|
"""
|
3008
|
+
print(" Updating stock names in China, China HK and US markets ... ...")
|
3001
3009
|
df1=update_stock_names()
|
3010
|
+
print(" Updating exchange fund names in China markets ... ...")
|
3002
3011
|
df2=update_fund_names_china()
|
3012
|
+
print(" Updating exchange bond names in China markets ... ...")
|
3003
3013
|
df3=update_exchange_bond_name_china()
|
3004
3014
|
|
3005
3015
|
return
|
@@ -17,7 +17,7 @@ siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
|
|
17
17
|
siat/capm_beta2.py,sha256=hta-X1iWPjNbG1YYIVlQF-YvKA8An3KuEyLmUEZ3hH8,25562
|
18
18
|
siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
|
19
19
|
siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
|
20
|
-
siat/common.py,sha256=
|
20
|
+
siat/common.py,sha256=PVVP59khcYr0B0Kd-lcOPlekAU8ZzmKP_nuwIgJcjro,142643
|
21
21
|
siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
|
22
22
|
siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
|
23
23
|
siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
|
@@ -31,7 +31,7 @@ siat/economy.py,sha256=J0-xBtp6gg6CNP9N-UvpKLJ-0Tw5O_DKaDvEq1R35Fw,73853
|
|
31
31
|
siat/economy_test.py,sha256=6vjNlPz7W125pJb7simCddobSEp3jmLIMvVkLRZ7zW8,13339
|
32
32
|
siat/esg.py,sha256=PRgZo6rwlldAG9qNRnFWX0fnLdPHXIPVQOIFOJ2azmQ,19016
|
33
33
|
siat/esg_test.py,sha256=Z9m6GUt8O7oHZSEG9aDYpGdvvrv2AiRJdHTiU6jqmZ0,2944
|
34
|
-
siat/exchange_bond_china.pickle,sha256=
|
34
|
+
siat/exchange_bond_china.pickle,sha256=2Zp4Zfl7YBFQ7i4mG8x-7b562MPc3Jg_b2DjN9UMuTk,1247727
|
35
35
|
siat/fama_french.py,sha256=aUTC-67t_CEPbLk4u79woW_zfZ7OCP6Fo4z5EdWCSkQ,48051
|
36
36
|
siat/fama_french_test.py,sha256=M4O23lBKsJxhWHRluwCb3l7HSEn3OFTjzGMpehcevRg,4678
|
37
37
|
siat/financial_base.py,sha256=5u298_1OSlgLnDmhXxqvo4WgMM0JKSa_4jBYF-Ilx38,41097
|
@@ -51,7 +51,7 @@ siat/financials_china_test2_fin_indicator.py,sha256=WkNlVW_0hGegdw1rzg4BP_dKR-sm
|
|
51
51
|
siat/financials_test.py,sha256=HJ3CPo_Xckz2wXi3AEP6ZNWCF1Duc1pLi0Y10USiImc,23829
|
52
52
|
siat/fred_test.py,sha256=KF50ssSbsfpa_kT6iuomD0vG4eXztAcOasZxg1OGX5w,1201
|
53
53
|
siat/fund.py,sha256=wMDORsCBV8ZXfgwbtq-0bu3qqWY66dHnbqgllW0gWCo,24637
|
54
|
-
siat/fund_china.pickle,sha256=
|
54
|
+
siat/fund_china.pickle,sha256=QI3IjV46EeJ5ryO3xocmByc-6b_6_nDxgcXDhBHzop0,2380915
|
55
55
|
siat/fund_china.py,sha256=vdri-FucJ39SDdnM0AWULN9biSaQVh-dnfM03AhOuZY,80880
|
56
56
|
siat/fund_china_test.py,sha256=-Bh6m0J0GPpIbYXx-H2vpzJoNFI6pE2C2jVPa8DazgE,6649
|
57
57
|
siat/fund_test.py,sha256=V4ADb8Gsp8gyeFTwcgRsJBpnUih_O-Q2V1ILc5oKjK8,1116
|
@@ -91,7 +91,7 @@ siat/risk_evaluation.py,sha256=I6B3gty-t--AkDCO0tKF-291YfpnF-IkXcFjqNKCt9I,76286
|
|
91
91
|
siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
|
92
92
|
siat/risk_free_rate.py,sha256=ZMr4cHikPvXvywr54gGqiI3Nvb69am6tq3zj2hwzANE,12384
|
93
93
|
siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4285
|
94
|
-
siat/sector_china.py,sha256=
|
94
|
+
siat/sector_china.py,sha256=QSNJclhzT6V9NidziMwwAs-Kk6f7nzdK6PiPGkKrBCk,111617
|
95
95
|
siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
|
96
96
|
siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
|
97
97
|
siat/security_price2.py,sha256=kuYh0V5cqclkM6MjZUd-N361fv3oxGVVerYINuTzZrE,24622
|
@@ -101,18 +101,18 @@ siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
|
|
101
101
|
siat/security_trend2.py,sha256=AhIheVc0EvXShwDvMX3UbR3cX5cKYxSgUVqA_bHeCEI,24579
|
102
102
|
siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
|
103
103
|
siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
|
104
|
-
siat/stock.py,sha256=
|
104
|
+
siat/stock.py,sha256=PkNSJPwMlvwnRcbsyIrkslk_jvFfveQ7FDQg5XbEPoc,138964
|
105
105
|
siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
|
106
106
|
siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
|
107
107
|
siat/stock_china.py,sha256=UsC8vy1wnyBMGGsm5r1XMjIeGoHQyIcbxS6VKGiIlRs,91425
|
108
108
|
siat/stock_china_test.py,sha256=eO4HWsSvc6qezl0LndjtL24lViEyrBjH_sx2c2Y2Q2M,1294
|
109
|
-
siat/stock_info.pickle,sha256=
|
109
|
+
siat/stock_info.pickle,sha256=IGUkPbvwtXbngKBMWAzgYhplE96FucuTfnc26wvBiLQ,1319270
|
110
110
|
siat/stock_info_test.py,sha256=gfG3DbhDACbtD8wnv_R6zhj0t11XaC8NX8uLD9Qv3Fo,6122
|
111
111
|
siat/stock_list_china_test.py,sha256=gv14UwMMvkZqtb6G7DCTSuehIwVHuVwu7w60p6gyHoo,1014
|
112
112
|
siat/stock_prices_kneighbors.py,sha256=WfZvo5EyeBsm-T37zDj7Sl9dPSRq5Bx4JxIJ9IUum6s,36738
|
113
113
|
siat/stock_prices_linear.py,sha256=-OUKRr27L2aStQgJSlJOrJ4gay_G7P-m-7t7cU2Yoqk,13991
|
114
114
|
siat/stock_profile.py,sha256=B3eIwzEmiCqiCaxIlhfdEPsQBoW1PFOe1hkiY3mVF6Y,26038
|
115
|
-
siat/stock_technical.py,sha256=
|
115
|
+
siat/stock_technical.py,sha256=c9kv_ih1BxxBGk2bcfkFUfKxy3I4_1jNFfoYMk-j0gY,112833
|
116
116
|
siat/stock_test.py,sha256=E9YJAvOw1VEGJSDI4IZuEjl0tGoisOIlN-g9UqA_IZE,19475
|
117
117
|
siat/stooq.py,sha256=dOc_S5HLrYg48YAKTCs1eX8UTJOOkPM8qLL2KupqlLY,2470
|
118
118
|
siat/temp.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
@@ -126,13 +126,13 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
|
|
126
126
|
siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
|
127
127
|
siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
|
128
128
|
siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
|
129
|
-
siat/translate.py,sha256=
|
129
|
+
siat/translate.py,sha256=fmI2K6o2klJEQCxYqdh1njLg7aTYPjU_P_tCRqki2W8,209799
|
130
130
|
siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
|
131
131
|
siat/valuation.py,sha256=NKfeZMdDJOW42oLVHob6eSVBXUqlN1OCnnzwyGAst8c,48855
|
132
132
|
siat/valuation_china.py,sha256=Tde2LzPDQy3Z7xOQQDw4ckQMPdROp_z0-GjFE6Z5_lI,67639
|
133
133
|
siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
134
134
|
siat/var_model_validation.py,sha256=f-oDewg7bPzyNanz_Y_jLH68NowAA3gXFehW_weKGG0,14898
|
135
|
-
siat-3.0.
|
136
|
-
siat-3.0.
|
137
|
-
siat-3.0.
|
138
|
-
siat-3.0.
|
135
|
+
siat-3.0.41.dist-info/METADATA,sha256=seEw_evcNzXWMM5VhRD1XWxlxbsKT9XkDX5eUOi_jSw,1448
|
136
|
+
siat-3.0.41.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
137
|
+
siat-3.0.41.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
138
|
+
siat-3.0.41.dist-info/RECORD,,
|
File without changes
|