siat 3.10.125__py3-none-any.whl → 3.10.127__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.127.dist-info}/METADATA +235 -226
  7. siat-3.10.127.dist-info/RECORD +76 -0
  8. {siat-3.10.125.dist-info → siat-3.10.127.dist-info}/WHEEL +1 -1
  9. {siat-3.10.125.dist-info → siat-3.10.127.dist-info/licenses}/LICENSE +0 -0
  10. {siat-3.10.125.dist-info → siat-3.10.127.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/stock_test.py DELETED
@@ -1,487 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- import os; os.chdir("S:/siat")
4
- from siat import *
5
- #==============================================================================
6
- # AMZN, EBAY, SHOP, BABA, JD
7
- tickers=["AMZN","EBAY","SHOP","BABA","JD"]
8
- measure="Annual Ret%"
9
- start="2022-1-1"
10
- end="2022-7-31"
11
-
12
- pair=tickers[0:2]
13
- df12=compare_security(pair,measure,start,end)
14
- df1=df12[0]
15
- colname=list(df1)[0]
16
- df1.rename(columns={colname:codetranslate(tickers[0])},inplace=True)
17
- df2=df12[1]
18
- df2.rename(columns={colname:codetranslate(tickers[1])},inplace=True)
19
-
20
- pair=tickers[2:4]
21
- df34=compare_security(pair,measure,start,end)
22
- df3=df34[0]
23
- df3.rename(columns={colname:codetranslate(tickers[2])},inplace=True)
24
- df4=df34[1]
25
- df4.rename(columns={colname:codetranslate(tickers[3])},inplace=True)
26
-
27
- pair=[tickers[4],tickers[4]]
28
- df56=compare_security(pair,measure,start,end)
29
- df5=df56[0]
30
- df5.rename(columns={colname:codetranslate(tickers[4])},inplace=True)
31
-
32
- dflist=[df1,df2,df3,df4,df5]
33
- import pandas as pd
34
- from functools import reduce
35
- dfs=reduce(lambda left,right:pd.merge(left,right,left_index=True,right_index=True),dflist)
36
-
37
- y_label=measure
38
- import datetime; today = datetime.date.today()
39
- x_label=texttranslate("数据来源: 新浪/stooq,")+' '+str(today)
40
- axhline_value=0
41
- axhline_label=''
42
- title_txt="Compare Multiple Securities Performance"
43
- draw_lines(dfs,y_label,x_label,axhline_value,axhline_label,title_txt, \
44
- data_label=False,resample_freq='H',smooth=True)
45
-
46
-
47
- def compare_msecurity(tickers,measure,start,end,axhline_value=0,axhline_label=''):
48
- """
49
- 功能:比较并绘制多条证券指标曲线(多于2条),个数可为双数或单数
50
- 注意:
51
- tickers中须含有2个及以上股票代码,
52
- measure为单一指标,
53
- axhline_label不为空时绘制水平线
54
- """
55
- num=len(tickers)
56
- if num <=2:
57
- print(" #Error(compare_msecurity): need more tickers")
58
- return None
59
-
60
- if not isinstance(measure,str):
61
- print(" #Error(compare_msecurity): support only one measure")
62
- return None
63
-
64
- #循环获取证券指标
65
- loopn=int(len(tickers)/2)
66
- colname=''
67
- import pandas as pd
68
- dfs=pd.DataFrame()
69
- from functools import reduce
70
- for i in range(0,loopn):
71
- pair=tickers[i*2:i*2+2]
72
- #print(i,pair)
73
-
74
- dfi=compare_security(pair,measure,start,end,graph=False)
75
-
76
- dfi1=dfi[0]
77
- if colname == '':
78
- colname=list(dfi1)[0]
79
- dfi1.rename(columns={colname:codetranslate(tickers[i*2])},inplace=True)
80
-
81
- dfi2=dfi[1]
82
- dfi2.rename(columns={colname:codetranslate(tickers[i*2+1])},inplace=True)
83
-
84
- if len(dfs) == 0:
85
- dflist=[dfi1,dfi2]
86
- else:
87
- dflist=[dfs,dfi1,dfi2]
88
- dfs=reduce(lambda left,right:pd.merge(left,right,left_index=True,right_index=True),dflist)
89
-
90
- #判断奇偶数
91
- if (num % 2) == 0:
92
- even=True
93
- else:
94
- even=False
95
- i=loopn
96
- if not even:
97
- pair=[tickers[num-1],tickers[num-1]]
98
- dfi=compare_security(pair,measure,start,end,graph=False)
99
-
100
- dfi1=dfi[0]
101
- dfi1.rename(columns={colname:codetranslate(tickers[i*2])},inplace=True)
102
-
103
- dflist=[dfs,dfi1]
104
- dfs=reduce(lambda left,right:pd.merge(left,right,left_index=True,right_index=True),dflist)
105
-
106
- #绘制多条曲线
107
- y_label=measure
108
- import datetime; today = datetime.date.today()
109
- x_label=texttranslate("数据来源: 新浪/stooq,")+' '+str(today)
110
- axhline_value=0
111
- axhline_label=''
112
- title_txt=texttranslate("Compare Multiple Securities Performance")
113
- draw_lines(dfs,y_label,x_label,axhline_value,axhline_label,title_txt, \
114
- data_label=False,resample_freq='H',smooth=True)
115
-
116
- return dfs
117
-
118
-
119
- #==============================================================================
120
- tickers1=["AMZN","EBAY","SHOP","BABA","JD"]
121
- tickers2=["AMZN","EBAY","SHOP","BABA","JD","PDD"]
122
- measure1="Annual Ret%"
123
- measure2="Exp Ret%"
124
- start="2022-1-1"
125
- end="2022-7-31"
126
- df=compare_msecurity(tickers1,measure1,start,end)
127
- df=compare_msecurity(tickers1,measure2,start,end)
128
-
129
- df=compare_msecurity(tickers2,measure1,start,end)
130
- df=compare_msecurity(tickers2,measure2,start,end)
131
- #==============================================================================
132
-
133
- check_language()
134
-
135
- info=get_stock_profile("AAPL","all")
136
-
137
- info=get_stock_profile("momo","all")
138
-
139
-
140
-
141
- #==============================================================================
142
- price=security_price('AAPL','2022-6-1','2022-6-30')
143
-
144
- moutai=security_price('600519.SH','2022-6-1','2022-6-30')
145
-
146
-
147
- #==============================================================================
148
- info=get_stock_profile("AAPL")
149
- info=get_stock_profile("AAPL",info_type='officers')
150
- info=get_stock_profile("AAPL",info_type='market_rates')
151
- info=get_stock_profile("AAPL",info_type='fin_rates')
152
-
153
- div=stock_dividend('600519.SS','2011-1-1','2020-12-31')
154
-
155
- split=stock_split('600519.SS','1990-1-1','2022-12-31')
156
-
157
- # Define names of companies for comparison
158
- tickers=['AMZN','EBAY','SHOP','MELI','BABA','JD','VIPS','PDD']
159
- # Comparing company performance
160
- roa=compare_snapshot(tickers,'ROA',axisamp=1.2)
161
-
162
- #==============================================================================
163
- df=get_price('600519.SS','2022-1-1','2022-5-11')
164
- dfoc=df[['Open','Close']]
165
-
166
- import pandas_alive
167
- dfoc_alive=dfoc.sum(axis = 1).fillna(0).plot_animated(filename = 'bar-chart .gif',kind = 'line', \
168
- period_label = { 'x':0.1,'y':0.9 }, \
169
- steps_per_period = 2,interpolate_period = True,period_length = 200)
170
-
171
- dfoc_alive=dfoc.plot_animated(filename = 'line_chart.gif',kind = 'line',period_label = { 'x':0.25,'y':0.9 })
172
-
173
-
174
-
175
-
176
- #==============================================================================
177
- df=compare_stock(["JD", "BABA"], "Annual Price Volatility", "2020-1-1", "2020-12-31")
178
- df=compare_stock(["AAPL", "MSFT"], "Annual Ret Volatility%", "2020-1-1", "2020-12-31")
179
- df=compare_stock(["FB", "MSFT"], "Annual Ret LPSD%", "2020-1-1", "2020-12-31")
180
-
181
-
182
-
183
-
184
- #==============================================================================
185
- df=compare_stock("AAPL", ["Annual Ret%", "Daily Ret%"], "2021-10-1", "2021-12-31")
186
-
187
- df=compare_stock(["000002.SZ", "600266.SS"], "Annual Ret%", "2021-1-1", "2021-6-30",loc1="lower right")
188
-
189
- df=compare_stock(["JD", "AMZN"], "Exp Ret%", "2020-1-1", "2020-12-31")
190
- #==============================================================================
191
-
192
- df1,df2=compare_security(['^XU100','000300.SS'],'Exp Ret','2021-7-1','2021-12-31')
193
- df1,df3=compare_security(['^XU100','^GSPC'],'Exp Ret','2021-7-1','2021-12-31')
194
-
195
- #==============================================================================
196
- info=get_stock_profile("FIBI.TA", info_type='officers')
197
- info=get_stock_profile("TSLA", info_type='officers')
198
-
199
- df=security_price('000300.SS','2014-1-1','2016-12-31',power=6)
200
- #==============================================================================
201
- # This trick does not work any more
202
- import io
203
- import pandas
204
- from datetime import datetime
205
- import requests
206
-
207
- class YahooData:
208
- def fetch(ticker, start, end):
209
- headers = {
210
- 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9'
211
- }
212
-
213
- url = "https://query1.finance.yahoo.com/v7/finance/download/" + str(ticker)
214
- x = int(datetime.strptime(start, '%Y-%m-%d').strftime("%s"))
215
- y = int(datetime.strptime(end, '%Y-%m-%d').strftime("%s"))
216
- url += "?period1=" + str(x) + "&period2=" + str(y) + "&interval=1d&events=history&includeAdjustedClose=true"
217
-
218
- r = requests.get(url, headers=headers)
219
- pd = pandas.read_csv(io.StringIO(r.text), index_col=0, parse_dates=True)
220
-
221
- return pd
222
-
223
- df = YahooData.fetch("TSLA", start="2021-01-01", end="2021-12-31")
224
- print(df)
225
-
226
- #==============================================================================
227
- # This trick does not work any more
228
- import pandas
229
- from pandas_datareader import data as pdr
230
- import yfinance as yfin
231
- yfin.pdr_override()
232
-
233
- df = pdr.get_data_yahoo("TSLA", start="2021-07-01", end="2021-07-14")
234
- df2 = pdr.get_data_yahoo("TSLA", start="2021-7-1", end="2021-7-14")
235
- print(df)
236
- #==============================================================================
237
- # This trick does not work any more
238
- import numpy as np
239
- import pandas as pd
240
- import requests
241
- from datetime import datetime, timedelta, date
242
-
243
-
244
- result = requests.get('https://query1.finance.yahoo.com/v7/finance/download/BABA?period1=000000001&period2=9999999999&interval=1d&events=history&includeAdjustedClose=true')
245
-
246
- f = open('file.csv', "w")
247
- f.write(result.text)
248
- f.close()
249
-
250
- df_daten = pd.read_csv('file.csv')
251
- df_daten["Date"]= pd.to_datetime(df_daten["Date"])
252
- df_daten.set_index('Date', inplace=True)
253
-
254
- start_remove = pd.to_datetime('2001-1-1')
255
- end_remove = pd.to_datetime('2021-7-1')
256
- df_neu = df_daten.query('Date < @start_remove or Date > @end_remove')
257
-
258
- #==============================================================================
259
- p=security_price("BB","2015-1-10","2015-1-20")
260
- p=security_price("LLY","2000-3-1","2003-12-31")
261
-
262
-
263
- #==============================================================================
264
- compare_stock(["000001.SS","399001.SZ"], "Close", "2010-1-1", "2021-5-29",twinx=True)
265
- compare_stock(["000300.SS","000001.SS"], "Close", "2010-1-1", "2021-5-29",twinx=True)
266
-
267
- compare_stock(["^HSI","000001.SS"], "Close", "2010-1-1", "2021-5-29",twinx=True)
268
- compare_stock(["^N225","000001.SS"], "Close", "2010-1-1", "2021-5-29",twinx=True)
269
- compare_stock(["^KS11","000001.SS"], "Close", "2010-1-1", "2021-5-29",twinx=True)
270
- compare_stock(["^GSPC","000001.SS"], "Close", "2010-1-1", "2021-5-29",twinx=True)
271
- compare_stock(["^DJI","^GSPC"], "Close", "2010-1-1", "2021-5-29",twinx=True)
272
-
273
-
274
- compare_stock(["600583.SS","601808.SS"], "Close", "2021-1-1", "2021-5-29")
275
- compare_stock(["600583.SS","600968.SS"], "Close", "2021-1-1", "2021-5-29")
276
- #==============================================================================
277
- fr1=get_stock_profile("0883.HK",info_type='fin_rates')
278
- fr2=get_stock_profile("0857.HK",info_type='fin_rates')
279
-
280
- fr1=get_stock_profile("1033.HK",info_type='fin_rates')
281
- fr2=get_stock_profile("2883.HK",info_type='fin_rates')
282
- fr3=get_stock_profile("SLB",info_type='fin_rates')
283
- fr4=get_stock_profile("2222.SR",info_type='fin_rates')
284
- fr5=get_stock_profile("HAL",info_type='fin_rates')
285
-
286
- info=get_stock_profile("AAPL",info_type='fin_rates')
287
- info=get_stock_profile("AAPL",info_type='market_rates')
288
- info=get_stock_profile("MSFT",info_type='fin_rates')
289
- fs=get_stock_profile("AAPL",info_type='fin_statements')
290
- #==============================================================================
291
- compare_stock(["0883.HK","0857.HK"], "Close", "2010-1-1", "2021-5-18")
292
- compare_stock(["0883.HK","0857.HK"], "Annual Ret%", "2010-1-1", "2021-5-18")
293
- compare_stock(["0883.HK","0857.HK"], "Exp Ret%", "2010-1-1", "2021-5-18")
294
- compare_stock(["0883.HK","0857.HK"], "Annual Ret Volatility%", "2010-1-1", "2021-5-18")
295
- compare_stock(["0883.HK","0857.HK"], "Exp Ret Volatility%", "2010-1-1", "2021-5-18")
296
-
297
- from siat.financials import *
298
- compare_history(["0883.HK","0857.HK"], "Cashflow per Share")
299
-
300
- tickers=["0883.HK","0857.HK","0386.HK",'XOM','2222.SR','OXY','BP','RDSA.AS']
301
- cr=compare_snapshot(tickers,'Current Ratio')
302
- pbr=compare_snapshot(tickers,'Price to Book')
303
- atr=compare_tax(tickers)
304
- emp=compare_snapshot(tickers,'Employees')
305
- esg=compare_snapshot(tickers,'Total ESG')
306
-
307
- tickers2=["0883.HK","0857.HK","0386.HK",'1024.HK','1810.HK','9988.HK','9618.HK','0700.HK']
308
- cfps=compare_snapshot(tickers2,'Cashflow per Share')
309
-
310
-
311
- from siat.beta_adjustment import *
312
- atr=prepare_hamada_yahoo('XOM')
313
-
314
- compare_stock(["000001.SS","^HSI"], "Close", "2010-1-1", "2021-5-18",twinx=True)
315
- compare_stock(["000001.SS","^HSI"], "Exp Ret%", "2021-1-1", "2021-5-18")
316
- compare_stock(["000001.SS","^HSI"], "Exp Ret Volatility%", "2021-1-1", "2021-5-18")
317
-
318
- gg_cnooc=get_stock_profile("0883.HK",info_type='officers')
319
- gg_sinopec=get_stock_profile("0386.HK",info_type='officers')
320
- gg_slb=get_stock_profile('RDSA.AS',info_type='officers')
321
- #==============================================================================
322
- compare_stock(["FB", "MSFT"], "Annual Ret LPSD%", "2019-1-1", "2019-12-31")
323
- compare_stock(["FB", "MSFT"], "Exp Ret LPSD%", "2019-1-1", "2019-12-31")
324
-
325
- #==============================================================================
326
- price=stock_price("600519.SS","2020-6-10","2020-7-10")
327
-
328
- compare_stock("MSFT", ["Open", "Close"], "2020-3-16", "2020-3-31")
329
- price = stock_price("GOOG", "2019-7-1", "2019-12-31")
330
-
331
- prices = compare_stock(["DAI.DE","BMW.DE"], "Close", "2020-1-1", "2020-3-31")
332
- compare_stock("7203.T", ["High", "Low"], "2020-3-1", "2020-3-31")
333
-
334
- compare_stock(["FB", "TWTR"], "Daily Ret%", "2020-3-1", "2020-3-31")
335
- compare_stock("CDI.PA", ["Daily Ret", "log(Daily Ret)"], "2020-1-1", "2020-3-31")
336
-
337
- compare_stock("IBM", ["Annual Ret%", "Daily Ret%"], "2019-1-1", "2019-12-31")
338
-
339
- compare_stock(["000002.SZ", "600266.SS"], "Annual Ret%", "2020-1-1", "2020-3-31")
340
- compare_stock(["BABA", "JD"], "Annual Ret%", "2020-1-1", "2020-3-31")
341
- compare_stock(["0700.HK", "1810.HK"], "Annual Ret%", "2019-10-1", "2019-12-31")
342
- compare_stock(["MSFT", "AAPL"], "Annual Ret%", "2019-1-1", "2020-3-31")
343
-
344
- info=stock_ret("MSFT", "2010-1-1", "2020-12-31", type="Exp Ret%")
345
- compare_stock(["JD", "AMZN"], "Exp Adj Ret%", "2019-1-1", "2020-12-31")
346
-
347
- pv=stock_price_volatility("000002.SZ", "2019-1-1", "2020-12-31", "Weekly Price Volatility")
348
- pv=stock_price_volatility("000002.SZ", "2019-1-1", "2020-12-31", "Annual Price Volatility")
349
- compare_stock(["JD", "BABA"], "Annual Price Volatility", "2019-1-1", "2019-12-31")
350
-
351
- compare_stock(["JD", "BABA"], "Exp Price Volatility", "2019-1-1", "2019-12-31")
352
-
353
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Weekly Ret Volatility%")
354
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Annual Ret Volatility%",power=0)
355
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Exp Ret Volatility%")
356
-
357
- compare_stock(["AAPL", "MSFT"], "Annual Ret Volatility%", "2019-1-1", "2019-12-31")
358
-
359
- compare_stock(["AAPL", "MSFT"], "Exp Ret Volatility%", "2019-1-1", "2019-12-31")
360
-
361
- compare_stock("QCOM", ["Annual Ret LPSD%", "Annual Ret Volatility%"], "2019-1-1", "2019-12-31")
362
-
363
- compare_stock("QCOM", ["Exp Ret LPSD%", "Exp Ret Volatility%"], "2019-1-1", "2019-12-31")
364
-
365
- compare_stock("QCOM", ["Exp Ret LPSD%", "Exp Ret%"], "2019-1-1", "2019-12-31")
366
-
367
- compare_stock(["FB", "MSFT"], "Annual Ret LPSD%", "2019-1-1", "2019-12-31")
368
-
369
- #==============================================================================
370
- price = stock_price("GOOG", "2019-7-1", "2019-12-31")
371
- prices = compare_stock(["DAI.DE","BMW.DE"], "Close", "2020-1-1", "2020-3-31")
372
- info=candlestick_demo("005930.KS", "2020-1-13", "2020-1-17")
373
- info=candlestick("TCS.NS", "2020-3-1", "2020-3-31")
374
- info=candlestick("0700.HK","2020-2-1","2020-3-31",mav=2,volume=True,style='blueskies')
375
-
376
- compare_stock(["FB", "TWTR"], "Daily Ret%", "2020-3-1", "2020-3-31")
377
-
378
- compare_stock("UBSG.SW", ["Daily Ret", "log(Daily Ret)"], "2020-1-1", "2020-1-10")
379
- compare_stock("CDI.PA", ["Daily Ret", "log(Daily Ret)"], "2020-1-1", "2020-3-31")
380
-
381
- compare_stock("IBM", ["Annual Ret%", "Daily Ret%"], "2019-1-1", "2019-12-31")
382
- compare_stock(["000002.SZ", "600266.SS"], "Annual Ret%", "2020-1-1", "2020-3-31")
383
- compare_stock(["BABA", "JD"], "Annual Ret%", "2020-1-1", "2020-3-31")
384
- compare_stock(["0700.HK", "1810.HK"], "Annual Ret%", "2019-10-1", "2019-12-31")
385
- compare_stock(["MSFT", "AAPL"], "Annual Ret%", "2019-1-1", "2020-3-31")
386
-
387
- info=stock_ret("MSFT", "2010-1-1", "2020-12-31", type="Exp Ret%")
388
-
389
- compare_stock(["JD", "AMZN"], "Exp Adj Ret%", "2019-1-1", "2020-12-31")
390
-
391
-
392
- pv=stock_price_volatility("000002.SZ", "2019-1-1", "2020-12-31", "Weekly Price Volatility")
393
- pv=stock_price_volatility("000002.SZ", "2019-1-1", "2020-12-31", "Annual Price Volatility")
394
-
395
- compare_stock(["JD", "BABA"], "Annual Price Volatility", "2019-1-1", "2019-12-31")
396
-
397
- compare_stock(["JD", "BABA"], "Exp Price Volatility", "2019-1-1", "2019-12-31")
398
-
399
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Weekly Ret Volatility%")
400
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Annual Ret Volatility%")
401
- info=stock_ret_volatility("AAPL", "2019-1-1", "2019-12-31", "Exp Ret Volatility%")
402
-
403
- compare_stock(["AAPL", "MSFT"], "Annual Ret Volatility%", "2019-1-1", "2019-12-31")
404
- compare_stock(["AAPL", "MSFT"], "Exp Ret Volatility%", "2019-1-1", "2019-12-31")
405
-
406
- compare_stock("QCOM", ["Annual Ret LPSD%", "Annual Ret Volatility%"], "2019-1-1", "2019-12-31")
407
- compare_stock("QCOM", ["Exp Ret LPSD%", "Exp Ret Volatility%"], "2019-1-1", "2019-12-31")
408
- compare_stock("QCOM", ["Exp Ret LPSD%", "Exp Ret%"], "2019-1-1", "2019-12-31")
409
-
410
- compare_stock(["FB", "MSFT"], "Annual Ret LPSD%", "2019-1-1", "2019-12-31")
411
-
412
-
413
- #==============================================================================
414
- dfr=stock_ret('AAPL','2020-1-1','2021-4-8',type="Daily Adj Ret%")
415
-
416
-
417
- compare_stock(["000002.SZ", "600266.SS"], "Annual Ret%", "2020-1-1", "2020-3-31")
418
- compare_stock(["BABA", "JD"], "Annual Ret%", "2020-1-1", "2020-3-31")
419
- compare_stock(["0700.HK", "1810.HK"], "Annual Ret%", "2020-1-1", "2020-3-31")
420
- compare_stock(["MSFT", "AAPL"], "Annual Ret%", "2019-1-1", "2020-3-31")
421
-
422
- info=stock_ret("MSFT", "2010-1-1", "2020-3-31", type="Exp Ret%")
423
-
424
-
425
-
426
-
427
- #==============================================================================
428
- vix=security_price("^VIX", "2020-1-1", "2021-3-31",power=15)
429
- vix=security_price("^VIX", "2021-1-1", "2021-3-31",power=10)
430
-
431
- compare_security(['^VIX','^GSPC'],'Close','2011-1-1','2020-12-31',twinx=True)
432
-
433
-
434
- compare_stock("AAPL", ["Close", "Adj Close"], "2019-1-1", "2019-12-31")
435
- compare_stock("000002.SZ", ["Close", "Adj Close"], "2019-1-1", "2019-7-31")
436
-
437
-
438
-
439
- pricedf=get_price('^HSI',"1991-1-1","2021-2-28")
440
-
441
-
442
- df=security_price('AAPL','2021-1-1','2021-1-31',datatag=True,power=4)
443
-
444
- info=get_stock_profile("AAPL")
445
- info=get_stock_profile("MSFT",info_type='officers')
446
- info=get_stock_profile("AAPL",info_type='officers')
447
- info=stock_info('AAPL')
448
- sub_info=stock_officers(info)
449
-
450
- div=stock_dividend('600519.SS','2011-1-1','2020-12-31')
451
- split=stock_split('600519.SS','2000-1-1','2020-12-31')
452
-
453
- ticker='AAPL'
454
- info=stock_info(ticker)
455
- info=get_stock_profile("AAPL",info_type='officers')
456
-
457
- info=get_stock_profile("AAPL")
458
-
459
- info=get_stock_profile("MSFT",info_type='officers')
460
- info=get_stock_profile("GS",info_type='officers')
461
-
462
- info=stock_info('JD')
463
- sub_info=stock_officers(info)
464
- info=get_stock_profile("JD",info_type='officers')
465
-
466
- info=stock_info('BABA')
467
- sub_info=stock_officers(info)
468
- info=get_stock_profile("BABA",info_type='officers')
469
-
470
- info=stock_info('0700.HK')
471
- sub_info=stock_officers(info)
472
- info=get_stock_profile("0700.HK",info_type='officers')
473
-
474
- info=stock_info('600519.SS')
475
- sub_info=stock_officers(info)
476
- info=get_stock_profile("600519.SS",info_type='officers')
477
-
478
- info=get_stock_profile("0939.HK",info_type='risk_esg')
479
-
480
-
481
- market={'Market':('China','^HSI')}
482
- stocks={'0700.HK':3,'9618.HK':2,'9988.HK':1}
483
- portfolio=dict(market,**stocks)
484
- esg=portfolio_esg2(portfolio)
485
-
486
-
487
-
siat/temp.py DELETED
@@ -1,36 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
- import os;os.chdir("S:/siat")
5
- from siat import *
6
-
7
- if __name__ =="__main__":
8
- start='2000-1-1'; end='2022-10-9'
9
- measures=['pe','pb']; methods='lyr'; values='value'; statistics='median'
10
- df1,df2=valuation_market_china(start,end,measures=['pe','pb'],methods='lyr',values='value',statistics='median')
11
-
12
- df1,df2=valuation_market_china(start,end,measures=['pe','pb'],methods='lyr', \
13
- values='value',statistics='median', \
14
- loc1='upper left',loc2='upper right')
15
-
16
-
17
- df1,df2=valuation_market_china(start,end,measures=['pe'],methods='lyr', \
18
- values='value',statistics='median', \
19
- loc1='upper left',loc2='upper right')
20
-
21
-
22
- df1,df2=valuation_market_china(start,end,measures=['pe'],methods=['ttm','lyr'], \
23
- values='value',statistics='median', \
24
- loc1='upper left',loc2='upper right')
25
-
26
- df1,df2=valuation_market_china(start,end,measures=['pe'],methods=['ttm'], \
27
- values=['value','quantile'],statistics='median', \
28
- loc1='upper left',loc2='upper right')
29
-
30
-
31
- df1,df2=valuation_market_china(start,end,measures=['pe'],methods=['ttm'], \
32
- values=['value'],statistics=['median','equal-weighted'], \
33
- loc1='upper left',loc2='upper right')
34
-
35
-
36
-