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
siat/economy_test.py DELETED
@@ -1,360 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
- import os; os.chdir("S:/siat")
5
- from siat import *
6
-
7
- #==============================================================================
8
- tickers=['China','Japan']
9
- measures='Constant CPI'
10
- fromdate='2022-1-1'
11
- todate='2022-1-1'
12
- power=0
13
- twinx=False
14
- loc1='upper left';loc2='lower right'
15
-
16
-
17
-
18
-
19
- cn_jp=compare_economy(['China','Japan'],'Constant CPI','2010-1-1','2022-1-1')
20
-
21
-
22
-
23
-
24
-
25
-
26
- cn_jp=compare_economy(['China','Japan'],'Currency Value','2010-1-1','2022-1-1',loc1='upper right')
27
- internal_growth_rate(cn_jp)
28
-
29
- cn_usa=compare_economy(['China','USA'],'Currency Value','2010-1-1','2022-1-1',loc1='upper right')
30
- internal_growth_rate(cn_usa)
31
-
32
- cn_fr=compare_economy(['China','France'],'Currency Value','2010-1-1','2022-1-1',loc1='upper right')
33
- internal_growth_rate(cn_fr)
34
-
35
- cn_uk=compare_economy(['China','UK'],'Currency Value','2010-1-1','2022-1-1',loc1='upper right')
36
- internal_growth_rate(cn_uk)
37
-
38
- cn_in=compare_economy(['China','India'],'Currency Value','2010-1-1','2022-1-1',loc1='upper right')
39
- internal_growth_rate(cn_in)
40
-
41
- df=compare_security(['^IRX','^TYX'],"Close","2015-1-1","2022-12-31")
42
-
43
- #==============================================================================
44
- cn_usa=compare_economy(['China','USA'],'M2','1999-12-1','2022-4-1',twinx=True)
45
- cn_usa=compare_economy(['China','USA'],'Constant M2','1999-12-1','2022-4-1')
46
- cn_usa=compare_economy('China',['Constant M1','Constant M2'],'1999-12-1','2022-4-1')
47
-
48
-
49
- cn=economy_trend('2010-1-1','2020-1-1','China','MoM CPI',power=4,zeroline=True)
50
- cn=economy_trend('2010-1-1','2020-1-1','China','Constant CPI',power=4)
51
- cn_jp=compare_economy(['China','Japan'],'Constant CPI','2010-1-1','2020-1-1')
52
-
53
-
54
- #==============================================================================
55
- cn_usa=compare_economy(['China','USA'],'Immediate Rate','2010-1-1','2021-5-25')
56
- cn_jp=compare_economy(['China','Japan'],'Immediate Rate','2010-1-1','2021-1-1')
57
- cn_uk=compare_economy(['China','LIBOR'],'Immediate Rate','2010-1-1','2021-1-1')
58
- #==============================================================================
59
- cn_usa=compare_economy(['China','USA'],'CNP GDP Per Capita','2010-1-1','2020-1-1')
60
- cn_usa=compare_economy(['China','USA'],'CNP GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
61
-
62
- df=pmi_china('2008-1-1','2021-3-31')
63
-
64
-
65
- c_cn=economy_trend('2010-1-1','2020-1-1','China','Constant GDP',power=3)
66
- internal_growth_rate(c_cn)
67
-
68
- usa_cn=compare_economy(['USA','China'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
69
- internal_growth_rate(usa_cn)
70
-
71
- jp_cn=compare_economy(['Japan','China'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
72
-
73
- df=pmi_china('2020-1-1','2020-10-1')
74
-
75
- cn_jp=compare_economy(['China','Japan'],'Currency Value','2000-1-1','2021-1-1')
76
- cn_us=compare_economy(['China','USA'],'Currency Value','1993-1-1','2021-1-1')
77
-
78
- jp_us=compare_economy(['Japan','USA'],'Currency Value','1993-1-1','2021-1-1')
79
- internal_growth_rate(cn_jp)
80
-
81
- cn_uk=compare_economy(['China','LIBOR'],'Immediate Rate','2000-1-1','2020-1-1')
82
-
83
- cn=economy_trend('2000-1-1','2020-8-31','China','Exchange Rate')
84
-
85
- cn=econ_fin_depth('2000-1-1','2020-6-30','China',power=3)
86
-
87
- cn=compare_economy(['China','USA'],'SMC to GDP','2000-1-1','2020-1-1')
88
-
89
- cn1=economy_security('China','1999-1-1','2019-12-31','GDP','000001.SS')
90
- cn2=economy_security('China','1999-1-1','2019-12-31','CNP GDP','000001.SS')
91
- cn3=economy_security('China','1999-1-1','2019-12-31','CNP GDP Per Capita','000001.SS')
92
- cn4=economy_security('China','1999-1-1','2019-12-31','GNI','000001.SS')
93
-
94
- df=get_econ_factors0(start,end,scope,factor)
95
-
96
-
97
- cn_usa=compare_economy(['China','USA'],'Currency Value','2010-1-1','2021-1-1')
98
- cn_jp=compare_economy(['China','Japan'],'Currency Value','2010-1-1','2021-5-25')
99
-
100
- cn_sg=compare_economy(['China','Korea'],'Currency Value','2010-1-1','2021-1-1')
101
- cn_sg=compare_economy(['China','Russia'],'Currency Value','2010-1-1','2021-1-1')
102
- cn_sg=compare_economy(['China','India'],'Currency Value','2010-1-1','2021-1-1')
103
-
104
-
105
- cn=compare_economy(['China','USA'],'GNP Ratio','1995-1-1','2010-1-1')
106
- cn_usa=compare_economy(['China','USA'],'GNP Ratio','1999-1-1','2019-1-1')
107
- cn_jp=compare_economy(['China','Japan'],'GNP Ratio','1999-1-1','2019-1-1')
108
- us_jp=compare_economy(['USA','Japan'],'GNP Ratio','1999-1-1','2019-1-1')
109
- cn_in=compare_economy(['China','India'],'GNP Ratio','1999-1-1','2020-1-1')
110
-
111
-
112
-
113
-
114
- cn=economy_trend('1990-1-1','2020-1-1','China','GNI',power=3)
115
- cn_gdp_gni=compare_economy('China',['GDP','GNI'],'1990-1-1','2020-1-1')
116
- cn_gdp_gni=compare_economy('China',['GDP','GNI'],'2010-1-1','2020-1-1',twinx=True)
117
-
118
-
119
- cn1=economy_security('China','1999-1-1','2019-12-31','GDP','000001.SS')
120
- cn2=economy_security('China','1999-1-1','2019-12-31','CNP GDP','000001.SS')
121
- cn2=economy_security('China','1999-1-1','2019-12-31','Constant GDP','000001.SS')
122
-
123
- cn3=economy_security('China','1999-1-1','2019-12-31','CNP GDP Per Capita','000001.SS')
124
- cn4=economy_security('China','1999-1-1','2019-12-31','GNI','000001.SS')
125
-
126
- jp1=economy_security('Japan','1980-1-1','2019-12-31','CNP GDP','^N225')
127
- us1=economy_security('USA','1980-1-1','2019-12-31','CNP GDP','^GSPC')
128
- us2=economy_security('USA','1980-1-1','2019-12-31','CNP GDP','^DJI')
129
-
130
-
131
- cn=econ_fin_depth('2000-1-1','2020-6-30','China',power=3)
132
- cn,jp=compare_efd('2000-1-1','2020-8-31',['China','Japan'])
133
- cn,kr=compare_efd('2000-1-1','2020-8-31',['China','Korea'])
134
- cn,us=compare_efd('2000-1-1','2020-8-31',['China','USA'])
135
-
136
- cn=compare_economy(['China','USA'],'SMC to GDP','2000-1-1','2020-1-1')
137
-
138
-
139
-
140
-
141
- cn_usa=compare_economy(['China','USA'],'CNP GDP Per Capita','2010-1-1','2020-1-1')
142
- cn_usa=compare_economy(['China','USA'],'CNP GDP Per Capita','2010-1-1','2020-1-1' ,twinx=True)
143
- internal_growth_rate(cn_usa)
144
-
145
- cn_jp=compare_economy(['China','Japan'],'CNP GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
146
- internal_growth_rate(cn_jp)
147
-
148
- cn_in=compare_economy(['China','India'],'CNP GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
149
- internal_growth_rate(cn_in)
150
-
151
- cn=economy_trend('2010-1-1','2021-5-25','China','Constant CPI',power=4)
152
-
153
- cn_usa=compare_economy(['China','USA'],'Constant CPI','2010-1-1','2021-5-25')
154
- internal_growth_rate(cn_usa)
155
-
156
- cn_jp=compare_economy(['China','Japan'],'Constant CPI','2010-1-1','2021-5-25')
157
- internal_growth_rate(cn_jp)
158
-
159
- cn_ru=compare_economy(['China','Russia'],'Constant CPI','2010-1-1','2020-1-1')
160
- internal_growth_rate(cn_ru)
161
-
162
- cn_in=compare_economy(['China','India'],'Constant CPI','2010-1-1','2020-1-1')
163
- internal_growth_rate(cn_in)
164
-
165
-
166
-
167
-
168
- c_cn=economy_trend('2010-1-1','2020-1-1','China','Constant GDP',power=3)
169
- internal_growth_rate(c_cn)
170
-
171
- usa_cn=compare_economy(['USA','China'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
172
- internal_growth_rate(usa_cn)
173
-
174
- jp_cn=compare_economy(['Japan','China'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
175
- internal_growth_rate(jp_cn)
176
-
177
- in_cn=compare_economy(['India','China'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
178
- internal_growth_rate(in_cn)
179
-
180
- cn_gdp_c=economy_trend('2010-1-1','2020-1-1','China','Constant GDP')
181
- internal_growth_rate(cn_gdp_c)
182
-
183
- cn_gdp_cp=economy_trend('2010-1-1','2020-1-1','China','GDP')
184
- internal_growth_rate(cn_gdp_cp)
185
-
186
-
187
- cn_gdp_cnp=economy_trend('2010-1-1','2020-1-1','China','CNP GDP')
188
- internal_growth_rate(cn_gdp_cnp)
189
-
190
-
191
-
192
-
193
- cn=economy_trend('2010-1-1','2020-1-1','China','GDP',power=3)
194
- internal_growth_rate(cn)
195
-
196
- cn_cnp=compare_economy('China',['GDP','CNP GDP'],'2010-1-1','2020-1-1',twinx=True)
197
- internal_growth_rate(cn_cnp)
198
-
199
- cn_cpi=compare_economy('China',['GDP','Constant CPI'],'2010-1-1','2020-1-1',power=4,twinx=True)
200
- internal_growth_rate(cn_cpi)
201
-
202
- cn_c=economy_trend('2010-1-1','2020-1-1','China','Constant GDP',power=4)
203
- internal_growth_rate(cn_c)
204
-
205
-
206
-
207
-
208
- cn_usa=compare_economy(['China','USA'],'Constant CPI','2010-1-1','2020-1-1')
209
- internal_growth_rate(cn_usa)
210
-
211
- cn=economy_trend('2010-1-1','2020-1-1','China','Constant CPI',power=4,zeroline=True)
212
- internal_growth_rate(cn)
213
-
214
-
215
- cn=economy_trend('2010-1-1','2020-1-1','China','MoM CPI',power=4,zeroline=True)
216
-
217
-
218
- cn_usa=compare_economy(['China','USA'],'Constant GDP','2010-1-1','2019-1-1',twinx=True)
219
- internal_growth_rate(cn_usa)
220
-
221
-
222
-
223
-
224
-
225
- cn_usa=compare_economy(['China','USA'],'Constant GDP Per Capita','2010-1-1','2020-1-1')
226
- internal_growth_rate(cn_usa)
227
-
228
- cn_jp=compare_economy(['China','Japan'],'Constant GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
229
- internal_growth_rate(cn_jp)
230
-
231
- cn_india=compare_economy(['China','India'],'Constant GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
232
- internal_growth_rate(cn_india)
233
-
234
- cn_usa=compare_economy(['China','USA'],'Constant CPI','2010-1-1','2020-1-1')
235
- internal_growth_rate(cn_usa)
236
-
237
- cn_jp=compare_economy(['China','Japan'],'Constant CPI','2010-1-1','2020-1-1')
238
- internal_growth_rate(cn_jp)
239
-
240
- cn_ru=compare_economy(['China','Russia'],'Constant CPI','2010-1-1','2020-1-1')
241
- internal_growth_rate(cn_ru)
242
-
243
- cn_in=compare_economy(['China','India'],'Constant CPI','2010-1-1','2020-1-1')
244
- internal_growth_rate(cn_in)
245
-
246
- cn=economy_trend('2010-1-1','2020-1-1','China','GDP',power=3)
247
- internal_growth_rate(cn)
248
-
249
- cn=compare_economy('China',['GDP','CNP GDP'],'2010-1-1','2020-1-1',twinx=True)
250
- internal_growth_rate(cn)
251
-
252
- cn=compare_economy('China',['GDP','Exchange Rate'],'2010-1-1','2020-8-31',twinx=True)
253
- internal_growth_rate(cn)
254
-
255
-
256
- cn=compare_economy(['China','USA'],'Immediate Rate','2000-1-1','2020-1-1')
257
- cn_jp=compare_economy(['China','Japan'],'Immediate Rate','2000-1-1','2020-1-1')
258
- cn_kr=compare_economy(['China','Korea'],'Immediate Rate','2000-1-1','2020-1-1')
259
- cn_uk=compare_economy(['China','LIBOR'],'Immediate Rate','2000-1-1','2020-1-1')
260
-
261
- cn=economy_trend('2000-1-1','2021-2-27','China','Exchange Rate')
262
- euro=economy_trend('2000-1-1','2020-8-30','Euro','Exchange Rate',power=4)
263
-
264
-
265
-
266
- cn1=compare_economy('China',['M0','M1'],'2000-1-1','2020-1-1')
267
- internal_growth_rate(cn1)
268
- df=economy_trend('2010-1-1','2020-1-1','China','M1',power=4)
269
-
270
- cn=compare_economy('China',['M1','M2'],'2000-1-1','2020-1-1')
271
- internal_growth_rate(cn)
272
-
273
- cn=compare_economy('China',['M2','M3'],'2000-1-1','2020-1-1')
274
- internal_growth_rate(cn)
275
-
276
- cn=compare_economy('Japan',['M2','M3'],'2000-1-1','2018-1-1')
277
- internal_growth_rate(cn)
278
-
279
- cn_usa=compare_economy(['China','USA'],'M2','2000-1-1','2020-1-1',twinx=True)
280
- internal_growth_rate(cn_usa)
281
-
282
- cn_jp=compare_economy(['China','Japan'],'M2','2000-1-1','2020-1-1',twinx=True)
283
- internal_growth_rate(cn_jp)
284
-
285
- cn_kr=compare_economy(['China','Korea'],'M2','2000-1-1','2020-1-1',twinx=True)
286
- internal_growth_rate(cn_kr)
287
-
288
-
289
- cn=economy_trend('2000-1-1','2020-1-1','China','Discount Rate',power=0)
290
-
291
-
292
-
293
-
294
-
295
-
296
- df=pmi_china('2020-1-1','2021-2-26')
297
-
298
- df=pmi_china('2019-1-1','2021-2-26')
299
-
300
- cn=economy_trend('2010-1-1','2020-1-1','China','MoM CPI',power=4,zeroline=True)
301
-
302
- cn=economy_trend('2010-1-1','2020-1-1','China','Constant CPI',power=4)
303
- cn=compare_economy(['China','USA'],'Constant CPI','2010-1-1','2020-1-1')
304
- cn=compare_economy(['China','Japan'],'Constant CPI','2010-1-1','2020-1-1')
305
- cn=compare_economy(['China','Russia'],'Constant CPI','2010-1-1','2020-1-1')
306
- cn=compare_economy(['China','India'],'Constant CPI','2010-1-1','2020-1-1')
307
-
308
- n=economy_trend('2010-1-1','2015-1-1','China','YoY PPI',power=4,zeroline=True)
309
- n=economy_trend('2010-1-1','2015-1-1','China','Constant PPI',power=4,zeroline=True)
310
-
311
-
312
-
313
-
314
- cn=economy_trend('2010-1-1','2020-1-1','China','GDP',power=3)
315
- cn=compare_economy('China',['GDP','CNP GDP'],'2010-1-1','2020-1-1',twinx=True)
316
-
317
- cn=compare_economy('China',['GDP','CPI'],'2010-1-1','2020-8-31',power=4,twinx=True)
318
-
319
- cn=compare_economy('China',['GDP','Exchange Rate'],'2010-1-1','2020-8-31',twinx=True)
320
-
321
- cn=economy_trend('2010-1-1','2020-1-1','China','Constant GDP',power=4)
322
-
323
- cn=compare_economy(['China','USA'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
324
-
325
- cn=compare_economy(['China','Japan'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
326
-
327
-
328
- cn=compare_economy(['China','India'],'Constant GDP','2010-1-1','2020-1-1',twinx=True)
329
-
330
- cn=compare_economy(['China','USA'],'Constant GDP Per Capita','2010-1-1','2020-1-1')
331
-
332
- cn=compare_economy(['China','USA'],'Constant GDP Per Capita','2010-1-1','2020-1-1' ,twinx=True)
333
-
334
- cn=compare_economy(['China','Japan'],'Constant GDP Per Capita','2010-1-1','2021-2-26',twinx=True)
335
- cn=compare_economy(['China','Japan'],'Constant GDP Per Capita','2010-1-1','2021-2-26')
336
- cn=economy_trend('2010-1-1','2020-1-1','China','Constant GDP Per Capita')
337
- cn=economy_trend('2010-1-1','2020-1-1','Japan','Constant GDP Per Capita')
338
- cn=economy_trend('2010-1-1','2020-1-1','USA','Constant GDP Per Capita')
339
-
340
- cn=compare_economy(['China','India'],'Constant GDP Per Capita','2010-1-1','2020-1-1',twinx=True)
341
-
342
- cn=compare_economy(['China','USA'],'GNP Ratio','1995-1-1','2010-1-1')
343
-
344
- cn=compare_economy(['China','Japan'],'GNP Ratio','1995-1-1','2010-1-1')
345
-
346
- cn=compare_economy(['USA','Japan'],'GNP Ratio','1995-1-1','2010-1-1')
347
- cn2=compare_economy(['USA','Japan'],'GNP Ratio','1995-1-1','2010-12-31')
348
-
349
-
350
-
351
-
352
- cn=compare_economy(['China','USA'],'GNP','1995-1-1','2020-1-1')
353
- cn=compare_economy(['China','Japan'],'GNP','1995-1-1','2010-1-1')
354
- cn=compare_economy(['USA','Japan'],'GNP','1995-1-1','2010-1-1')
355
-
356
-
357
- df=pmi_china('2020-1-5','2020-10-1')
358
-
359
- df=pmi_china('2019-1-5','2020-10-31')
360
-
siat/esg_test.py DELETED
@@ -1,63 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Spyder Editor
4
-
5
- This is a temporary script file.
6
- """
7
-
8
- import os; os.chdir("S:/siat")
9
-
10
- from siat.stock import *
11
- info=get_stock_profile("0700.HK",info_type='risk_esg')
12
- info=get_stock_profile("9988.HK",info_type='risk_esg')
13
- info=get_stock_profile("9618.HK",info_type='risk_esg')
14
- info=get_stock_profile("0992.HK",info_type='risk_esg')
15
- info=get_stock_profile("1398.HK",info_type='risk_esg')
16
- info=get_stock_profile("0939.HK",info_type='risk_esg')
17
- info=get_stock_profile("3988.HK",info_type='risk_esg')
18
- info=get_stock_profile("1288.HK",info_type='risk_esg')
19
- info=get_stock_profile("0857.HK",info_type='risk_esg')
20
- info=get_stock_profile("0005.HK",info_type='risk_esg')
21
- info=get_stock_profile("2888.HK",info_type='risk_esg')
22
- info=get_stock_profile("8306.T",info_type='risk_esg')
23
- info=get_stock_profile("8411.T",info_type='risk_esg')
24
- info=get_stock_profile("7182.T",info_type='risk_esg')
25
- info=get_stock_profile("UBSG.SW",info_type='risk_esg')
26
- info=get_stock_profile("BAC",info_type='risk_esg')
27
- info=get_stock_profile("TD",info_type='risk_esg')
28
- info=get_stock_profile("GS",info_type='risk_esg')
29
- info=get_stock_profile("MS",info_type='risk_esg')
30
- info=get_stock_profile("USB",info_type='risk_esg')
31
- info=get_stock_profile("PNC",info_type='risk_esg')
32
- info=get_stock_profile("BK",info_type='risk_esg')
33
- info=get_stock_profile("JPM",info_type='risk_esg')
34
-
35
- info=get_stock_profile("SLB",info_type='risk_esg')
36
- info=get_stock_profile("COP",info_type='risk_esg')
37
- info=get_stock_profile("HAL",info_type='risk_esg')
38
- info=get_stock_profile("OXY",info_type='risk_esg')
39
- info=get_stock_profile("FCX",info_type='risk_esg')
40
- info=get_stock_profile("5713.T",info_type='risk_esg')
41
- info=get_stock_profile("1605.T",info_type='risk_esg')
42
- info=get_stock_profile("5020.T",info_type='risk_esg')
43
- info=get_stock_profile("2330.TW",info_type='risk_esg')
44
- info=get_stock_profile("2317.TW",info_type='risk_esg')
45
- info=get_stock_profile("2474.TW",info_type='risk_esg')
46
- info=get_stock_profile("3008.TW",info_type='risk_esg')
47
- info=get_stock_profile("2454.TW",info_type='risk_esg')
48
-
49
- info=get_stock_profile("3988.HK",info_type='risk_esg')
50
- info=get_stock_profile("3988.HK",info_type='risk_esg')
51
- info=get_stock_profile("3988.HK",info_type='risk_esg')
52
- info=get_stock_profile("3988.HK",info_type='risk_esg')
53
- info=get_stock_profile("3988.HK",info_type='risk_esg')
54
- info=get_stock_profile("3988.HK",info_type='risk_esg')
55
- info=get_stock_profile("3988.HK",info_type='risk_esg')
56
- info=get_stock_profile("3988.HK",info_type='risk_esg')
57
- info=get_stock_profile("3988.HK",info_type='risk_esg')
58
- info=get_stock_profile("3988.HK",info_type='risk_esg')
59
- info=get_stock_profile("3988.HK",info_type='risk_esg')
60
- info=get_stock_profile("3988.HK",info_type='risk_esg')
61
- info=get_stock_profile("3988.HK",info_type='risk_esg')
62
- info=get_stock_profile("3988.HK",info_type='risk_esg')
63
- info=get_stock_profile("3988.HK",info_type='risk_esg')
siat/fama_french_test.py DELETED
@@ -1,115 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- import os; os.chdir("S:/siat")
4
- from siat import *
5
- #==================================================================
6
- ff3_betas=reg_ff3_betas("8146.HK",'2020-1-1','2021-10-30','China')
7
- ff3_betas=reg_ff3_betas("08146.HK",'2020-1-1','2021-10-30','China')
8
- ff3_betas=reg_ff3_betas("0886.HK",'2020-1-1','2021-10-30','China')
9
-
10
-
11
-
12
- from siat.fama_french import *
13
- #==================================================================
14
- ff3=get_ff_factors('2016-1-1','2020-12-31','Europe','FF3','yearly')
15
- mom=get_ff_factors('2016-1-1','2020-12-31','Europe','Mom','yearly')
16
-
17
- get_ffc4_factors('2016-1-1','2020-1-1','Europe','yearly')
18
- get_ffc4_factors('2016-1-1','2021-12-31','Europe','yearly')
19
-
20
- get_ffc4_factors('2016-1-1','2021-12-31','Japan','yearly')
21
- get_ffc4_factors('2016-1-1','2021-12-31','China','yearly')
22
- get_ffc4_factors('2016-1-1','2021-12-31','Global','yearly')
23
- get_ffc4_factors('2016-1-1','2021-12-31','Global_ex_US','yearly')
24
- get_ffc4_factors('2016-1-1','2021-12-31','North_America','yearly')
25
- #==================================================================
26
- get_ffc4_factors('2021-9-25','2021-9-30','US','daily')
27
- get_ffc4_factors('2021-4-1','2021-9-30','US','monthly')
28
- get_ffc4_factors('2016-1-1','2021-12-31','US','yearly')
29
- #==================================================================
30
- get_ffc4_factors('2021-8-25','2021-8-31','Japan','daily')
31
- ff3=get_ff_factors('2021-8-25','2021-8-31','Japan','FF3','daily')
32
- Mom=get_ff_factors('2021-8-25','2021-8-31','Japan','Mom','daily')
33
-
34
- get_ffc4_factors('2021-4-1','2021-9-30','Japan','monthly')
35
- ff3=get_ff_factors('2021-4-1','2021-9-30','Japan','FF3','monthly')
36
- ff3
37
- Mom=get_ff_factors('2021-4-1','2021-9-30','Japan','Mom','monthly')
38
- Mom
39
- #==================================================================
40
- get_ffc4_factors('2021-8-25','2021-8-31','Japan','daily')
41
- get_ffc4_factors('2021-4-1','2021-9-30','Japan','monthly')
42
- get_ffc4_factors('2016-1-1','2021-12-31','Japan','yearly')
43
- #==================================================================
44
- get_ffc4_factors('2021-8-25','2021-8-31','Europe','daily')
45
- get_ffc4_factors('2021-4-1','2021-9-30','Europe','monthly')
46
- get_ffc4_factors('2016-1-1','2021-12-31','Europe','yearly')
47
- #==================================================================
48
- get_ffc4_factors('2021-8-25','2021-8-31','China','daily')
49
- get_ffc4_factors('2021-4-1','2021-9-30','China','monthly')
50
- get_ffc4_factors('2016-1-1','2021-12-31','China','yearly')
51
- #==================================================================
52
- get_ffc4_factors('2018-8-25','2018-8-31','Global','daily')
53
- get_ffc4_factors('2018-4-1','2018-9-30','Global','monthly')
54
- get_ffc4_factors('2014-1-1','2021-12-31','Global','yearly')
55
- #==================================================================
56
-
57
-
58
-
59
- #==================================================================
60
- ff3_betas=reg_ff3_betas('AAPL','2018-1-1','2019-4-30','US')
61
- ff3_betas=reg_ff3_betas('BILI','2018-1-1','2019-4-30','US')
62
-
63
- ff3_betas=reg_ff3_betas('BMW.DE','2018-1-1','2019-4-30','Europe')
64
- ff3_betas=reg_ff3_betas('AEM','2018-3-1','2019-8-31','US')
65
-
66
- reg_ffc4_betas('JD','2018-1-1','2019-4-30','US')
67
- reg_ffc4_betas('BABA','2018-1-1','2019-4-30','US')
68
- reg_ffc4_betas('MSFT','2018-1-1','2019-4-30','US')
69
- reg_ffc4_betas('TAL','2018-1-1','2019-4-30','US')
70
-
71
- get_ff5_factors('2019-5-20','2019-5-31','US','daily')
72
- get_ff5_factors('2018-1-1','2019-4-30','US','monthly')
73
-
74
- reg_ff5_betas('PTR','2018-1-1','2019-4-30','US')
75
- reg_ff5_betas('QCOM','2018-1-1','2019-4-30','US')
76
-
77
-
78
- try:
79
- factor_df=ds[seq]
80
- except:
81
- extract_DESCR(ds)
82
-
83
-
84
- def extract_DESCR(ds):
85
- """
86
- 归纳:从字典的DESCR中提取年度因子信息 ,用于seq缺失1但误放置在DESCR中的情形
87
- """
88
- descr_str=factor_df=ds['DESCR']
89
- wml_pos=descr_str.find("WML")
90
- nn_pos=descr_str.find("\n\n ")
91
- wml_post=descr_str[wml_pos+4:nn_pos]
92
- wml_post1=wml_post.replace(' ,',',')
93
- wml_post2=wml_post1.replace(' ,',',')
94
- wml_post3=wml_post2+' '
95
-
96
- #正则表达式提取配对
97
- import re
98
- wml_post_list=re.findall(r"(.+?),(.+?) ", wml_post3)
99
-
100
- import pandas as pd
101
- df = pd.DataFrame(columns=('Date', 'Mom'))
102
- for i in wml_post_list:
103
- #print(i[0],i[1])
104
- s = pd.Series({'Date':i[0], 'Mom':float(i[1])})
105
- # 这里 Series 必须是 dict-like 类型
106
- df = df.append(s, ignore_index=True)
107
- # 这里必须选择ignore_index=True 或者给 Series一个index值
108
- df.set_index('Date',drop=True, inplace=True)
109
-
110
- return df
111
-
112
-
113
-
114
-
115
-
@@ -1,31 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Created on Fri Sep 25 22:49:18 2020
4
-
5
- @author: Peter
6
- """
7
-
8
- import os; os.chdir("S:/siat")
9
- from siat.financial_statements import *
10
-
11
-
12
- bs=get_balance_sheet('0883.HK')
13
- infot=info.T
14
-
15
- info=get_balance_sheet('PDD')
16
- infot=info.T
17
- cr=compare_history(['BABA','PDD'],'Quick Ratio')
18
-
19
- #==============================================================================
20
- info=get_income_statements('MST')
21
- info=get_income_statements('MDT')
22
-
23
- info=get_cashflow_statements('MDT')
24
- info=get_cashflow_statements('MST')
25
-
26
- info=get_balance_sheet('MST')
27
- info=get_balance_sheet('MDT')
28
- info=get_balance_sheet('MSFT')
29
-
30
- info=get_financial_statements('MDT')
31
- info=get_financial_statements('MST')