siat 3.10.125__py3-none-any.whl → 3.10.126__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.
Files changed (87) hide show
  1. siat/common.py +106 -2
  2. siat/exchange_bond_china.pickle +0 -0
  3. siat/fund_china.pickle +0 -0
  4. siat/stock.py +10 -2
  5. siat/stock_info.pickle +0 -0
  6. {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/METADATA +234 -226
  7. siat-3.10.126.dist-info/RECORD +76 -0
  8. {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/WHEEL +1 -1
  9. {siat-3.10.125.dist-info → siat-3.10.126.dist-info/licenses}/LICENSE +0 -0
  10. {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/top_level.txt +0 -0
  11. siat/__init__ -20240701.py +0 -65
  12. siat/__init__.py.backup_20250214.py +0 -73
  13. siat/alpha_vantage_test.py +0 -24
  14. siat/assets_liquidity_test.py +0 -44
  15. siat/barrons_scraping_test.py +0 -276
  16. siat/beta_adjustment_test.py +0 -77
  17. siat/bond_test.py +0 -142
  18. siat/capm_beta_test.py +0 -49
  19. siat/cmat_commons.py +0 -961
  20. siat/compare_cross_test.py +0 -117
  21. siat/concepts_iwencai.py +0 -86
  22. siat/concepts_kpl.py +0 -93
  23. siat/cryptocurrency_test.py +0 -71
  24. siat/derivative.py +0 -1111
  25. siat/economy-20230125.py +0 -1206
  26. siat/economy_test.py +0 -360
  27. siat/esg_test.py +0 -63
  28. siat/fama_french_test.py +0 -115
  29. siat/financial_statements_test.py +0 -31
  30. siat/financials2 - /321/205/320/231/320/277/321/206/320/254/320/274.py" +0 -341
  31. siat/financials_china2_test.py +0 -67
  32. siat/financials_china2_test2.py +0 -88
  33. siat/financials_china2_test3.py +0 -87
  34. siat/financials_china_test.py +0 -475
  35. siat/financials_china_test2.py +0 -197
  36. siat/financials_china_test2_fin_indicator.py +0 -197
  37. siat/financials_test.py +0 -713
  38. siat/fred_test.py +0 -40
  39. siat/fund_china_test.py +0 -175
  40. siat/fund_test.py +0 -40
  41. siat/future_china_test.py +0 -37
  42. siat/global_index_test.py +0 -66
  43. siat/grafix_test.py +0 -112
  44. siat/holding_risk_test.py +0 -13
  45. siat/local_debug_test.py +0 -100
  46. siat/markowitz2-20240620.py +0 -2614
  47. siat/markowitz_ccb_test.py +0 -37
  48. siat/markowitz_ef_test.py +0 -136
  49. siat/markowitz_old.py +0 -871
  50. siat/markowitz_simple-20230709.py +0 -370
  51. siat/markowitz_test.py +0 -164
  52. siat/markowitz_test2.py +0 -69
  53. siat/ml_cases_example1.py +0 -60
  54. siat/option_china_test.py +0 -447
  55. siat/option_pricing_test.py +0 -81
  56. siat/option_sina_api_test.py +0 -112
  57. siat/proxy_test.py +0 -84
  58. siat/quandl_test.py +0 -39
  59. siat/risk_adjusted_return_test.py +0 -81
  60. siat/risk_evaluation_test.py +0 -96
  61. siat/risk_free_rate_test.py +0 -127
  62. siat/sector_china_test.py +0 -203
  63. siat/security_price.py +0 -831
  64. siat/security_prices_test.py +0 -310
  65. siat/security_trend2-20240620.py +0 -493
  66. siat/setup.py +0 -41
  67. siat/shenwan index history test.py +0 -41
  68. siat/stock_china_test.py +0 -38
  69. siat/stock_info_test.py +0 -189
  70. siat/stock_list_china_test.py +0 -33
  71. siat/stock_technical-20240620.py +0 -2736
  72. siat/stock_test.py +0 -487
  73. siat/temp.py +0 -36
  74. siat/test2_graphviz.py +0 -484
  75. siat/test_graphviz.py +0 -411
  76. siat/test_markowitz_simple.py +0 -198
  77. siat/test_markowitz_simple_revised.py +0 -215
  78. siat/test_markowitz_simple_revised2.py +0 -218
  79. siat/transaction_test.py +0 -436
  80. siat/translate-20230125.py +0 -2107
  81. siat/translate-20230206.py +0 -2109
  82. siat/translate-20230215.py +0 -2158
  83. siat/translate_20240606.py +0 -4206
  84. siat/translate_241003_keep.py +0 -4300
  85. siat/universal_test.py +0 -100
  86. siat/valuation_market_china_test.py +0 -36
  87. siat-3.10.125.dist-info/RECORD +0 -152
@@ -1,310 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- import os; os.chdir('E:/siat')
4
- from siat import *
5
- #==============================================================================
6
- df=ak.stock_zh_a_hist('000001',period="daily",start_date='20211201',end_date='20211231')
7
-
8
- get_prices('000001.SS','2021-12-1','2021-12-31')
9
- get_prices('000001.SZ','2021-12-1','2021-12-31')
10
-
11
-
12
-
13
- #==============================================================================
14
- #广泛测试
15
- get_prices('000001.SS','2021-11-1','2021-11-5')
16
- get_prices('600000.SS','2021-11-1','2021-11-5')
17
- get_prices_ak('600000.SS','2021-11-1','2021-11-5')
18
- get_price_ak_em('600000.SS','2021-11-1','2021-11-5')
19
- get_price_ak_cn('600000.SS','2021-11-1','2021-11-5')
20
-
21
- get_prices('399001.SZ','2021-11-1','2021-11-5')
22
- get_prices('000002.SZ','2021-11-1','2021-11-5')
23
-
24
- get_prices('430090.SZ','2021-11-1','2021-11-5')
25
- get_prices('430090.BJ','2021-11-1','2021-11-5')
26
- get_prices('830946.BJ','2021-11-1','2021-11-5')
27
-
28
- get_prices('^GSPC','2021-11-1','2021-11-5')
29
- get_prices('^DJI','2021-11-1','2021-11-5')
30
- get_prices('^RUT','2021-11-1','2021-11-5') #替代
31
- get_prices('^IXIC','2021-11-1','2021-11-5')
32
- get_prices('^NDX','2021-11-1','2021-11-5')
33
- get_prices('AAPL','2021-11-1','2021-11-5')
34
- get_prices('AAPL.US','2021-11-1','2021-11-5')
35
- get_prices('AAPL_PE.US','2021-11-1','2021-11-5')
36
- get_prices('AAPL_PB.US','2021-11-1','2021-11-5')
37
- get_prices('AAPL_MV.US','2021-11-1','2021-11-5')
38
- get_prices('BABA','2021-11-1','2021-11-5')
39
- get_prices('BABA.US','2021-11-1','2021-11-5')
40
- get_prices('BABA_PE.US','2021-11-1','2021-11-5')
41
- get_prices('BABA_PB.US','2021-11-1','2021-11-5')
42
- get_prices('BABA_MV.US','2021-11-1','2021-11-5')
43
- get_prices('MSFT','2021-11-1','2021-11-5')
44
-
45
- get_prices('^N225','2021-11-1','2021-11-5')
46
- get_prices('6758.T','2021-11-1','2021-11-5')
47
- get_prices('7004.T','2021-11-1','2021-11-5')
48
-
49
- get_prices('^BSESN','2021-11-1','2021-11-5')
50
-
51
-
52
- get_prices('^GDAXI','2021-11-1','2021-11-5')
53
- get_prices('BMW.DE','2021-11-1','2021-11-5')
54
-
55
- get_prices('^FCHI','2021-11-1','2021-11-5')
56
-
57
-
58
- get_prices('^FTSE','2021-11-1','2021-11-5')
59
- get_prices('TCS.UK','2021-11-1','2021-11-5')
60
-
61
- get_prices('^HSI','2021-11-1','2021-11-5')
62
- get_prices('0700.HK','2021-11-1','2021-11-5')
63
- get_price_ak_hk('0700.HK','2021-11-1','2021-11-5')
64
- get_prices('00700.HK','2021-11-1','2021-11-5')
65
- get_prices('82843.HK','2021-11-1','2021-11-5')
66
-
67
-
68
-
69
-
70
- #==============================================================================
71
- get_names('000002.SZ')
72
- get_names('000002.SS')
73
- get_names('430090.NQ')
74
- get_names('830946.BJ')
75
-
76
- df = ak.stock_zh_a_spot_em()
77
-
78
-
79
- codetranslate('000002.SZ')
80
- codetranslate('000002.SS')
81
- codetranslate('430090.NQ')
82
- codetranslate('830946.BJ')
83
- #==============================================================================
84
- #支持北交所历史行情:东方财富,.NQ? .BJ?
85
- df1=ak.stock_zh_a_hist(symbol="000001",period="daily",start_date="20211101",end_date='20211126', adjust="")
86
- df1['换手率'].plot()
87
- df2=ak.stock_zh_a_hist(symbol="430090",period="daily",start_date="20210101",end_date='20211126', adjust="")
88
- df3=ak.stock_zh_a_hist(symbol="830946",period="daily",start_date="20210101",end_date='20211126', adjust="")
89
-
90
- #沪深京:股票代码-名称
91
- df999 = ak.stock_info_a_code_name()
92
- #查名称
93
- df999[df999['code']=='430090']['name'].values[0]
94
- #==============================================================================
95
-
96
- df=security_price('00700.HK','2021-11-1','2021-11-20',power=6)
97
- df=security_price('0700.HK','2021-11-1','2021-11-20',power=6)
98
- df=security_price('00886.HK','2021-11-1','2021-11-20',power=6)
99
- df=security_price('0886.HK','2021-11-1','2021-11-20',power=6)
100
-
101
- df=security_price('7203.T','2021-11-1','2021-11-20',power=6)
102
- #==============================================================================
103
- import sys
104
- sys.path.insert(0,r'S:\siat\siat')
105
- from security_prices import *
106
-
107
- df=security_price('^HSI','2014-1-1','2016-12-31',power=6)
108
- df=get_prices('0700.HK','2014-1-1','2016-12-31')
109
- df=get_prices('^HSI','2014-1-1','2016-12-31')
110
- df=get_prices('^GSPC','2014-1-1','2016-12-31')
111
- df=get_prices('^DJI','2014-1-1','2016-12-31')
112
- df=get_prices('^IXIC','2014-1-1','2016-12-31')
113
- df=get_prices('^N225','2014-1-1','2016-12-31')
114
- df=get_prices('^VIX','2014-1-1','2016-12-31')
115
-
116
- df=get_prices('^RUT','2014-1-1','2016-12-31')
117
-
118
- df=get_prices('600519.SS','2014-1-1','2016-12-31')
119
- df=get_prices('000002.SZ','2014-1-1','2016-12-31')
120
-
121
-
122
-
123
- df=get_index_fred('^GSPC','2014-1-1','2016-12-31')
124
- df=get_index_fred('^DJI','2014-1-1','2016-12-31')
125
-
126
- df=get_price_ak_cn('600340.SS','2021-1-1','2021-1-31')
127
-
128
- zs=ak.index_investing_global_country_name_url("美国")
129
- zsjg=ak.index_investing_global(country="美国", index_name="VIX恐慌指数", period="每日", start_date="2005-01-01", end_date="2020-06-05")
130
-
131
- from siat import *
132
- df=security_price('000300.SS','2014-1-1','2016-12-31',power=6)
133
- df=security_price('000888.SZ','2014-1-1','2016-12-31',power=6)
134
- df=get_price_ak_cn('000888.SZ','2014-1-1','2016-12-31')
135
-
136
- portfolio={'Market':('China','^HSI'),'0823.HK':1.0}
137
- pp=get_portfolio_prices(portfolio,'2021-7-1','2021-10-30')
138
-
139
- #==============================================================================
140
- p=security_price("BB","2015-1-10","2015-1-24",power=0)
141
- p=security_price("LLY","2000-1-1","2003-12-31",power=10)
142
- #==============================================================================
143
- dfyf=get_prices_yf('AAPL','2020-1-1','2021-4-8',threads=False)
144
-
145
- dfak=get_prices_ak('600519.SS','2020-1-1','2021-4-8')
146
- dfak=get_prices_ak(['600519.SS','000002.SZ'],'2020-1-1','2021-4-8')
147
-
148
-
149
- df=get_prices('AAPL','2020-1-1','2021-4-8',adj=False)
150
- dfa=get_prices('AAPL','2020-1-1','2021-4-8',adj=True)
151
- dfa_dif=dfa[dfa['Close']!=dfa['Adj Close']]
152
-
153
- dfhy=get_prices('300401.SZ','2018-5-1','2018-5-30',adj=True)
154
- dfyfhy=get_prices_yf('300401.SZ','2018-5-1','2018-5-30',threads=False)
155
-
156
-
157
-
158
- ticker=['600011.SS']
159
- start='2020-1-1'
160
- end='2020-6-30'
161
- pak=get_prices_ak(ticker,start,end)
162
-
163
- pyf=get_price_yf(ticker,start,end)
164
-
165
- pyh=p=get_prices_yahoo(ticker,start,end)
166
-
167
- p=get_prices(ticker,start,end)
168
-
169
- tickerlist=['600011.SS']
170
- sharelist=[1]
171
- p1=get_price_portfolio(tickerlist,sharelist,start,end)
172
-
173
-
174
- if __name__=='__main__':
175
- tickerlist=['INTC','MSFT']
176
- sharelist=[0.6,0.4]
177
- fromdate='2020-11-1'
178
- todate='2021-1-31'
179
-
180
- p2=get_prices_portfolio(tickerlist,sharelist,fromdate,todate)
181
-
182
-
183
- if __name__=='__main__':
184
- tickerlist=['INTC','MSFT','uvwxyz']
185
- sharelist=[0.6,0.3,0.1]
186
- fromdate='2020-11-1'
187
- todate='2021-1-31'
188
- dfp1=get_prices_portfolio(tickerlist,sharelist,fromdate,todate)
189
- dfp2=get_prices_yf(tickerlist,fromdate,todate)
190
- dfp3=get_prices(tickerlist,fromdate,todate)
191
-
192
- prices=get_prices_yf(tickerlist,fromdate,todate)
193
-
194
-
195
- if __name__=='__main__':
196
- df1=get_prices('INTC','2020-10-1','2021-1-31')
197
- df2=get_prices(['INTC'],'2020-10-1','2021-1-31')
198
- df3=get_prices(['XYZ'],'2020-10-1','2021-1-31')
199
- df4=get_prices(['INTC','MSFT'],'2020-10-1','2021-1-31')
200
- df5=get_prices(['INTC','UVW'],'2020-10-1','2021-1-31')
201
- df6=get_prices(['0988.HK','000858.SZ'],'2020-10-1','2021-1-31')
202
- df7=get_prices(['INTL','MSFT','0988.HK','000858.SZ'],'2020-10-1','2021-1-31')
203
- df8=get_prices(['000858.SZ','600519.SS'],'2020-10-1','2021-1-31')
204
-
205
-
206
- #==============================================================================
207
- import akshare as ak
208
-
209
- #上证综指
210
- sh_df = ak.stock_zh_index_daily(symbol="sh000001")
211
-
212
- #上证50指数
213
- sh50_df = ak.stock_zh_index_daily(symbol="sh000016")
214
-
215
- #上证100指数
216
- sh100_df = ak.stock_zh_index_daily(symbol="sh000132")
217
-
218
- #上证150指数
219
- sh150_df = ak.stock_zh_index_daily(symbol="sh000133")
220
-
221
- #上证180指数
222
- sh180_df = ak.stock_zh_index_daily(symbol="sh000010")
223
-
224
- #科创50指数
225
- kc50_df = ak.stock_zh_index_daily(symbol="sh000688")
226
-
227
- #沪深300指数
228
- hs300_df = ak.stock_zh_index_daily(symbol="sh000300")
229
-
230
- #大盘,中证100指数
231
- zz100_df = ak.stock_zh_index_daily(symbol="sh000903")
232
-
233
- #中盘,中证200指数
234
- zz200_df = ak.stock_zh_index_daily(symbol="sh000904")
235
-
236
- #小盘,中证500指数
237
- zz500_df = ak.stock_zh_index_daily(symbol="sh000906")
238
-
239
- #深证成指
240
- sz_df = ak.stock_zh_index_daily(symbol="sz399001")
241
-
242
- #交易所概况
243
- sse_summary_df = ak.stock_sse_summary()
244
- szse_summary_df = ak.stock_szse_summary()
245
-
246
- stock_zh_index_daily_tx_df = ak.stock_zh_index_daily_tx(symbol="sh000001")
247
-
248
- #==============================================================================
249
- import os; os.chdir("S:/siat")
250
- from siat.security_prices import *
251
-
252
- df1=get_prices(['600519.SS','000858.SZ'],'2020-10-1','2021-1-31')
253
- df2=get_prices(['0700.HK','000858.SZ'],'2020-10-1','2021-1-31')
254
- df3=get_prices(['AAPL','MSFT'],'2020-10-1','2021-1-31')
255
- df4=get_prices('399001.SZ','2020-10-1','2021-1-31')
256
- df5=get_prices('000016.SS','2020-10-1','2021-1-31')
257
-
258
- dfp1=get_prices_portfolio(['600519.SS','000858.SZ'],[1,2],'2020-10-1','2021-1-31')
259
- dfp2=get_prices_portfolio(['0700.HK','000858.SZ'],[1,2],'2020-10-1','2021-1-31')
260
- dfp3=get_prices_portfolio(['AAPL','MSFT'],[1,2],'2020-10-1','2021-1-31')
261
-
262
-
263
- df600519=get_price_ak('600519.SS','2020-12-1','2021-2-5',adjust='none')
264
- df600519hfq=get_price_ak('600519.SS','2020-12-1','2021-2-5',adjust='hfq')
265
- df399001=get_price_ak('399001.SZ','2020-12-1','2021-2-5')
266
- df000688=get_price_ak('000688.SS','2020-12-1','2021-2-5')
267
- dfaapl=get_price_ak('AAPL','2020-12-1','2021-2-5')
268
-
269
- df3=get_prices_yf(['AAPL','MSFT'],'2020-12-1','2021-1-31')
270
-
271
-
272
-
273
- if __name__=='__main__':
274
- df1=get_prices('INTC','2020-10-1','2021-1-31')
275
- df2=get_prices(['INTC'],'2020-10-1','2021-1-31')
276
- df3=get_prices('XYZ','2020-10-1','2021-1-31')
277
- df3b=get_prices(['XYZ'],'2020-10-1','2021-1-31')
278
- df4=get_prices(['INTC','MSFT'],'2020-10-1','2021-1-31')
279
- df5=get_prices(['INTC','UVW123'],'2020-10-1','2021-1-31')
280
- df6=get_prices(['0988.HK','000858.SZ'],'2020-10-1','2021-1-31')
281
- df7=get_prices(['INTL','MSFT','0988.HK','000858.SZ'],'2020-10-1','2021-1-31')
282
-
283
- if __name__=='__main__':
284
- tickerlist=['INTC','MSFT']
285
- sharelist=[0.6,0.4]
286
- fromdate='2020-11-1'
287
- todate='2021-1-31'
288
- dfp=get_prices_portfolio(tickerlist,sharelist,fromdate,todate)
289
-
290
- #==================================================================================
291
-
292
-
293
- def test_yahoo():
294
- """
295
- 测试雅虎网站是否可访问
296
- 结果:网址可达,网页不可访问,无用
297
- """
298
- import pandas_datareader.data as web
299
- ticker='AAPL'
300
- start='2021-1-1'
301
- end='2021-1-11'
302
- try:
303
- appl = web.get_data_yahoo(ticker,start,end)
304
- return True
305
- except:
306
- return False
307
-
308
- if __name__=='__main__':
309
- test_yahoo()
310
-