siat 3.5.10__py3-none-any.whl → 3.5.11__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 +5 -2
- siat/security_price2.py +5 -0
- siat/security_prices.py +17 -4
- siat/translate.py +2 -1
- {siat-3.5.10.dist-info → siat-3.5.11.dist-info}/METADATA +1 -1
- {siat-3.5.10.dist-info → siat-3.5.11.dist-info}/RECORD +9 -9
- {siat-3.5.10.dist-info → siat-3.5.11.dist-info}/LICENSE +0 -0
- {siat-3.5.10.dist-info → siat-3.5.11.dist-info}/WHEEL +0 -0
- {siat-3.5.10.dist-info → siat-3.5.11.dist-info}/top_level.txt +0 -0
siat/common.py
CHANGED
@@ -4376,13 +4376,15 @@ if __name__ == '__main__':
|
|
4376
4376
|
column='Close'
|
4377
4377
|
|
4378
4378
|
annual_compound_growth(df,"Close")
|
4379
|
+
annual_compound_growth(df,"High")
|
4379
4380
|
|
4380
4381
|
def annual_compound_growth(df,column="Close"):
|
4381
4382
|
"""
|
4382
4383
|
|
4383
4384
|
功能:计算df[column]的简单年均复合增长率,假定df按照日期顺序升序排列
|
4385
|
+
适用于计算长期股价/指数的年均复合增长率,不适用于收益率的年均复合增长率计算
|
4384
4386
|
"""
|
4385
|
-
if not
|
4387
|
+
if not column in list(df):
|
4386
4388
|
print(" Sorry, column",column,"not found in the dataframe")
|
4387
4389
|
return
|
4388
4390
|
|
@@ -4395,7 +4397,8 @@ def annual_compound_growth(df,column="Close"):
|
|
4395
4397
|
growth_rate=round((np.power(df[column][-1]/df[column][0],1/years)-1)*100,2)
|
4396
4398
|
rate_str=str(growth_rate)+'%'
|
4397
4399
|
|
4398
|
-
|
4400
|
+
day1str=day1.strftime("%Y-%m-%d"); day2str=day2.strftime("%Y-%m-%d")
|
4401
|
+
print("Annual compound growth",rate_str,"from",day1str,"to",day2str)
|
4399
4402
|
|
4400
4403
|
return
|
4401
4404
|
#==============================================================================
|
siat/security_price2.py
CHANGED
@@ -42,6 +42,8 @@ if __name__=='__main__':
|
|
42
42
|
|
43
43
|
ticker='AAPL'
|
44
44
|
|
45
|
+
ticker="006257"
|
46
|
+
|
45
47
|
|
46
48
|
fromdate='2024-5-1'; todate='2024-5-20'
|
47
49
|
|
@@ -55,7 +57,10 @@ if __name__=='__main__':
|
|
55
57
|
source='auto'
|
56
58
|
#source='yahoo'
|
57
59
|
|
60
|
+
adjust=''
|
58
61
|
adjust='qfq'
|
62
|
+
|
63
|
+
fill=False
|
59
64
|
fill=True
|
60
65
|
|
61
66
|
price,found=get_price_1ticker(ticker=ticker,fromdate=fromdate,todate=todate, \
|
siat/security_prices.py
CHANGED
@@ -708,6 +708,9 @@ if __name__=='__main__':
|
|
708
708
|
ticker='159990.SZ' #ETF基金
|
709
709
|
ticker='169201.SZ' #LOF基金
|
710
710
|
ticker='180801.SZ' #封闭式基金
|
711
|
+
|
712
|
+
ticker="006257"
|
713
|
+
|
711
714
|
ticker_type='auto'
|
712
715
|
|
713
716
|
ticker='sh019319' #国债
|
@@ -821,12 +824,22 @@ def get_price_ak_cn(ticker,fromdate,todate,adjust='',ticker_type='auto'):
|
|
821
824
|
df = exchange_bond_price(ticker2,fromdate,todate,graph=False,data_crop=False)
|
822
825
|
df['Date']=df.index
|
823
826
|
except:
|
824
|
-
|
825
|
-
|
827
|
+
try:
|
828
|
+
#再次尝试抓取开放式基金单位净值
|
829
|
+
df =get_price_oef_china(ticker2,fromdate,todate)
|
830
|
+
df['Date']=df.index
|
831
|
+
|
832
|
+
df['ticker']=ticker
|
833
|
+
df['Adj Close']=df['Close']
|
834
|
+
df['source']='Sina'
|
835
|
+
except:
|
836
|
+
df=None
|
837
|
+
#print(" #Error(get_price_ak_cn): failed to find prices for",ticker)
|
838
|
+
return None
|
826
839
|
found=df_have_data(df)
|
827
840
|
|
828
|
-
|
829
|
-
if found
|
841
|
+
#已找到证券信息,或在规定时段无数据
|
842
|
+
if found in ['Empty','Found']: return df
|
830
843
|
|
831
844
|
#债券优先,然后查找指数、股票和基金。因部分债券代码(特别是国债)与基金代码重合,需要甄别!
|
832
845
|
#例如;sh010504既是"05国债⑷"也是"招商稳兴混合C"基金的代码:-(
|
siat/translate.py
CHANGED
@@ -1131,7 +1131,8 @@ def codetranslate0(code):
|
|
1131
1131
|
['^CAC','法国CAC40指数'],['^DAX','德国DAX指数'],
|
1132
1132
|
['IMOEX.ME','俄罗斯MOEX指数'],['^MOEX','俄罗斯MOEX指数'],
|
1133
1133
|
['^RTS','俄罗斯RTS指数(美元标价)'],
|
1134
|
-
['^TASI','沙特TASI指数'],
|
1134
|
+
['^TASI','沙特TASI指数'],
|
1135
|
+
['TA35.TA','以色列TA35指数'],['^TA125.TA','以色列TA125指数'],
|
1135
1136
|
['^BVSP','巴西BVSP指数'],['^JNX4.JO','南非40指数'],
|
1136
1137
|
['^KLSE','吉隆坡综合指数'],['^KLCI','吉隆坡综合指数'],
|
1137
1138
|
['^JCI','雅加达综合指数'],
|
@@ -18,7 +18,7 @@ siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
|
|
18
18
|
siat/capm_beta2.py,sha256=lUuCPVSxebkA2yye1PXu1V2Jd2UKEwD_kIA25DCIDTs,29750
|
19
19
|
siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
|
20
20
|
siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
|
21
|
-
siat/common.py,sha256=
|
21
|
+
siat/common.py,sha256=MP24qZMxGN-EJTo3fevK7RIVanc-uSm0fGluKM723wc,160094
|
22
22
|
siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
|
23
23
|
siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
|
24
24
|
siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
|
@@ -97,8 +97,8 @@ siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4
|
|
97
97
|
siat/sector_china.py,sha256=MX1pzqvHvmWD9qGAe8lnUoCXSWjwnjBK8HhAbijTirI,150761
|
98
98
|
siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
|
99
99
|
siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
|
100
|
-
siat/security_price2.py,sha256=
|
101
|
-
siat/security_prices.py,sha256=
|
100
|
+
siat/security_price2.py,sha256=FkX-EeqS5Gqm2kIKnDqrqSk_nvG3BbL3Eu4eEmw1OEY,26379
|
101
|
+
siat/security_prices.py,sha256=bzdZ5I6cLPoO9Eu5Fy0T-VHkUxa6pOeEPbLAHgi_weA,108536
|
102
102
|
siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
|
103
103
|
siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
|
104
104
|
siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmWBPk,24854
|
@@ -131,7 +131,7 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
|
|
131
131
|
siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
|
132
132
|
siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
|
133
133
|
siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
|
134
|
-
siat/translate.py,sha256=
|
134
|
+
siat/translate.py,sha256=EV2hlAB-YqBT8NYjJSjMVHsK6mn0qbLVHiJGugUcbrM,241067
|
135
135
|
siat/translate_20240606.py,sha256=63IyHWEU3Uz9mjwyuAX3fqY4nUMdwh0ICQAgmgPXP7Y,215121
|
136
136
|
siat/translate_241003_keep.py,sha256=un7Fqe1v35MXsja5exZgjmLzrZtt66NARZIGlyFuGGU,218747
|
137
137
|
siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
|
@@ -140,8 +140,8 @@ siat/valuation_china.py,sha256=CVp1IwIsF3Om0J29RGkyxZLt4n9Ug-ua_RKhLwL9fUQ,69624
|
|
140
140
|
siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
141
141
|
siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
|
142
142
|
siat/yf_name.py,sha256=b4nefqEEbbinCEJ60_EysDCF9JZRott3wwclosZdrH8,16404
|
143
|
-
siat-3.5.
|
144
|
-
siat-3.5.
|
145
|
-
siat-3.5.
|
146
|
-
siat-3.5.
|
147
|
-
siat-3.5.
|
143
|
+
siat-3.5.11.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
|
144
|
+
siat-3.5.11.dist-info/METADATA,sha256=yfWj-hdifWXYqqhdhrT1zpfyDAO3BHXcScOeuXzFFNM,8010
|
145
|
+
siat-3.5.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
146
|
+
siat-3.5.11.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
147
|
+
siat-3.5.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|