siat 3.8.47__py3-none-any.whl → 3.9.1__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/allin.py +1 -0
- siat/financials_china.py +15 -5
- siat/grafix.py +32 -11
- siat/other_indexes.py +189 -0
- siat/security_price2.py +8 -2
- siat/stock.py +1 -1
- siat/translate.py +27 -1
- {siat-3.8.47.dist-info → siat-3.9.1.dist-info}/METADATA +1 -1
- {siat-3.8.47.dist-info → siat-3.9.1.dist-info}/RECORD +12 -11
- {siat-3.8.47.dist-info → siat-3.9.1.dist-info}/LICENSE +0 -0
- {siat-3.8.47.dist-info → siat-3.9.1.dist-info}/WHEEL +0 -0
- {siat-3.8.47.dist-info → siat-3.9.1.dist-info}/top_level.txt +0 -0
siat/allin.py
CHANGED
siat/financials_china.py
CHANGED
@@ -3606,7 +3606,8 @@ if __name__=='__main__':
|
|
3606
3606
|
def compare_fin_summary_china(tickers,fsdates,facecolor='whitesmoke',font_size='16px'):
|
3607
3607
|
"""
|
3608
3608
|
功能:分类别显示财报摘要中的指标
|
3609
|
-
"""
|
3609
|
+
"""
|
3610
|
+
DEBUG=False
|
3610
3611
|
|
3611
3612
|
# 检查股票列表
|
3612
3613
|
if isinstance(tickers,str):
|
@@ -3796,7 +3797,13 @@ def compare_fin_summary_china(tickers,fsdates,facecolor='whitesmoke',font_size='
|
|
3796
3797
|
"""
|
3797
3798
|
titletxt1=titletxt+','+ty
|
3798
3799
|
|
3799
|
-
|
3800
|
+
if DEBUG:
|
3801
|
+
if ty == "每股指标":
|
3802
|
+
print(dft2['指标'])
|
3803
|
+
display(dft2)
|
3804
|
+
dft4=dft2.dropna(subset=['指标'])
|
3805
|
+
|
3806
|
+
df_display_CSS(df=dft4,titletxt=titletxt1,footnote=notesdict[ty], \
|
3800
3807
|
facecolor=facecolor,decimals=2, \
|
3801
3808
|
titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
|
3802
3809
|
data_font_size=data_font_size)
|
@@ -3851,8 +3858,9 @@ def compare_fin_summary_china(tickers,fsdates,facecolor='whitesmoke',font_size='
|
|
3851
3858
|
print(notesdict[ty])
|
3852
3859
|
"""
|
3853
3860
|
titletxt1=titletxt+','+ty
|
3861
|
+
dft4=dft2.dropna(subset=['指标'])
|
3854
3862
|
|
3855
|
-
df_display_CSS(df=
|
3863
|
+
df_display_CSS(df=dft4,titletxt=titletxt1,footnote=notesdict[ty], \
|
3856
3864
|
facecolor=facecolor,decimals=2, \
|
3857
3865
|
titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
|
3858
3866
|
data_font_size=data_font_size)
|
@@ -4129,7 +4137,8 @@ def compare_fin_indicator_china(tickers,fsdates,facecolor='papayawhip',font_size
|
|
4129
4137
|
'利润回报': [
|
4130
4138
|
'销售毛利率(%)','主营业务利润率(%)','营业利润率(%)','销售净利率(%)','成本费用利润率(%)',
|
4131
4139
|
'主营业务成本率(%)','三项费用比重(%)',
|
4132
|
-
'主营利润比重(%)','非主营比重(%)','固定资产比重(%)',
|
4140
|
+
#'主营利润比重(%)','非主营比重(%)','固定资产比重(%)',
|
4141
|
+
'主营利润比重(%)','固定资产比重(%)',
|
4133
4142
|
'总资产利润率(%)','总资产净利润率(%)','资产报酬率(%)',
|
4134
4143
|
'净资产收益率(%)','加权净资产收益率(%)','净资产报酬率(%)','投资收益率(%)','股本报酬率(%)','股息发放率(%)',
|
4135
4144
|
'总资产增长率(%)','净资产增长率(%)','主营业务收入增长率(%)','净利润增长率(%)',
|
@@ -4193,7 +4202,7 @@ def compare_fin_indicator_china(tickers,fsdates,facecolor='papayawhip',font_size
|
|
4193
4202
|
'营业利润率=营业利润/营业(总)收入*100%,营业利润=主营业务利润+其他业务利润-期间费用+其他损益 \n'+ \
|
4194
4203
|
'其他业务利润=其他业务收入-其它业务支出-其他业务税金及附加,期间费用=销售费用+管理费用+财务费用 \n'+ \
|
4195
4204
|
'其他损益=-资产减值损失+公允价值变动损益(损失为负数)+投资损益(损失为负数)+资产处置损益(损失为负数) \n'+ \
|
4196
|
-
'
|
4205
|
+
'利润总额=主营营业利润+非主营营业利润+投资损益+营业外收入支出净额 \n'+ \
|
4197
4206
|
'销售净利率=净利润率=净利润/营业(总)收入*100%,净利润=利润总额-所得税费用 \n'+ \
|
4198
4207
|
'成本费用利润率=利润总额/成本费用总额*100%,成本费用总额=营业(总)成本+营业税金及附加+期间费用+资产减值损失 \n'+ \
|
4199
4208
|
'主营业务收入成本率=主营业务成本/主营业务收入*100% \n'+ \
|
@@ -4322,6 +4331,7 @@ def compare_fin_indicator_china(tickers,fsdates,facecolor='papayawhip',font_size
|
|
4322
4331
|
无论如何修改colalign都没用
|
4323
4332
|
"""
|
4324
4333
|
titletxt1=titletxt+','+ty
|
4334
|
+
|
4325
4335
|
df_display_CSS(df=dft3,titletxt=titletxt1,footnote=notesdict[ty], \
|
4326
4336
|
facecolor=facecolor,decimals=2, \
|
4327
4337
|
titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
|
siat/grafix.py
CHANGED
@@ -331,7 +331,9 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
|
|
331
331
|
atpd=at
|
332
332
|
|
333
333
|
if DEBUG: print(f"atpd={atpd}")
|
334
|
-
|
334
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
335
|
+
#plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
336
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
335
337
|
|
336
338
|
if not attention_point_area=='':
|
337
339
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -722,8 +724,9 @@ def plot_line2_coaxial(df01,ticker1,colname1,label1, \
|
|
722
724
|
|
723
725
|
if DEBUG:
|
724
726
|
print("atpd=",atpd)
|
725
|
-
|
726
|
-
|
727
|
+
|
728
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
729
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
727
730
|
|
728
731
|
if not attention_point_area=='':
|
729
732
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -992,8 +995,10 @@ def plot_line2_coaxial2(df01,ticker1,colname1,label1, \
|
|
992
995
|
|
993
996
|
if DEBUG:
|
994
997
|
print("atpd=",atpd)
|
995
|
-
|
996
|
-
|
998
|
+
|
999
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
1000
|
+
#plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
1001
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
997
1002
|
|
998
1003
|
if not attention_point_area=='':
|
999
1004
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -1207,7 +1212,9 @@ def plot_line2_twinx(df01,ticker1,colname1,label1, \
|
|
1207
1212
|
atpd=pd.to_datetime(at)
|
1208
1213
|
except:
|
1209
1214
|
atpd=at
|
1210
|
-
|
1215
|
+
|
1216
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
1217
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
1211
1218
|
|
1212
1219
|
if not attention_point_area=='':
|
1213
1220
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -1455,7 +1462,10 @@ def plot_line2_LR(df01,ticker1,colname1,label1, \
|
|
1455
1462
|
atpd=pd.to_datetime(at)
|
1456
1463
|
except:
|
1457
1464
|
atpd=at
|
1458
|
-
|
1465
|
+
|
1466
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
1467
|
+
#ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
1468
|
+
ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
1459
1469
|
|
1460
1470
|
if not attention_point_area=='':
|
1461
1471
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -1698,7 +1708,10 @@ def plot_line2_UD(df01,ticker1,colname1,label1, \
|
|
1698
1708
|
atpd=pd.to_datetime(at)
|
1699
1709
|
except:
|
1700
1710
|
atpd=at
|
1701
|
-
|
1711
|
+
|
1712
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
1713
|
+
#ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
1714
|
+
ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
1702
1715
|
|
1703
1716
|
if not attention_point_area=='':
|
1704
1717
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -1938,7 +1951,10 @@ def plot_line2_twinx2(df01,ticker1,colname1,label1, \
|
|
1938
1951
|
atpd=pd.to_datetime(at)
|
1939
1952
|
except:
|
1940
1953
|
atpd=at
|
1941
|
-
|
1954
|
+
|
1955
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
1956
|
+
#plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
1957
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
1942
1958
|
|
1943
1959
|
if not attention_point_area=='':
|
1944
1960
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -2406,7 +2422,9 @@ def draw_lines(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
|
|
2406
2422
|
plt.arrow(atpd,yaxis_min,arrow_dx,arrow_dy,ls=':',lw=2,fc=color,ec=color,alpha=0.5,shape='full', \
|
2407
2423
|
width=0.05,length_includes_head=True)
|
2408
2424
|
"""
|
2409
|
-
|
2425
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
2426
|
+
#plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
2427
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
2410
2428
|
|
2411
2429
|
if not attention_point_area=='':
|
2412
2430
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
@@ -2782,7 +2800,10 @@ def draw_lines2(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
|
|
2782
2800
|
atpd=pd.to_datetime(at)
|
2783
2801
|
except:
|
2784
2802
|
atpd=at
|
2785
|
-
|
2803
|
+
|
2804
|
+
at_str=atpd.strftime('%Y-%m-%d')
|
2805
|
+
#plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
|
2806
|
+
plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
|
2786
2807
|
|
2787
2808
|
if not attention_point_area=='':
|
2788
2809
|
if isinstance(attention_point_area,list) and len(attention_point_area)>=2:
|
siat/other_indexes.py
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
本模块功能:另类证券市场指数
|
4
|
+
所属工具包:证券投资分析工具SIAT
|
5
|
+
SIAT:Security Investment Analysis Tool
|
6
|
+
创建日期:2025年5月8日
|
7
|
+
最新修订日期:
|
8
|
+
作者:王德宏 (WANG Dehong, Peter)
|
9
|
+
作者单位:北京外国语大学国际商学院
|
10
|
+
作者邮件:wdehong2000@163.com
|
11
|
+
版权所有:王德宏
|
12
|
+
用途限制:仅限研究与教学使用,不可商用!商用需要额外授权。
|
13
|
+
特别声明:作者不对使用本工具进行证券投资导致的任何损益负责!
|
14
|
+
"""
|
15
|
+
#==============================================================================
|
16
|
+
#关闭所有警告
|
17
|
+
import warnings; warnings.filterwarnings('ignore')
|
18
|
+
|
19
|
+
from siat.common import *
|
20
|
+
#==============================================================================
|
21
|
+
|
22
|
+
|
23
|
+
def other_index_translate(index_code):
|
24
|
+
"""
|
25
|
+
===========================================================================
|
26
|
+
功能:另类证券市场指数代码
|
27
|
+
参数:
|
28
|
+
index_code: 指数代码,非标准,来自东方财富和新浪。
|
29
|
+
返回值:是否找到,基于语言环境为中文或英文解释。
|
30
|
+
语言环境判断为check_language()
|
31
|
+
|
32
|
+
数据结构:['指数代码','指数符号','指数名称中文','指数名称英文','数据来源']
|
33
|
+
"""
|
34
|
+
|
35
|
+
import pandas as pd
|
36
|
+
trans_dict=pd.DataFrame([
|
37
|
+
|
38
|
+
['INDEXCF','俄罗斯MICEX指数','俄罗斯MICEX指数','MICEX Index','sina'],
|
39
|
+
['RTS','俄罗斯RTS指数','俄罗斯RTS指数','RTS Index','sina'],
|
40
|
+
['CASE','埃及CASE 30指数','埃及CASE30指数','CASE30 Index','sina'],
|
41
|
+
['VNINDEX','越南胡志明','越南胡志明指数','Ho Chi-Ming Index','em'],
|
42
|
+
['HSCEI','国企指数','港股国企指数','HK H-share Index','em'],
|
43
|
+
['HSCCI','红筹指数','港股红筹指数','HK Red-share Index','em'],
|
44
|
+
['CSEALL','斯里兰卡科伦坡','斯里兰卡科伦坡全指','Colombo Index','em'],
|
45
|
+
['UDI','美元指数','美元指数','US Dollar Index','em'],
|
46
|
+
['CRB','路透CRB商品指数','路透CRB商品指数','Reuters CRB Index','em'],
|
47
|
+
['BDI','波罗的海BDI指数','波罗的海BDI指数','Baltic Dry Index','em'],
|
48
|
+
['KSE100','巴基斯坦卡拉奇','巴基斯坦卡拉奇指数','KSE100 Index','em'],
|
49
|
+
|
50
|
+
|
51
|
+
], columns=['code','symbol','name_cn','name_en','source'])
|
52
|
+
|
53
|
+
found=False; symbol=index_code
|
54
|
+
try:
|
55
|
+
dict_word=trans_dict[trans_dict['code']==index_code]
|
56
|
+
found=True
|
57
|
+
except:
|
58
|
+
#未查到翻译词汇,返回原词
|
59
|
+
pass
|
60
|
+
|
61
|
+
if dict_word is None:
|
62
|
+
found=False
|
63
|
+
elif len(dict_word) == 0:
|
64
|
+
found=False
|
65
|
+
|
66
|
+
source=''; name=''
|
67
|
+
if found:
|
68
|
+
symbol=dict_word['symbol'].values[0]
|
69
|
+
|
70
|
+
lang=check_language()
|
71
|
+
if lang == 'Chinese':
|
72
|
+
name=dict_word['name_cn'].values[0]
|
73
|
+
else:
|
74
|
+
name=dict_word['name_en'].values[0]
|
75
|
+
|
76
|
+
source=dict_word['source'].values[0]
|
77
|
+
|
78
|
+
return symbol,name,source
|
79
|
+
|
80
|
+
if __name__=='__main__':
|
81
|
+
index_code='KSE100'
|
82
|
+
index_code='CASE'
|
83
|
+
index_code='XYZ'
|
84
|
+
|
85
|
+
set_language('Chinese')
|
86
|
+
set_language('English')
|
87
|
+
other_index_translate(index_code)
|
88
|
+
|
89
|
+
#==============================================================================
|
90
|
+
def get_other_index_em(index_code,start,end):
|
91
|
+
"""
|
92
|
+
功能:获取另类指数历史行情,东方财富
|
93
|
+
参数:
|
94
|
+
index_code:指数代码
|
95
|
+
start,end:开始/结束日期
|
96
|
+
"""
|
97
|
+
symbol,name,source=other_index_translate(index_code)
|
98
|
+
if symbol == index_code:
|
99
|
+
return None
|
100
|
+
|
101
|
+
import akshare as ak
|
102
|
+
dft = ak.index_global_hist_em(symbol=symbol)
|
103
|
+
dft.rename(columns={'日期':'Date','代码':'ticker','名称':'Name','今开':'Open', \
|
104
|
+
'最新价':'Close','最高':'High','最低':'Low','振幅':'Change'}, \
|
105
|
+
inplace=True)
|
106
|
+
dft['Change']=dft['Change']/100.00
|
107
|
+
dft['Adj Close']=dft['Close']
|
108
|
+
dft['source']=source
|
109
|
+
dft['Volume']=0
|
110
|
+
dft['Name']=name
|
111
|
+
|
112
|
+
import pandas as pd
|
113
|
+
dft['date']=dft['Date'].apply(lambda x: pd.to_datetime(x))
|
114
|
+
dft.set_index('date',inplace=True)
|
115
|
+
|
116
|
+
startpd=pd.to_datetime(start); endpd=pd.to_datetime(end)
|
117
|
+
df=dft[(dft.index >= startpd) & (dft.index <= endpd)]
|
118
|
+
|
119
|
+
return df
|
120
|
+
|
121
|
+
if __name__=='__main__':
|
122
|
+
index_code='KSE100'
|
123
|
+
start='2025-2-1'; end='2025-3-31'
|
124
|
+
get_other_index_em(index_code,start,end)
|
125
|
+
#==============================================================================
|
126
|
+
def get_other_index_sina(index_code,start,end):
|
127
|
+
"""
|
128
|
+
功能:获取另类指数历史行情,新浪财经
|
129
|
+
参数:
|
130
|
+
index_code:指数代码
|
131
|
+
start,end:开始/结束日期
|
132
|
+
"""
|
133
|
+
symbol,name,source=other_index_translate(index_code)
|
134
|
+
if symbol == index_code:
|
135
|
+
return None
|
136
|
+
|
137
|
+
import akshare as ak
|
138
|
+
dft = ak.index_global_hist_sina(symbol=symbol)
|
139
|
+
dft.rename(columns={'open':'Open','high':'High','low':'Low','close':'Close', \
|
140
|
+
'volume':'Volume'},inplace=True)
|
141
|
+
dft['ticker']=index_code; dft['Name']=name; dft['Date']=dft['date']
|
142
|
+
dft['Adj Close']=dft['Close']
|
143
|
+
dft['source']=source
|
144
|
+
|
145
|
+
import pandas as pd
|
146
|
+
dft['date']=dft['Date'].apply(lambda x: pd.to_datetime(x))
|
147
|
+
dft.set_index('date',inplace=True)
|
148
|
+
|
149
|
+
startpd=pd.to_datetime(start); endpd=pd.to_datetime(end)
|
150
|
+
df=dft[(dft.index >= startpd) & (dft.index <= endpd)]
|
151
|
+
|
152
|
+
return df
|
153
|
+
|
154
|
+
if __name__=='__main__':
|
155
|
+
index_code='CASE'
|
156
|
+
start='2025-2-1'; end='2025-3-31'
|
157
|
+
get_other_index_sina(index_code,start,end)
|
158
|
+
#==============================================================================
|
159
|
+
def get_other_index_ak(index_code,start,end):
|
160
|
+
"""
|
161
|
+
功能:获取另类指数历史行情,新浪财经或东方财富
|
162
|
+
参数:
|
163
|
+
index_code:指数代码
|
164
|
+
start,end:开始/结束日期
|
165
|
+
"""
|
166
|
+
symbol,name,source=other_index_translate(index_code)
|
167
|
+
if symbol == index_code:
|
168
|
+
return None
|
169
|
+
|
170
|
+
if source == 'em':
|
171
|
+
df=get_other_index_em(index_code,start,end)
|
172
|
+
elif source == 'sina':
|
173
|
+
df=get_other_index_sina(index_code,start,end)
|
174
|
+
else:
|
175
|
+
df=None
|
176
|
+
|
177
|
+
return df
|
178
|
+
|
179
|
+
if __name__=='__main__':
|
180
|
+
index_code='CASE'
|
181
|
+
index_code='KSE100'
|
182
|
+
index_code='VNINDEX'
|
183
|
+
start='2025-2-1'; end='2025-3-31'
|
184
|
+
get_other_index(index_code,start,end)
|
185
|
+
#==============================================================================
|
186
|
+
#==============================================================================
|
187
|
+
#==============================================================================
|
188
|
+
|
189
|
+
|
siat/security_price2.py
CHANGED
@@ -14,6 +14,7 @@ import warnings; warnings.filterwarnings('ignore')
|
|
14
14
|
from siat.common import *
|
15
15
|
from siat.translate import *
|
16
16
|
from siat.security_prices import *
|
17
|
+
from siat.other_indexes import *
|
17
18
|
#==============================================================================
|
18
19
|
import pandas as pd
|
19
20
|
#==============================================================================
|
@@ -67,6 +68,7 @@ if __name__=='__main__':
|
|
67
68
|
|
68
69
|
# 新测试组
|
69
70
|
ticker="XAUUSD"
|
71
|
+
ticker="^NSEI"
|
70
72
|
fromdate='2024-5-1'; todate='2024-5-20'
|
71
73
|
ticker_type='auto';source='auto'
|
72
74
|
adjust='';fill=False
|
@@ -119,7 +121,7 @@ def get_price_1ticker(ticker,fromdate,todate, \
|
|
119
121
|
ticker_type=ticker_type_preprocess_1str(ticker,ticker_type)
|
120
122
|
|
121
123
|
#数据源情形1:akshare
|
122
|
-
if source in ['auto','sina']:
|
124
|
+
if source in ['auto','sina','em']:
|
123
125
|
#中国的证券
|
124
126
|
if suffix in SUFFIX_LIST_CN:
|
125
127
|
#含处理证券类型优先级
|
@@ -185,7 +187,11 @@ def get_price_1ticker(ticker,fromdate,todate, \
|
|
185
187
|
if source in ['auto'] and found not in ['Found','Empty']:
|
186
188
|
dft=get_index_fred(ticker1,fromdate,todate)
|
187
189
|
found=df_have_data(dft)
|
188
|
-
|
190
|
+
|
191
|
+
#数据源情形6:仅用于几个另类非常用指数,例如胡志明指数/卡拉奇指数/埃及指数等,新浪/东方财富
|
192
|
+
if source in ['auto','sina','em'] and found not in ['Found','Empty']:
|
193
|
+
dft=get_other_index_ak(ticker1,fromdate,todate)
|
194
|
+
found=df_have_data(dft)
|
189
195
|
#数据源情形6:pandas_datareader,其他数据源,暂不支持
|
190
196
|
"""
|
191
197
|
Tiingo:获取股票,共同基金和信息和交易所交易基金的信息,可以免费注册获得API_KEY
|
siat/stock.py
CHANGED
@@ -127,7 +127,7 @@ def get_profile(ticker):
|
|
127
127
|
dic=tp.info
|
128
128
|
except:
|
129
129
|
print(f" #Error(get_profile): failed to retrieve info for {ticker}")
|
130
|
-
print(" Solution:
|
130
|
+
print(" Solution: need access to Yahoo")
|
131
131
|
return None
|
132
132
|
|
133
133
|
if dic is None:
|
siat/translate.py
CHANGED
@@ -1150,7 +1150,19 @@ def codetranslate0(code):
|
|
1150
1150
|
|
1151
1151
|
['^XU100','伊斯坦布尔100指数'], ['10TRY.B','土耳其10年期国债收益率%'],
|
1152
1152
|
|
1153
|
-
|
1153
|
+
# 另类指数
|
1154
|
+
['INDEXCF','俄罗斯MICEX指数'],
|
1155
|
+
['RTS','俄罗斯RTS指数'],
|
1156
|
+
['CASE','埃及CASE30指数'],
|
1157
|
+
['VNINDEX','越南胡志明指数'],
|
1158
|
+
['HSCEI','港股国企指数'],
|
1159
|
+
['HSCCI','港股红筹指数'],
|
1160
|
+
['CSEALL','斯里兰卡科伦坡全指'],
|
1161
|
+
['UDI','美元指数'],
|
1162
|
+
['CRB','路透CRB商品指数'],
|
1163
|
+
['BDI','波罗的海BDI指数'],
|
1164
|
+
['KSE100','巴基斯坦卡拉奇指数'],
|
1165
|
+
|
1154
1166
|
|
1155
1167
|
#债券==================================================================
|
1156
1168
|
['sh019521','15国债21'],['sz128086','国轩转债'],['sz123027','蓝晓转债'],
|
@@ -2035,6 +2047,20 @@ def codetranslate1(code):
|
|
2035
2047
|
['^XU100','ISE National-100 index'], ['10TRY.B','Turkey 10-year Treasurybond Yield%'],
|
2036
2048
|
['10CNY.B','10-Year China Treasurybond Yield%'],
|
2037
2049
|
|
2050
|
+
# 另类指数
|
2051
|
+
['INDEXCF','Russia MICEX Index'],
|
2052
|
+
['RTS','Russia RTS Index'],
|
2053
|
+
['CASE','Egypt CASE30 Index'],
|
2054
|
+
['VNINDEX','Ho Chi-Ming Index'],
|
2055
|
+
['HSCEI','HK H-share Index'],
|
2056
|
+
['HSCCI','HK Red-share Index'],
|
2057
|
+
['CSEALL','Colombo Index'],
|
2058
|
+
['UDI','US Dollar Index'],
|
2059
|
+
['CRB','Reuters CRB Index'],
|
2060
|
+
['BDI','Baltic Dry Index'],
|
2061
|
+
['KSE100','Pakistan KSE100 Index'],
|
2062
|
+
|
2063
|
+
|
2038
2064
|
#债券==================================================================
|
2039
2065
|
['sh019521','15国债21'],['sz128086','国轩转债'],['sz123027','蓝晓转债'],
|
2040
2066
|
['^IRX','13-week Treasury Yield%'],['^FVX','5-year Treasury Yield%'],
|
@@ -1,7 +1,7 @@
|
|
1
1
|
siat/__init__ -20240701.py,sha256=gP5uajXnJesnH5SL0ZPwq_Qhv59AG1bs4qwZv26Fo2Y,2894
|
2
2
|
siat/__init__.py,sha256=tpSBf8BYpWOzBDF2iNQ4tlVxjx7bmkVQ3kPUu9X3iog,2227
|
3
3
|
siat/__init__.py.backup_20250214.py,sha256=pIo4CV3lNPKIhitmhIh_6aAfZrmzQWGNDcEnvZ7GXoc,3216
|
4
|
-
siat/allin.py,sha256
|
4
|
+
siat/allin.py,sha256=--32Bt2Mfg7l38w7X9cLJCdWtYRB3tTtVHnS9WnqKDI,3035
|
5
5
|
siat/alpha_vantage_test.py,sha256=tKr-vmuFH3CZAqwmISz6jzjPHzV1JJl3sPfZdz8aTfM,747
|
6
6
|
siat/assets_liquidity.py,sha256=o_UZdLs693uNWPEQB2OzxDH0mdWimOmq4qe_vx1pue0,28987
|
7
7
|
siat/assets_liquidity_test.py,sha256=UWk6HIUlizU7LQZ890fGx8LwU1jMMrIZswg8cFUJWZ8,1285
|
@@ -45,7 +45,7 @@ siat/financial_statements_test.py,sha256=FLhx8JD-tVVWSBGux6AMz1jioXX4U4bp9DmgFHY
|
|
45
45
|
siat/financials.py,sha256=hcXcwozYhfMtW6cTE2bDp5R80-IEKAyUHFO6mJ87GXQ,86267
|
46
46
|
siat/financials2 - 副本.py,sha256=dKlNjIfKeoSy055fQ6E6TUj9HEoO5Ney9grD84J5kfk,14389
|
47
47
|
siat/financials2.py,sha256=YF-A-5iSTzLXTFI0sDGju4_6T87wWC9IlFd4fSXbJXw,50805
|
48
|
-
siat/financials_china.py,sha256=
|
48
|
+
siat/financials_china.py,sha256=iHF3lEESTK9DLWLBHFpyxn3S_dO2sNBE89xqaVYpNCw,192459
|
49
49
|
siat/financials_china2.py,sha256=VvkzkjZeH84zwypR7ReldgJeZ7jnNw0qkzebvWMPm10,94956
|
50
50
|
siat/financials_china2_test.py,sha256=Erz5k4LyOplBBvYls2MypuqHpVNJ3daiLdyeJezNPu0,2722
|
51
51
|
siat/financials_china2_test2.py,sha256=C8CuYTMHN4Mhp-sTu-Bmg0zMXRCaYV6ezGDoYartRYQ,3507
|
@@ -64,7 +64,7 @@ siat/future_china.py,sha256=F-HsIf2Op8Z22RzTjet1g8COzldgnMjFNSXsAkeGyWo,17595
|
|
64
64
|
siat/future_china_test.py,sha256=BrSzmDVaOHki6rntOtosmRn-6dkfOBuLulJNqh7MOpc,1163
|
65
65
|
siat/global_index_test.py,sha256=hnFp3wqqzzL-kAP8mgxDZ54Bd5Ijf6ENi5YJlGBgcXw,2402
|
66
66
|
siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
|
67
|
-
siat/grafix.py,sha256=
|
67
|
+
siat/grafix.py,sha256=8aL8z5TF963T7GgW62iNL5h5P_HA_AxAVxmBJK3Os28,141240
|
68
68
|
siat/grafix_test.py,sha256=kXvcpLgQNO7wd30g_bWljLj5UH7bIVI0_dUtXbfiKR0,3150
|
69
69
|
siat/holding_risk.py,sha256=uWRtMMJqKr-puQn26g6Fq5N3mFB70c0B99zLQug8hAo,30774
|
70
70
|
siat/holding_risk_test.py,sha256=FRlw_9wFG98BYcg_cSj95HX5WZ1TvkGaOUdXD7-V86s,474
|
@@ -89,6 +89,7 @@ siat/option_china_test.py,sha256=UQ-YUHUjoGBQyanLcM-yzqeEIUQP_gCQIeT0W6rnUnA,163
|
|
89
89
|
siat/option_pricing.py,sha256=vyQNgBsjcJi70Pa-fJTVVIGK_3jWh80tkd1ESnn3sE4,74069
|
90
90
|
siat/option_pricing_test.py,sha256=eeorV5Ja5vjlRXnP6fWJHetGU5Vb8SnLopkC6RV3GfA,2203
|
91
91
|
siat/option_sina_api_test.py,sha256=dn-k_wrQnAaNKHoROvWJEc7lqlU0bwiV2Aa4usWAFGM,5908
|
92
|
+
siat/other_indexes.py,sha256=DXijuTBhXWj7xEAIGzeczbt1CcJlfxV0hQ_UIuqIdfk,6859
|
92
93
|
siat/proxy_test.py,sha256=erQJrmGs2X46z8Gb1h-7GYQ0rTUcaR8dxHExWoBz2eM,2610
|
93
94
|
siat/quandl_test.py,sha256=EcPoXnLuqzPl5dKyVEZi3j3PJZFpsnU_iNPhLWC9p-A,1552
|
94
95
|
siat/risk_adjusted_return.py,sha256=6F8CpKm-HKO4wfnndri0ew-D3lDAH1fs5O9K5cphoLg,55096
|
@@ -101,7 +102,7 @@ siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4
|
|
101
102
|
siat/sector_china.py,sha256=9zjdORWx5ia_gUezidhOKWmCnVDwWcnnjjugHudelaQ,157411
|
102
103
|
siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
|
103
104
|
siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
|
104
|
-
siat/security_price2.py,sha256=
|
105
|
+
siat/security_price2.py,sha256=2my4JgVIoQunQ-xDlHPGZRyBJ4KFuM6nVQTwqmauIK0,26966
|
105
106
|
siat/security_prices.py,sha256=HoCZ7YPrQYZHgKC-LyXFeeBCTfRc3EMMEiEg52SVv2w,109073
|
106
107
|
siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
|
107
108
|
siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
|
@@ -109,7 +110,7 @@ siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmW
|
|
109
110
|
siat/security_trend2.py,sha256=8-Z-PWaX8fjnyAyfxEp3qXdVllgDpRISOASKEn7Zeoc,30706
|
110
111
|
siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
|
111
112
|
siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
|
112
|
-
siat/stock.py,sha256=
|
113
|
+
siat/stock.py,sha256=itQquZpB8B086nmzzGadppGKsTE6Y7aGizhamGIXs0I,159860
|
113
114
|
siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
|
114
115
|
siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
|
115
116
|
siat/stock_china.py,sha256=85Ggb21E2mrCYMdSSTTrkoyyLGXMK2V-BtlweHomSRg,93460
|
@@ -135,7 +136,7 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
|
|
135
136
|
siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
|
136
137
|
siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
|
137
138
|
siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
|
138
|
-
siat/translate.py,sha256=
|
139
|
+
siat/translate.py,sha256=m8mDVHilsw9nSIGBcvl_pS-aMy3W7UVKEZsLwhfuIEg,263300
|
139
140
|
siat/translate_20240606.py,sha256=63IyHWEU3Uz9mjwyuAX3fqY4nUMdwh0ICQAgmgPXP7Y,215121
|
140
141
|
siat/translate_241003_keep.py,sha256=un7Fqe1v35MXsja5exZgjmLzrZtt66NARZIGlyFuGGU,218747
|
141
142
|
siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
|
@@ -144,8 +145,8 @@ siat/valuation_china.py,sha256=eSKIDckyjG8QkENlW_OKkqbQHno8pzDcomBO9iGNJVM,83079
|
|
144
145
|
siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
145
146
|
siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
|
146
147
|
siat/yf_name.py,sha256=laNKMTZ9hdenGX3IZ7G0a2RLBKEWtUQJFY9CWuk_fp8,24058
|
147
|
-
siat-3.
|
148
|
-
siat-3.
|
149
|
-
siat-3.
|
150
|
-
siat-3.
|
151
|
-
siat-3.
|
148
|
+
siat-3.9.1.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
|
149
|
+
siat-3.9.1.dist-info/METADATA,sha256=TdLVtDZHF0gBr7cfi0UwFMXUD69-PUAsoZIRgwTu2MA,8334
|
150
|
+
siat-3.9.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
151
|
+
siat-3.9.1.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
152
|
+
siat-3.9.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|