siat 2.13.41__py3-none-any.whl → 2.13.43__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
@@ -33,6 +33,7 @@ title_txt_size=16
33
33
  ylabel_txt_size=14
34
34
  xlabel_txt_size=14
35
35
  legend_txt_size=14
36
+ annotate_size=9
36
37
 
37
38
  #设置绘图风格:网格虚线
38
39
  plt.rcParams['axes.grid']=False
@@ -1090,12 +1091,12 @@ def draw_lines(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
1090
1091
  if annotate_value: #在标记曲线名称的同时标记其末端数值
1091
1092
  plt.annotate(text=c+':'+str(round(y_end,2)),
1092
1093
  xy=(x_end, y_end),
1093
- xytext=(x_end, y_end),fontsize=9)
1094
+ xytext=(x_end, y_end),fontsize=annotate_size)
1094
1095
  else:
1095
1096
  plt.annotate(text=c,
1096
1097
  xy=(x_end, y_end),
1097
1098
  #xytext=(x_end, y_end),fontsize=9)
1098
- xytext=(x_end, y_end),fontsize=ylabel_txt_size)
1099
+ xytext=(x_end, y_end),fontsize=annotate_size)
1099
1100
 
1100
1101
  #plt.plot(df[c],label=c,linewidth=1.5,marker=mkc,markersize=3)
1101
1102
  #为折线加数据标签
@@ -1228,11 +1229,11 @@ def draw_lines2(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
1228
1229
  if annotate_value: #在标记曲线名称的同时标记其末端数值
1229
1230
  plt.annotate(text=c+':'+str(round(y_end,2)),
1230
1231
  xy=(x_end, y_end),
1231
- xytext=(x_end, y_end),fontsize=9)
1232
+ xytext=(x_end, y_end),fontsize=annotate_size)
1232
1233
  else:
1233
1234
  plt.annotate(text=c,
1234
1235
  xy=(x_end, y_end),
1235
- xytext=(x_end, y_end),fontsize=ylabel_txt_size)
1236
+ xytext=(x_end, y_end),fontsize=annotate_size)
1236
1237
 
1237
1238
 
1238
1239
  #绘制带状区域
@@ -1257,6 +1258,9 @@ def draw_lines2(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
1257
1258
  if not annotate:
1258
1259
  plt.legend(loc=loc,fontsize=legend_txt_size)
1259
1260
 
1261
+ #设置绘图风格:关闭网格虚线
1262
+ plt.rcParams['axes.grid']=False
1263
+
1260
1264
  plt.show()
1261
1265
 
1262
1266
  return
siat/security_trend.py CHANGED
@@ -145,9 +145,23 @@ def security_trend(ticker,indicator='Close', \
145
145
  else:
146
146
  validdate,fromdate=check_date2(start)
147
147
  if not validdate:
148
- print(" #Warning(security_trend): invalid date for",start,"/b, set to MRM")
148
+ print(" #Warning(security_trend): invalid date for",start,"/b, reset to MRM")
149
149
  fromdate=date_adjust(todate,adjust=-31-16)
150
150
 
151
+ # 检查窗口长度
152
+ if isinstance(window,str):
153
+ if window.lower() == "weekly":
154
+ window=5
155
+ elif window.lower() == "monthly":
156
+ window=21
157
+ elif window.lower() == "quarterly":
158
+ window=63
159
+ elif window.lower() == "annual":
160
+ window=252
161
+ else:
162
+ print(" #Warning(security_trend): invalid window size, reset to annual")
163
+ window=252
164
+
151
165
  # 处理K线图
152
166
  if kline and not kline_demo:
153
167
  # 跟踪
siat/stock.py CHANGED
@@ -53,6 +53,10 @@ if czxt in ['linux']: #website Jupyter
53
53
 
54
54
  # 解决保存图像时'-'显示为方块的问题
55
55
  plt.rcParams['axes.unicode_minus'] = False
56
+
57
+ #设置绘图风格:关闭网格虚线
58
+ plt.rcParams['axes.grid']=False
59
+
56
60
  #==============================================================================
57
61
  def reset_plt():
58
62
  """
@@ -79,7 +83,7 @@ def reset_plt():
79
83
  legend_txt_size=14
80
84
 
81
85
  #设置绘图风格:网格虚线
82
- plt.rcParams['axes.grid']=True
86
+ plt.rcParams['axes.grid']=False
83
87
  #plt.rcParams['grid.color']='steelblue'
84
88
  #plt.rcParams['grid.linestyle']='dashed'
85
89
  #plt.rcParams['grid.linewidth']=0.5
siat/stock_technical.py CHANGED
@@ -54,6 +54,9 @@ if czxt in ['linux']: #website Jupyter
54
54
  # 解决保存图像时'-'显示为方块的问题
55
55
  plt.rcParams['axes.unicode_minus'] = False
56
56
 
57
+ #设置绘图风格:关闭网格虚线
58
+ plt.rcParams['axes.grid']=False
59
+
57
60
  #==============================================================================
58
61
  #==============================================================================
59
62
  #==============================================================================
@@ -796,6 +799,9 @@ def stock_MACD(ticker,start='default',end='default', \
796
799
  import datetime as dt; today=dt.date.today()
797
800
  source="数据来源:sina/yahoo/stooq/fred,"+str(today)
798
801
 
802
+ #设置绘图风格:关闭网格虚线
803
+ plt.rcParams['axes.grid']=False
804
+
799
805
  # 设置绘图区的背景颜色为黑色
800
806
  fig=plt.figure()
801
807
  ax=fig.add_subplot(111)
@@ -2118,7 +2124,7 @@ def security_technical(ticker,start='default',end='default', \
2118
2124
  boll_days=20,boll_years=7, \
2119
2125
  resample_freq='6H',smooth=True,linewidth=1.5, \
2120
2126
  loc1='best',loc2='best', \
2121
- graph=['ALL'],printout=True, \
2127
+ graph=['ALL'],printout=False, \
2122
2128
  date_range=False,date_freq=False,annotate=False, \
2123
2129
  technical=['MACD'],indicator='Close'):
2124
2130
 
siat/valuation.py CHANGED
@@ -974,10 +974,12 @@ def security_valuation(tickers,indicators,start,end, \
974
974
 
975
975
  footnote1=""
976
976
  if i=='MV':
977
- footnote1="注:市值金额:十亿,当地货币单位"
977
+ if preprocess=='none':
978
+ footnote1="注:市值金额:十亿,当地货币单位\n"
979
+
978
980
  todaydt = datetime.date.today()
979
981
  footnote9="数据来源: 综合baidu/stooq/funddb/swhysc,"+str(todaydt)
980
- footnote=footnote1+'\n'+footnote9
982
+ footnote=footnote1+footnote9
981
983
 
982
984
  draw_lines(df2,y_label=ylabeltxt,x_label=footnote, \
983
985
  axhline_value=0,axhline_label='', \
@@ -999,10 +1001,12 @@ def security_valuation(tickers,indicators,start,end, \
999
1001
 
1000
1002
  footnote1=""
1001
1003
  if i1=='MV' or i2=='MV':
1002
- footnote1="注:市值金额:十亿,当地货币单位"
1004
+ if preprocess=='none':
1005
+ footnote1="注:市值金额:十亿,当地货币单位\n"
1006
+
1003
1007
  todaydt = datetime.date.today()
1004
1008
  footnote9="数据来源: 综合baidu/stooq/funddb/swhysc,"+str(todaydt)
1005
- footnote=footnote1+'\n'+footnote9
1009
+ footnote=footnote1+footnote9
1006
1010
 
1007
1011
  df2_1.rename(columns={i1:ectranslate(i1)},inplace=True)
1008
1012
  df2_2.rename(columns={i2:ectranslate(i2)},inplace=True)
@@ -1031,10 +1035,12 @@ def security_valuation(tickers,indicators,start,end, \
1031
1035
 
1032
1036
  footnote1=""
1033
1037
  if i=='MV':
1034
- footnote1="注:市值金额:十亿,当地货币单位"
1038
+ if preprocess=='none':
1039
+ footnote1="注:市值金额:十亿,当地货币单位\n"
1040
+
1035
1041
  todaydt = datetime.date.today()
1036
1042
  footnote9="数据来源: 综合baidu/stooq/funddb/swhysc,"+str(todaydt)
1037
- footnote=footnote1+'\n'+footnote9
1043
+ footnote=footnote1+footnote9
1038
1044
 
1039
1045
  colname1=i; label1=t1
1040
1046
  colname2=i; label2=t2
@@ -1064,10 +1070,12 @@ def security_valuation(tickers,indicators,start,end, \
1064
1070
 
1065
1071
  footnote1=""
1066
1072
  if i=='MV':
1067
- footnote1="注:市值金额:十亿,当地货币单位"
1073
+ if preprocess=='none':
1074
+ footnote1="注:市值金额:十亿,当地货币单位\n"
1075
+
1068
1076
  todaydt = datetime.date.today()
1069
1077
  footnote9="数据来源: 综合baidu/stooq/funddb/swhysc,"+str(todaydt)
1070
- footnote=footnote1+'\n'+footnote9
1078
+ footnote=footnote1+footnote9
1071
1079
 
1072
1080
  #ylabeltxt=i
1073
1081
  ylabeltxt=ectranslate(i)
@@ -1103,11 +1111,12 @@ def security_valuation(tickers,indicators,start,end, \
1103
1111
 
1104
1112
  footnote1=''
1105
1113
  if 'MV' in indicators1:
1106
- footnote1="注:市值金额:十亿,当地货币单位"
1114
+ if preprocess=='none':
1115
+ footnote1="注:市值金额:十亿,当地货币单位\n"
1107
1116
 
1108
1117
  todaydt = datetime.date.today()
1109
1118
  footnote9="数据来源: 综合baidu/stooq/funddb/swhysc,"+str(todaydt)
1110
- footnote=footnote1+'\n'+footnote9
1119
+ footnote=footnote1+footnote9
1111
1120
 
1112
1121
  #ylabeltxt=''
1113
1122
  ylabeltxt="估值"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 2.13.41
3
+ Version: 2.13.43
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
@@ -57,7 +57,7 @@ siat/future_china.py,sha256=F-HsIf2Op8Z22RzTjet1g8COzldgnMjFNSXsAkeGyWo,17595
57
57
  siat/future_china_test.py,sha256=BrSzmDVaOHki6rntOtosmRn-6dkfOBuLulJNqh7MOpc,1163
58
58
  siat/global_index_test.py,sha256=hnFp3wqqzzL-kAP8mgxDZ54Bd5Ijf6ENi5YJlGBgcXw,2402
59
59
  siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
60
- siat/grafix.py,sha256=nVzC8u5StHV6ZiyaGXv6L4z5DNZmVjTMFiZ6bKuJGTM,70560
60
+ siat/grafix.py,sha256=sWt4BfCiTfKb5FddcTpfxF-0yNXGi2ftlhryCnZ5MxI,70690
61
61
  siat/grafix_test.py,sha256=kXvcpLgQNO7wd30g_bWljLj5UH7bIVI0_dUtXbfiKR0,3150
62
62
  siat/holding_risk.py,sha256=Dh4zXEw-0hnbMNorbsRS142C8mUzq4NhFjYnauWu5tc,30548
63
63
  siat/holding_risk_test.py,sha256=FRlw_9wFG98BYcg_cSj95HX5WZ1TvkGaOUdXD7-V86s,474
@@ -92,10 +92,10 @@ siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,584
92
92
  siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
93
93
  siat/security_prices.py,sha256=kGBAqHwmN_iupBZ6v3AUrRHjCSNxP09sz2nlBSVyaHs,76950
94
94
  siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
95
- siat/security_trend.py,sha256=DQ9hwAioTg0R_9XTqT5jywLWSmMK1GAvOtiPJVFQPZA,15911
95
+ siat/security_trend.py,sha256=AjGvcWIzdDzH8gXPOM2wtffFmdzZ-KoWHD7DsdLJRpU,16361
96
96
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
97
97
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
98
- siat/stock.py,sha256=ejCrOoslRzhjA7wNHsLggYw3fWiL-3r3G0PSF06OHw8,141510
98
+ siat/stock.py,sha256=ZMr6wiB6pxKOQ-pQhi3goPjqTYKfY15UXBC5Vtud7tM,141590
99
99
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
100
100
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
101
101
  siat/stock_china.py,sha256=B1hbZCxJuE5GVvGGmf_rSmQodYHmEFuyiDrUvxHhg4w,83969
@@ -106,7 +106,7 @@ siat/stock_list_china_test.py,sha256=gv14UwMMvkZqtb6G7DCTSuehIwVHuVwu7w60p6gyHoo
106
106
  siat/stock_prices_kneighbors.py,sha256=WfZvo5EyeBsm-T37zDj7Sl9dPSRq5Bx4JxIJ9IUum6s,36738
107
107
  siat/stock_prices_linear.py,sha256=-OUKRr27L2aStQgJSlJOrJ4gay_G7P-m-7t7cU2Yoqk,13991
108
108
  siat/stock_profile.py,sha256=npinIwxgfgHeV8tpXrzLBrPUWKMZGL2-xA96ve-H2wM,25329
109
- siat/stock_technical.py,sha256=mlyJ5D9S4a6aSwMnQLKVs0H1BHB17AUVNiN700j2lXU,96131
109
+ siat/stock_technical.py,sha256=v6MYSrH0jAmBWHOtZw_jl-uln4Ouxcz21jCPSd3MZ_c,96310
110
110
  siat/stock_test.py,sha256=E9YJAvOw1VEGJSDI4IZuEjl0tGoisOIlN-g9UqA_IZE,19475
111
111
  siat/stooq.py,sha256=dOc_S5HLrYg48YAKTCs1eX8UTJOOkPM8qLL2KupqlLY,2470
112
112
  siat/temp.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
@@ -122,11 +122,11 @@ siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,11
122
122
  siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
123
123
  siat/translate.py,sha256=aOn3GVMkdFcKvbL0T5gRn-uPA6vj93BCITkyn30H9SA,167047
124
124
  siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
125
- siat/valuation.py,sha256=7_jBnthig4kAWrE4iAQ2vOKAkhnFsvXi8lDdAC0kWZY,47105
125
+ siat/valuation.py,sha256=x-3qpu_14SLAPuO2gwmT9ojPYIEZCX8KcnIbezDiFKI,47362
126
126
  siat/valuation_china.py,sha256=oEQRrktJNHiOG1mJSQN1aSSQAQrwrg-ppIHyNVjMjNg,67603
127
127
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
128
128
  siat/var_model_validation.py,sha256=zB_Skk_tmzIR15l6oAW3am4HBGVIG-eZ8gJhCdXZ8Qw,14859
129
- siat-2.13.41.dist-info/METADATA,sha256=7kf2jAQHnIJBJCds9iDD_kpmdGfSZzUvZMzL3B-vIF0,1449
130
- siat-2.13.41.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
- siat-2.13.41.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
- siat-2.13.41.dist-info/RECORD,,
129
+ siat-2.13.43.dist-info/METADATA,sha256=qVwesFD3f42XukMjYxvJbgEqG7YVaGmMbN9CdUKJJGo,1449
130
+ siat-2.13.43.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
+ siat-2.13.43.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
+ siat-2.13.43.dist-info/RECORD,,
File without changes