siat 3.7.10__py3-none-any.whl → 3.7.12__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/grafix.py CHANGED
@@ -365,7 +365,9 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
365
365
  plt.xlabel(footnote,fontsize=xlabel_txt_size,ha='center')
366
366
  plt.title(titletxt,fontweight='bold',fontsize=title_txt_size)
367
367
 
368
- plt.legend(loc=loc,fontsize=legend_txt_size)
368
+ if haveLegend:
369
+ plt.legend(loc=loc,fontsize=legend_txt_size)
370
+
369
371
  plt.show()
370
372
  plt.close()
371
373
 
siat/risk_free_rate.py CHANGED
@@ -211,7 +211,7 @@ def get_rf_capm(ticker,mktidx,fromdate,todate,window=240,sharelist=[]):
211
211
  try:
212
212
  rf=alpha/(1-beta)
213
213
  except:
214
- rf=np.NaN
214
+ rf=np.nan
215
215
 
216
216
  row=pd.Series({'date':sdate2,'Beta':beta,'alpha':alpha, \
217
217
  'R-sqr':r_value**2,'p-value':p_value,'sig':sig,'Rf':rf,'ticker':ticker,'footnote':footnote})
siat/security_prices.py CHANGED
@@ -2100,7 +2100,7 @@ def lpsd(ds):
2100
2100
  """
2101
2101
  import numpy as np
2102
2102
  #若序列长度为0则直接返回数值型空值
2103
- if len(ds) == 0: return np.NaN
2103
+ if len(ds) == 0: return np.nan
2104
2104
 
2105
2105
  #求均值
2106
2106
  import numpy as np
@@ -2116,8 +2116,8 @@ def lpsd(ds):
2116
2116
  #下偏标准差
2117
2117
  if ctr > 1:
2118
2118
  result=np.sqrt(sum/(ctr-1))
2119
- elif ctr == 1: result=np.NaN
2120
- else: result=np.NaN
2119
+ elif ctr == 1: result=np.nan
2120
+ else: result=np.nan
2121
2121
 
2122
2122
  return result
2123
2123
 
siat/stock_china.py CHANGED
@@ -201,7 +201,7 @@ def slog(x):
201
201
  功能:对x取对数,正数直接取对数,负数先变为正数再取对数加负号,零不操作
202
202
  '''
203
203
  import numpy as np
204
- if x == np.NaN: return np.NaN
204
+ if x == np.nan: return np.nan
205
205
  if x == 0: return 0
206
206
  if x > 0: return np.log(x)
207
207
  if x < 0: return -np.log(-x)
siat/stock_technical.py CHANGED
@@ -4,7 +4,7 @@
4
4
  所属工具包:证券投资分析工具SIAT
5
5
  SIAT:Security Investment Analysis Tool
6
6
  创建日期:2023年1月27日
7
- 最新修订日期:2023年1月27
7
+ 最新修订日期:2025年1月31
8
8
  作者:王德宏 (WANG Dehong, Peter)
9
9
  作者单位:北京外国语大学国际商学院
10
10
  作者邮件:wdehong2000@163.com
@@ -2483,22 +2483,23 @@ if __name__ =="__main__":
2483
2483
  technical='Bollinger'
2484
2484
  indicator='PE'
2485
2485
 
2486
- def security_technical(ticker,start='default',end='default', \
2487
- MA_days=[5,20],EMA_days=[5,20], \
2488
- MACD_fastperiod=12,MACD_slowperiod=26,MACD_signalperiod=9, \
2489
-
2490
- #RSI参数个数必须为3个,否则出错
2491
- RSI_days=[6,12,24],RSI_lines=[20,50,80], \
2492
- KDJ_days=[9,3,3],matypes=[0,0],KDJ_lines=[20,50,80], \
2493
- boll_days=20,boll_years=7, \
2494
- resample_freq='6H',smooth=True,linewidth=1.5, \
2495
- loc1='best',loc2='best', \
2496
- graph=['ALL'],printout=False, \
2497
- date_range=False,date_freq=False,annotate=False, \
2498
- technical=['MACD'],indicator='Close', \
2499
- ticker_type='auto',source='auto', \
2500
- price_line_color='red', \
2501
- facecolor='k'):
2486
+ def security_technical(ticker,technical=['MACD'],indicator='Close', \
2487
+ start='default',end='default', \
2488
+ MA_days=[5,20],EMA_days=[5,20], \
2489
+ MACD_fastperiod=12,MACD_slowperiod=26,MACD_signalperiod=9, \
2490
+
2491
+ #RSI参数个数必须为3个,否则出错
2492
+ RSI_days=[6,12,24],RSI_lines=[20,50,80], \
2493
+ KDJ_days=[9,3,3],matypes=[0,0],KDJ_lines=[20,50,80], \
2494
+ boll_days=20,boll_years=7, \
2495
+
2496
+ resample_freq='6H',smooth=True,linewidth=1.5, \
2497
+ loc1='best',loc2='best', \
2498
+ graph=['ALL'],printout=False, \
2499
+ date_range=False,date_freq=False,annotate=False, \
2500
+ ticker_type='auto',source='auto', \
2501
+ price_line_color='red', \
2502
+ facecolor='k'):
2502
2503
 
2503
2504
  """
2504
2505
  功能:技术分析中的MACD/RSI/KDJ/布林带,支持教学演示,支持参数调节。
@@ -2529,6 +2530,7 @@ def security_technical(ticker,start='default',end='default', \
2529
2530
  if t not in technical_list:
2530
2531
  print(" Warning(security_technical): unsupported technical pattern",t)
2531
2532
  print(" Supported patterns:",technical_list)
2533
+ return None
2532
2534
 
2533
2535
  #检查布林带的指标
2534
2536
  if isinstance(indicator,str):
@@ -2544,6 +2546,7 @@ def security_technical(ticker,start='default',end='default', \
2544
2546
  if t not in indicator_list1:
2545
2547
  print(" Warning(security_technical): unsupported Bollinger indicator",t)
2546
2548
  print(" Supported Bollinger indicator:",indicator_list1)
2549
+ return None
2547
2550
 
2548
2551
  # 检查绘图种类
2549
2552
  if isinstance(graph,str):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: siat
3
- Version: 3.7.10
3
+ Version: 3.7.12
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -8,15 +8,15 @@ Author-email: wdehong2000@163.com
8
8
  License: Copyright (C) WANG Dehong, 2024. For educational purpose only!
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: pandas-datareader
11
+ Requires-Dist: pandas_datareader
12
12
  Requires-Dist: yfinance
13
13
  Requires-Dist: tqdm
14
- Requires-Dist: plotly-express
14
+ Requires-Dist: plotly_express
15
15
  Requires-Dist: akshare
16
16
  Requires-Dist: urllib3
17
17
  Requires-Dist: mplfinance
18
18
  Requires-Dist: statsmodels
19
- Requires-Dist: yahoo-earnings-calendar
19
+ Requires-Dist: yahoo_earnings_calendar
20
20
  Requires-Dist: yahooquery
21
21
  Requires-Dist: pypinyin
22
22
  Requires-Dist: seaborn
@@ -33,10 +33,18 @@ Requires-Dist: graphviz
33
33
  Requires-Dist: luddite
34
34
  Requires-Dist: pendulum
35
35
  Requires-Dist: itables
36
- Requires-Dist: py-trans
36
+ Requires-Dist: py_trans
37
37
  Requires-Dist: bottleneck
38
38
  Requires-Dist: translate
39
39
  Requires-Dist: translators
40
+ Dynamic: author
41
+ Dynamic: author-email
42
+ Dynamic: description
43
+ Dynamic: description-content-type
44
+ Dynamic: home-page
45
+ Dynamic: license
46
+ Dynamic: requires-dist
47
+ Dynamic: summary
40
48
 
41
49
 
42
50
  # What is siat?
@@ -62,7 +62,7 @@ siat/future_china.py,sha256=F-HsIf2Op8Z22RzTjet1g8COzldgnMjFNSXsAkeGyWo,17595
62
62
  siat/future_china_test.py,sha256=BrSzmDVaOHki6rntOtosmRn-6dkfOBuLulJNqh7MOpc,1163
63
63
  siat/global_index_test.py,sha256=hnFp3wqqzzL-kAP8mgxDZ54Bd5Ijf6ENi5YJlGBgcXw,2402
64
64
  siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
65
- siat/grafix.py,sha256=WH_-a-R-zyKhT4t4NM24gYZWKyvIexN9LfXVQf-1zxA,110166
65
+ siat/grafix.py,sha256=SU5cZTGrz_Twacjj70bWq50wSobkmjoMdvk2DuUfpM4,110200
66
66
  siat/grafix_test.py,sha256=kXvcpLgQNO7wd30g_bWljLj5UH7bIVI0_dUtXbfiKR0,3150
67
67
  siat/holding_risk.py,sha256=G3wpaewAKF9CwEqRpr4khyuDu9SU2EGyQUHdk7cmHOA,30693
68
68
  siat/holding_risk_test.py,sha256=FRlw_9wFG98BYcg_cSj95HX5WZ1TvkGaOUdXD7-V86s,474
@@ -94,13 +94,13 @@ siat/risk_adjusted_return2.py,sha256=59YDzhbvr8PRRzb1Ew_8fuGqV4lEitm6itpk54xEb48
94
94
  siat/risk_adjusted_return_test.py,sha256=m_VHL5AtT74cJv5i7taTeTfnkX48y0AFJk5phawyYWg,3416
95
95
  siat/risk_evaluation.py,sha256=I6B3gty-t--AkDCO0tKF-291YfpnF-IkXcFjqNKCt9I,76286
96
96
  siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
97
- siat/risk_free_rate.py,sha256=ZMr4cHikPvXvywr54gGqiI3Nvb69am6tq3zj2hwzANE,12384
97
+ siat/risk_free_rate.py,sha256=IBuRqA2kppdZsW4D4fapW7vnM5HMEXOn95A5r9Pkwlo,12384
98
98
  siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4285
99
99
  siat/sector_china.py,sha256=Mxx5Zd5qvhLdwutedwoPRoXlAopTsPww4rRhOgpRmb8,150762
100
100
  siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
101
101
  siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
102
102
  siat/security_price2.py,sha256=FkX-EeqS5Gqm2kIKnDqrqSk_nvG3BbL3Eu4eEmw1OEY,26379
103
- siat/security_prices.py,sha256=i_4ZA7sRb9gMRVOgTT-XxQ1Jrz9eHDjZznsoXPDhh0Y,108859
103
+ siat/security_prices.py,sha256=cIplEWi6TJEIDI6xANaVf0YrOb1CPqvxULGIShoGa2s,108859
104
104
  siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
105
105
  siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
106
106
  siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmWBPk,24854
@@ -110,7 +110,7 @@ siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuY
110
110
  siat/stock.py,sha256=AO_ntNoinjXpzzs4eA1iMlsqGFoN1KvgHV6Z_ECVy-M,158658
111
111
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
112
112
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
113
- siat/stock_china.py,sha256=vm_BslG0gJm4R0-O5bNtENkMMfDP-u1TYKCKzLH9Nkk,93460
113
+ siat/stock_china.py,sha256=85Ggb21E2mrCYMdSSTTrkoyyLGXMK2V-BtlweHomSRg,93460
114
114
  siat/stock_china_test.py,sha256=eO4HWsSvc6qezl0LndjtL24lViEyrBjH_sx2c2Y2Q2M,1294
115
115
  siat/stock_info.pickle,sha256=XqcFwQrXoBXAzZnE6rnfpI7zETXZS2usqzsx2ff7MEg,1319005
116
116
  siat/stock_info_test.py,sha256=gfG3DbhDACbtD8wnv_R6zhj0t11XaC8NX8uLD9Qv3Fo,6122
@@ -119,7 +119,7 @@ siat/stock_prices_kneighbors.py,sha256=WfZvo5EyeBsm-T37zDj7Sl9dPSRq5Bx4JxIJ9IUum
119
119
  siat/stock_prices_linear.py,sha256=-OUKRr27L2aStQgJSlJOrJ4gay_G7P-m-7t7cU2Yoqk,13991
120
120
  siat/stock_profile.py,sha256=B3eIwzEmiCqiCaxIlhfdEPsQBoW1PFOe1hkiY3mVF6Y,26038
121
121
  siat/stock_technical-20240620.py,sha256=A4x18mZgYSA8SSiDz4u_O3gd5oVRgbI6JIiBfFY0tVw,116013
122
- siat/stock_technical.py,sha256=urnbFubwsYcl8dEPLM6DfdBmsia4xQ1rvM-71VZTM88,136050
122
+ siat/stock_technical.py,sha256=VX6qSBotTOzXaX1XHyDz3KBYEHlaxcPdBIOacB8T9no,136309
123
123
  siat/stock_test.py,sha256=E9YJAvOw1VEGJSDI4IZuEjl0tGoisOIlN-g9UqA_IZE,19475
124
124
  siat/stooq.py,sha256=SiRnSUu92pfzIZQ8N4Yo-9VOVSwUSqQE0wqXhF-4y9g,2493
125
125
  siat/temp.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
@@ -142,8 +142,8 @@ siat/valuation_china.py,sha256=CVp1IwIsF3Om0J29RGkyxZLt4n9Ug-ua_RKhLwL9fUQ,69624
142
142
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
143
143
  siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
144
144
  siat/yf_name.py,sha256=r0Q67cSMMlfebEkI9h9pdGlJCooEq7hw_3M5IUs4cSI,20081
145
- siat-3.7.10.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
146
- siat-3.7.10.dist-info/METADATA,sha256=nY3QaZF7WEgmuQ6z6eucsLYyrHlhX-BiCYsY97jrMEQ,8064
147
- siat-3.7.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
148
- siat-3.7.10.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
149
- siat-3.7.10.dist-info/RECORD,,
145
+ siat-3.7.12.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
146
+ siat-3.7.12.dist-info/METADATA,sha256=GeMpx_zpeBDdWN5pRB9YV-lCbOIXkppk3XtAG0BjmNM,8241
147
+ siat-3.7.12.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
148
+ siat-3.7.12.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
149
+ siat-3.7.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes