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.
- siat/common.py +106 -2
- siat/exchange_bond_china.pickle +0 -0
- siat/fund_china.pickle +0 -0
- siat/stock.py +10 -2
- siat/stock_info.pickle +0 -0
- {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/METADATA +234 -226
- siat-3.10.126.dist-info/RECORD +76 -0
- {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/WHEEL +1 -1
- {siat-3.10.125.dist-info → siat-3.10.126.dist-info/licenses}/LICENSE +0 -0
- {siat-3.10.125.dist-info → siat-3.10.126.dist-info}/top_level.txt +0 -0
- siat/__init__ -20240701.py +0 -65
- siat/__init__.py.backup_20250214.py +0 -73
- siat/alpha_vantage_test.py +0 -24
- siat/assets_liquidity_test.py +0 -44
- siat/barrons_scraping_test.py +0 -276
- siat/beta_adjustment_test.py +0 -77
- siat/bond_test.py +0 -142
- siat/capm_beta_test.py +0 -49
- siat/cmat_commons.py +0 -961
- siat/compare_cross_test.py +0 -117
- siat/concepts_iwencai.py +0 -86
- siat/concepts_kpl.py +0 -93
- siat/cryptocurrency_test.py +0 -71
- siat/derivative.py +0 -1111
- siat/economy-20230125.py +0 -1206
- siat/economy_test.py +0 -360
- siat/esg_test.py +0 -63
- siat/fama_french_test.py +0 -115
- siat/financial_statements_test.py +0 -31
- siat/financials2 - /321/205/320/231/320/277/321/206/320/254/320/274.py" +0 -341
- siat/financials_china2_test.py +0 -67
- siat/financials_china2_test2.py +0 -88
- siat/financials_china2_test3.py +0 -87
- siat/financials_china_test.py +0 -475
- siat/financials_china_test2.py +0 -197
- siat/financials_china_test2_fin_indicator.py +0 -197
- siat/financials_test.py +0 -713
- siat/fred_test.py +0 -40
- siat/fund_china_test.py +0 -175
- siat/fund_test.py +0 -40
- siat/future_china_test.py +0 -37
- siat/global_index_test.py +0 -66
- siat/grafix_test.py +0 -112
- siat/holding_risk_test.py +0 -13
- siat/local_debug_test.py +0 -100
- siat/markowitz2-20240620.py +0 -2614
- siat/markowitz_ccb_test.py +0 -37
- siat/markowitz_ef_test.py +0 -136
- siat/markowitz_old.py +0 -871
- siat/markowitz_simple-20230709.py +0 -370
- siat/markowitz_test.py +0 -164
- siat/markowitz_test2.py +0 -69
- siat/ml_cases_example1.py +0 -60
- siat/option_china_test.py +0 -447
- siat/option_pricing_test.py +0 -81
- siat/option_sina_api_test.py +0 -112
- siat/proxy_test.py +0 -84
- siat/quandl_test.py +0 -39
- siat/risk_adjusted_return_test.py +0 -81
- siat/risk_evaluation_test.py +0 -96
- siat/risk_free_rate_test.py +0 -127
- siat/sector_china_test.py +0 -203
- siat/security_price.py +0 -831
- siat/security_prices_test.py +0 -310
- siat/security_trend2-20240620.py +0 -493
- siat/setup.py +0 -41
- siat/shenwan index history test.py +0 -41
- siat/stock_china_test.py +0 -38
- siat/stock_info_test.py +0 -189
- siat/stock_list_china_test.py +0 -33
- siat/stock_technical-20240620.py +0 -2736
- siat/stock_test.py +0 -487
- siat/temp.py +0 -36
- siat/test2_graphviz.py +0 -484
- siat/test_graphviz.py +0 -411
- siat/test_markowitz_simple.py +0 -198
- siat/test_markowitz_simple_revised.py +0 -215
- siat/test_markowitz_simple_revised2.py +0 -218
- siat/transaction_test.py +0 -436
- siat/translate-20230125.py +0 -2107
- siat/translate-20230206.py +0 -2109
- siat/translate-20230215.py +0 -2158
- siat/translate_20240606.py +0 -4206
- siat/translate_241003_keep.py +0 -4300
- siat/universal_test.py +0 -100
- siat/valuation_market_china_test.py +0 -36
- siat-3.10.125.dist-info/RECORD +0 -152
siat/common.py
CHANGED
@@ -4937,7 +4937,7 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
|
|
4937
4937
|
None
|
4938
4938
|
|
4939
4939
|
注意1:如果指令异常,可能还要执行python -m playwright install
|
4940
|
-
注意2:调用本函数的格式是异步await
|
4940
|
+
注意2:调用本函数的格式是异步await开头,例如:
|
4941
4941
|
await jupyter2pdf2(notebook_dir, notebook_file)
|
4942
4942
|
"""
|
4943
4943
|
|
@@ -4992,6 +4992,9 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
|
|
4992
4992
|
page = await browser.new_page()
|
4993
4993
|
await page.goto(f"file://{os.path.abspath(html_file)}")
|
4994
4994
|
|
4995
|
+
# 避免加载html文件超时,用于macOS
|
4996
|
+
page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
|
4997
|
+
|
4995
4998
|
await page.pdf(path=output_pdf_path1, format='A4')
|
4996
4999
|
await page.pdf(path=output_pdf_path2, format='A3')
|
4997
5000
|
|
@@ -5000,7 +5003,7 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
|
|
5000
5003
|
print(f"2 PDF created in the same directory, pick 1 you think best")
|
5001
5004
|
|
5002
5005
|
except Exception as e:
|
5003
|
-
print(f"
|
5006
|
+
print(f"PDF conversion failed because {e}")
|
5004
5007
|
return
|
5005
5008
|
|
5006
5009
|
finally:
|
@@ -5019,6 +5022,107 @@ if __name__ == '__main__':
|
|
5019
5022
|
notebook_file = "Session 1 全球证券市场-简化版.ipynb"
|
5020
5023
|
#await jupyter2pdf2(notebook_dir, notebook_file)
|
5021
5024
|
# 注意:上面的await命令会导致编译失败,测试后要注释掉
|
5025
|
+
|
5026
|
+
#==============================================================================
|
5027
|
+
async def jupyter2pdf3(notebook_file):
|
5028
|
+
"""
|
5029
|
+
===========================================================================
|
5030
|
+
将 Jupyter Notebook 转换为 PDF 文件,异步方式。
|
5031
|
+
主要参数:
|
5032
|
+
notebook_file (str): Jupyter Notebook文件名,不含目录
|
5033
|
+
|
5034
|
+
输出:
|
5035
|
+
同时生成A4和A3两种幅面的pdf文件,由使用者自行挑选一个效果最好的。
|
5036
|
+
返回:
|
5037
|
+
None
|
5038
|
+
|
5039
|
+
注意1:如果指令异常,可能还要执行python -m playwright install
|
5040
|
+
注意2:调用本函数的格式是异步await开头,例如:
|
5041
|
+
await jupyter2pdf3(notebook_file)
|
5042
|
+
|
5043
|
+
注意:目前无法正确获得ipynb文件的所在目录,使用使用!!!
|
5044
|
+
"""
|
5045
|
+
# 获得路径
|
5046
|
+
import os
|
5047
|
+
notebook_dir=os.getcwd()
|
5048
|
+
# 注意:上述指令无法获取当前Jupyter文件的目录
|
5049
|
+
|
5050
|
+
# 路径分割符号
|
5051
|
+
if ('/' in notebook_dir) and not ('\\' in notebook_dir):
|
5052
|
+
sep='/'
|
5053
|
+
else:
|
5054
|
+
sep='\\'
|
5055
|
+
|
5056
|
+
# ipynb文件的完整路径
|
5057
|
+
if ('.ipynb' in notebook_file):
|
5058
|
+
notebook_file1=notebook_file.replace('.ipynb','')
|
5059
|
+
else:
|
5060
|
+
notebook_file1=notebook_file
|
5061
|
+
notebook_path=notebook_dir+sep+notebook_file1+'.ipynb'
|
5062
|
+
|
5063
|
+
# pdf文件的完整路径
|
5064
|
+
output_pdf_path1=notebook_dir+sep+notebook_file1+'A4.pdf'
|
5065
|
+
output_pdf_path2=notebook_dir+sep+notebook_file1+'A3.pdf'
|
5066
|
+
|
5067
|
+
from nbconvert import HTMLExporter
|
5068
|
+
|
5069
|
+
try:
|
5070
|
+
from playwright.async_api import async_playwright
|
5071
|
+
except:
|
5072
|
+
print(" #Warning(jupyter2pdf2): playwright seems not fully installed yet")
|
5073
|
+
print(" [Solution] execute the command before re-run: playwright install")
|
5074
|
+
return
|
5075
|
+
|
5076
|
+
html_file = ""
|
5077
|
+
|
5078
|
+
try:
|
5079
|
+
# 导出 Notebook 为 HTML
|
5080
|
+
html_exporter = HTMLExporter()
|
5081
|
+
try:
|
5082
|
+
html_content, _ = html_exporter.from_filename(notebook_path)
|
5083
|
+
print("Converting notebook file to pdf in both A4 and A3 sizes ...")
|
5084
|
+
|
5085
|
+
except:
|
5086
|
+
print("File not found for {}".format(notebook_path))
|
5087
|
+
return
|
5088
|
+
|
5089
|
+
# 创建临时 HTML 文件
|
5090
|
+
html_file = "temp_notebook.html"
|
5091
|
+
with open(html_file, "w", encoding="utf-8") as f:
|
5092
|
+
f.write(html_content)
|
5093
|
+
|
5094
|
+
# 使用 Playwright 打开 HTML 并保存为 PDF
|
5095
|
+
async with async_playwright() as p:
|
5096
|
+
browser = await p.chromium.launch()
|
5097
|
+
page = await browser.new_page()
|
5098
|
+
await page.goto(f"file://{os.path.abspath(html_file)}")
|
5099
|
+
|
5100
|
+
await page.pdf(path=output_pdf_path1, format='A4')
|
5101
|
+
await page.pdf(path=output_pdf_path2, format='A3')
|
5102
|
+
|
5103
|
+
await browser.close()
|
5104
|
+
|
5105
|
+
print(f"2 PDF created in the same directory, pick 1 you think best")
|
5106
|
+
|
5107
|
+
except Exception as e:
|
5108
|
+
print(f"Conversion failed because {e}")
|
5109
|
+
return
|
5110
|
+
|
5111
|
+
finally:
|
5112
|
+
if html_file == "":
|
5113
|
+
return
|
5114
|
+
# 删除临时 HTML 文件
|
5115
|
+
elif os.path.exists(html_file):
|
5116
|
+
os.remove(html_file)
|
5117
|
+
|
5118
|
+
return
|
5119
|
+
|
5120
|
+
if __name__ == '__main__':
|
5121
|
+
# 替换为你想转存PDF的Notebook文件名
|
5122
|
+
file = "Session 1 全球证券市场-简化版.ipynb"
|
5123
|
+
#await jupyter2pdf3(file)
|
5124
|
+
# 注意:上面的await命令会导致编译失败,测试后要注释掉
|
5125
|
+
|
5022
5126
|
#==============================================================================
|
5023
5127
|
if __name__ == '__main__':
|
5024
5128
|
df=security_trend("600519.SS",indicator=['Close','Open','High','Low'],graph=False)
|
siat/exchange_bond_china.pickle
CHANGED
File without changes
|
siat/fund_china.pickle
CHANGED
File without changes
|
siat/stock.py
CHANGED
@@ -1546,8 +1546,11 @@ if __name__ =="__main__":
|
|
1546
1546
|
tickers='AAPL'
|
1547
1547
|
measures=['Close','Adj Close']
|
1548
1548
|
|
1549
|
+
tickers=['000001.SS','^DJI']
|
1550
|
+
measures='Close'
|
1551
|
+
|
1549
1552
|
fromdate='2024-5-1'
|
1550
|
-
todate='
|
1553
|
+
todate='2025-6-23'
|
1551
1554
|
adjust=''
|
1552
1555
|
twinx=False
|
1553
1556
|
loc1='best'
|
@@ -1556,6 +1559,10 @@ if __name__ =="__main__":
|
|
1556
1559
|
source='auto'
|
1557
1560
|
ticker_type='auto'
|
1558
1561
|
facecolor='whitesmoke'
|
1562
|
+
|
1563
|
+
attention_value=''; attention_value_area=''
|
1564
|
+
attention_point=''; attention_point_area=''
|
1565
|
+
|
1559
1566
|
|
1560
1567
|
def compare_security(tickers,measures,fromdate,todate, \
|
1561
1568
|
adjust='', \
|
@@ -1609,7 +1616,8 @@ def compare_security(tickers,measures,fromdate,todate, \
|
|
1609
1616
|
measure_num = 0
|
1610
1617
|
if isinstance(measures,str):
|
1611
1618
|
measure_num = 1
|
1612
|
-
measure1 = measures
|
1619
|
+
#measure1 = measures
|
1620
|
+
measure1 = measure2 = measures
|
1613
1621
|
#如果measures是一个列表
|
1614
1622
|
if isinstance(measures,list):
|
1615
1623
|
measure_num = len(measures)
|
siat/stock_info.pickle
CHANGED
File without changes
|
@@ -1,226 +1,234 @@
|
|
1
|
-
Metadata-Version: 2.
|
2
|
-
Name: siat
|
3
|
-
Version: 3.10.
|
4
|
-
Summary: Securities Investment Analysis Tools (siat)
|
5
|
-
Home-page: https://pypi.org/project/siat/
|
6
|
-
Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
|
7
|
-
Author-email: wdehong2000@163.com
|
8
|
-
License: Copyright (C) WANG Dehong, 2025. For educational purpose only!
|
9
|
-
Description-Content-Type: text/markdown
|
10
|
-
License-File: LICENSE
|
11
|
-
Requires-Dist:
|
12
|
-
Requires-Dist: yfinance
|
13
|
-
Requires-Dist: tqdm
|
14
|
-
Requires-Dist:
|
15
|
-
Requires-Dist: akshare
|
16
|
-
Requires-Dist: urllib3
|
17
|
-
Requires-Dist: mplfinance
|
18
|
-
Requires-Dist: statsmodels
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist: pypinyin
|
21
|
-
Requires-Dist: seaborn
|
22
|
-
Requires-Dist: numpy
|
23
|
-
Requires-Dist: scipy
|
24
|
-
Requires-Dist: pandas
|
25
|
-
Requires-Dist: scikit-learn
|
26
|
-
Requires-Dist: baostock
|
27
|
-
Requires-Dist: pyproject.toml
|
28
|
-
Requires-Dist: pathlib
|
29
|
-
Requires-Dist: ruamel-yaml
|
30
|
-
Requires-Dist: prettytable
|
31
|
-
Requires-Dist: graphviz
|
32
|
-
Requires-Dist: luddite
|
33
|
-
Requires-Dist: pendulum
|
34
|
-
Requires-Dist: itables
|
35
|
-
Requires-Dist:
|
36
|
-
Requires-Dist: bottleneck
|
37
|
-
Requires-Dist: translate
|
38
|
-
Requires-Dist: translators
|
39
|
-
Requires-Dist: nbconvert
|
40
|
-
Requires-Dist: ipywidgets
|
41
|
-
Requires-Dist: yahooquery
|
42
|
-
Requires-Dist:
|
43
|
-
Requires-Dist: tiingo[pandas]
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
```python
|
76
|
-
#
|
77
|
-
|
78
|
-
```
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
#
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
In Jupyter Notebook
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
If
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
#
|
226
|
-
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: siat
|
3
|
+
Version: 3.10.126
|
4
|
+
Summary: Securities Investment Analysis Tools (siat)
|
5
|
+
Home-page: https://pypi.org/project/siat/
|
6
|
+
Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
|
7
|
+
Author-email: wdehong2000@163.com
|
8
|
+
License: Copyright (C) WANG Dehong, 2025. For educational purpose only!
|
9
|
+
Description-Content-Type: text/markdown
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Dist: pandas_datareader
|
12
|
+
Requires-Dist: yfinance
|
13
|
+
Requires-Dist: tqdm
|
14
|
+
Requires-Dist: plotly_express
|
15
|
+
Requires-Dist: akshare
|
16
|
+
Requires-Dist: urllib3
|
17
|
+
Requires-Dist: mplfinance
|
18
|
+
Requires-Dist: statsmodels
|
19
|
+
Requires-Dist: yahoo_earnings_calendar
|
20
|
+
Requires-Dist: pypinyin
|
21
|
+
Requires-Dist: seaborn
|
22
|
+
Requires-Dist: numpy
|
23
|
+
Requires-Dist: scipy
|
24
|
+
Requires-Dist: pandas
|
25
|
+
Requires-Dist: scikit-learn
|
26
|
+
Requires-Dist: baostock
|
27
|
+
Requires-Dist: pyproject.toml
|
28
|
+
Requires-Dist: pathlib
|
29
|
+
Requires-Dist: ruamel-yaml
|
30
|
+
Requires-Dist: prettytable
|
31
|
+
Requires-Dist: graphviz
|
32
|
+
Requires-Dist: luddite
|
33
|
+
Requires-Dist: pendulum
|
34
|
+
Requires-Dist: itables
|
35
|
+
Requires-Dist: py_trans
|
36
|
+
Requires-Dist: bottleneck
|
37
|
+
Requires-Dist: translate
|
38
|
+
Requires-Dist: translators
|
39
|
+
Requires-Dist: nbconvert
|
40
|
+
Requires-Dist: ipywidgets==8.1.6
|
41
|
+
Requires-Dist: yahooquery==2.3.7
|
42
|
+
Requires-Dist: alpha_vantage
|
43
|
+
Requires-Dist: tiingo[pandas]
|
44
|
+
Dynamic: author
|
45
|
+
Dynamic: author-email
|
46
|
+
Dynamic: description
|
47
|
+
Dynamic: description-content-type
|
48
|
+
Dynamic: home-page
|
49
|
+
Dynamic: license
|
50
|
+
Dynamic: license-file
|
51
|
+
Dynamic: requires-dist
|
52
|
+
Dynamic: summary
|
53
|
+
|
54
|
+
|
55
|
+
# What is siat?
|
56
|
+
siat is a Python 3 plug-in for security investment analysis, primarily designed for teaching and learning purposes in universities for undergraduate and postgraduate programs.
|
57
|
+
|
58
|
+
siat is recommended to run in Jupyter Notebook or Jupyter Lab, and most of its results are in the forms of figures and/or tables.
|
59
|
+
# Version naming
|
60
|
+
Version structure: X.Y.Z
|
61
|
+
|
62
|
+
X is the major version for architecture upgrade only.
|
63
|
+
Y is the functional version for functional enhancements.
|
64
|
+
Z is the minor version just for bug fixing.
|
65
|
+
|
66
|
+
# Quick examples of using siat
|
67
|
+
|
68
|
+
|
69
|
+
```python
|
70
|
+
# Enable siat
|
71
|
+
from siat import *
|
72
|
+
```
|
73
|
+
|
74
|
+
|
75
|
+
```python
|
76
|
+
# Set language to English, default is Chinese
|
77
|
+
set_language("English")
|
78
|
+
```
|
79
|
+
|
80
|
+
## Example 1: Apple stock price for the recent month
|
81
|
+
|
82
|
+
|
83
|
+
```python
|
84
|
+
# Simple way: show Apple's stock price in recent month
|
85
|
+
apple=security_trend("AAPL")
|
86
|
+
```
|
87
|
+
You may expect more information, such as price trend in a recent year (MRY), with the high/low point, current price and average price, like below:
|
88
|
+
|
89
|
+
```python
|
90
|
+
apple=security_trend("AAPL", start="MRY",
|
91
|
+
mark_top=True, mark_bottom=True, mark_end=True,
|
92
|
+
average_value=True)
|
93
|
+
```
|
94
|
+
|
95
|
+
## Example 2: Comparing Price changes among Apple, Microsoft and NVidia
|
96
|
+
You may expect compare the price changes for the recent quarter (MRQ) for the three stocks.
|
97
|
+
|
98
|
+
Since there is a major stock split for NVidia in 2024 by 1:10, it is necessary to use adjusted prices (Adj Close) to compare these stock prices.
|
99
|
+
|
100
|
+
```python
|
101
|
+
comp=security_trend(['AAPL','MSFT','NVDA'],
|
102
|
+
start='MRQ',
|
103
|
+
indicator='Adj Close',
|
104
|
+
preprocess='scaling', #use scaling drawing method to avoid loss of details
|
105
|
+
mark_top=True, mark_bottom=True,
|
106
|
+
annotate=True, annotate_value=True)
|
107
|
+
```
|
108
|
+
|
109
|
+
## Example 4: Bollinger band for Apple in the recent quarter
|
110
|
+
|
111
|
+
|
112
|
+
```python
|
113
|
+
# security_technical only supports 4 popular technical indicators: MACD, Bollinger, KDJ and RSI.
|
114
|
+
apple=security_technical("AAPL",
|
115
|
+
technical="Bollinger",
|
116
|
+
start="MRQ",
|
117
|
+
facecolor="white",
|
118
|
+
loc1="upper left", loc2="lower right")
|
119
|
+
```
|
120
|
+
|
121
|
+
## Example 5: CCI for Apple in recent quarter
|
122
|
+
|
123
|
+
|
124
|
+
```python
|
125
|
+
# security_technical2 supports up to 14 popular technical indicators.
|
126
|
+
# security_technical2 uses a simplied drawing method (Dehong graph) to avoid trypophobia [ˌtrɪpəu'fəʊbjə]
|
127
|
+
apple=security_technical2("AAPL",
|
128
|
+
technical="CCI",
|
129
|
+
start="MRM",
|
130
|
+
loc1="upper left", loc2="lower right")
|
131
|
+
```
|
132
|
+
|
133
|
+
# What security products does siat support?
|
134
|
+
1. Public company profile: world-wide
|
135
|
+
2. Stock & stock market index: world-wide
|
136
|
+
3. Stock valuation: primarily in China (mainland and HK) and the U.S.
|
137
|
+
4. Stock option chain: primarily in the U.S.
|
138
|
+
5. Bond: primarily in China and the U.S.
|
139
|
+
6. Markowitz portfolio: with all the supported stocks and bonds
|
140
|
+
7. Fund: primarily in China and the U.S.
|
141
|
+
8. Futures: primarily in China and the U.S.
|
142
|
+
9. Options: primarily in China and the U.S.
|
143
|
+
10. Digital currency: world-wide (some may be restricted by data sources)
|
144
|
+
11. Balance sheet: in China (full function) and world-wide (basic function)
|
145
|
+
12. Income statement: in China mainland (full function) and world-wide (basic function)
|
146
|
+
13. Cash flow statement: in China mainland (full function) and world-wide (basic function)
|
147
|
+
14. DuPont Identity: world-wide
|
148
|
+
15. Sector trend and valuation: primarily in China
|
149
|
+
# What analytical methods does siat support?
|
150
|
+
1. Trend analysis
|
151
|
+
2. Panel comparation
|
152
|
+
3. Return analysis: rolling returns, holding period returns
|
153
|
+
4. Risk analysis: rolling volatility, holding period volatility, LPSD
|
154
|
+
5. Technical analysis: more than 15 indicators
|
155
|
+
6. Risk-adjusted return: Sharpe ratio, Sortino ratio, Treynor ratio, Jensen alpha
|
156
|
+
7. Portfolio optimization: four risk-adjusted returns
|
157
|
+
8. CAPM beta trend
|
158
|
+
9. Beta adjustments: simple adjustment, Scholes-Williams, Dimson
|
159
|
+
10. Beta leverage: Hamada Model
|
160
|
+
11. Fama-French three-factor model
|
161
|
+
12. Fama-French-Carhart four-factor model
|
162
|
+
13. Fama-French five-factor model
|
163
|
+
14. Future pricing
|
164
|
+
15. Option pricing: European style, American style, with/without dividends
|
165
|
+
16. VaR & ES: variance-covariance, historic simulation, Monte Carlo, multiple periods
|
166
|
+
17. Liquidity risk: Roll spread, Amihud, Pastor-Stambaugh
|
167
|
+
18. ESG: basic functions
|
168
|
+
# Do I have to download data first before using siat?
|
169
|
+
NO!
|
170
|
+
siat will search the internet data sources for all the required data during analysis.
|
171
|
+
The main data sources siat uses:
|
172
|
+
1. Yahoo Finance
|
173
|
+
2. Sina Finance
|
174
|
+
3. East Money
|
175
|
+
4. Stooq (Polish)
|
176
|
+
5. FRED
|
177
|
+
6. OECD
|
178
|
+
7. IMF
|
179
|
+
8. Shanghai Stock Exchange
|
180
|
+
9. Shenzhen Stock Exchange
|
181
|
+
10. Hong Kong Stock Exchange
|
182
|
+
11. Beijing Stock Exchange
|
183
|
+
12. Tokyo Stock Exchange
|
184
|
+
13. London Stock Exchange
|
185
|
+
14. New York Stock Exchange
|
186
|
+
15. NASDAQ
|
187
|
+
16. Sustainalytics
|
188
|
+
|
189
|
+
Thanks the above websites for their valuable data!
|
190
|
+
# How to install siat?
|
191
|
+
The author strongly recommends using siat together with Jupyter Notebook or Jupyter Lab in Anaconda.
|
192
|
+
In order to install siat for the very first time, open a Jupyter Notebook, and type in the following command:
|
193
|
+
|
194
|
+
!pip install siat
|
195
|
+
|
196
|
+
If the above method does not work, something might be wrong in your Python path settings. Try to open an Anaconda Prompt in Windows or a Terminal App in Mac or Linux, and type in the following command:
|
197
|
+
|
198
|
+
pip install siat
|
199
|
+
# How to upgrade siat?
|
200
|
+
In Jupyter Notebook or Jupyter Lab:
|
201
|
+
|
202
|
+
upgrade_siat()
|
203
|
+
|
204
|
+
If you suffer from slow internet connection (often in campus classrooms with many students), try to use alternative sources, such as:
|
205
|
+
|
206
|
+
upgrade_siat(alternative="tsinghua")
|
207
|
+
|
208
|
+
upgrade_siat(alternative="alibaba")
|
209
|
+
|
210
|
+
If the above methods do not work for your environment, you have to goto the traditional ways to use command-line script, such as:
|
211
|
+
|
212
|
+
pip install --upgrade siat
|
213
|
+
|
214
|
+
*** For users in China
|
215
|
+
The pypi mirror websites may provide siat installing and upgrading in a much faster speed in the following commands: taking aliyun as an example
|
216
|
+
|
217
|
+
pip install siat -i https://mirrors.aliyun.com/pypi/simple/
|
218
|
+
|
219
|
+
pip install --upgrade siat https://mirrors.aliyun.com/pypi/simple/
|
220
|
+
|
221
|
+
*** Warning
|
222
|
+
1. The pip command itself may need upgrade as well.
|
223
|
+
2. The pip command sometimes may have conflicts with some vpn programs.
|
224
|
+
If in this case, try quit vpn program first, and try again.
|
225
|
+
# Are there more detailed case studies on using siat?
|
226
|
+
YES!
|
227
|
+
|
228
|
+
There are hundreds of video case studies in the author's channel (most in Chinese, some in English).
|
229
|
+
|
230
|
+
https://space.bilibili.com/284812153
|
231
|
+
|
232
|
+
Welcome to follow the channel!
|
233
|
+
# How to report a bug or look for help?
|
234
|
+
Write to the author, Prof. WANG Dehong, wdehong2000@163.com
|