siat 3.2.53__py3-none-any.whl → 3.2.55__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/beta_adjustment.py CHANGED
@@ -991,7 +991,7 @@ def compare_mhamada(tickers,market_index="000001.SS"):
991
991
 
992
992
  import pandas as pd
993
993
  df=pd.DataFrame()
994
- print("Starting to retrive and calculate Hamada ratios, please wait ......")
994
+ print("Starting to retrieve and calculate Hamada ratios, please wait ......")
995
995
  for t in tickers:
996
996
 
997
997
  with HiddenPrints():
siat/capm_beta2.py CHANGED
@@ -285,7 +285,7 @@ def compare_mticker_1beta(ticker,start,end, \
285
285
  RF=RF[0]
286
286
  if isinstance(regression_period,list):
287
287
  regression_period=regression_period[0]
288
- print(" Starting to retrive and calculate capm beta, please wait ......")
288
+ print(" Starting to retrieve and calculate capm beta, please wait ......")
289
289
 
290
290
  #计算日历日regression_period对应的交易日数
291
291
  regtrddays=int(252 / 365 * regression_period)
@@ -406,7 +406,7 @@ def compare_1ticker_mRF(ticker,start,end, \
406
406
  RF=[RF]
407
407
  if isinstance(regression_period,list):
408
408
  regression_period=regression_period[0]
409
- print(" Starting to retrive and calculate capm beta on different RF, please wait ......")
409
+ print(" Starting to retrieve and calculate capm beta on different RF, please wait ......")
410
410
 
411
411
  #计算日历日regression_period对应的交易日数
412
412
  regtrddays=int(252 / 365 * regression_period)
@@ -525,7 +525,7 @@ def compare_1ticker_mregression_period(ticker,start,end, \
525
525
  RF=RF[0]
526
526
  if isinstance(regression_period,int):
527
527
  regression_period=[regression_period]
528
- print(" Starting to retrive and calculate capm beta on different regression period, please wait ......")
528
+ print(" Starting to retrieve and calculate capm beta on different regression period, please wait ......")
529
529
 
530
530
  #预处理ticker_type
531
531
  ticker_type=ticker_type_preprocess_mticker_mixed(ticker,ticker_type)
siat/common.py CHANGED
@@ -2445,7 +2445,7 @@ def descriptive_statistics2(df,titletxt,footnote,decimals=4,sortby='tpw_mean', \
2445
2445
  "近期优先加权平均":text_lang("近期优先加权平均","RWA"), \
2446
2446
  "期间趋势":text_lang("期间趋势","Periodic Trend"), \
2447
2447
  "近期趋势":text_lang("近期趋势","Recent Trend"), \
2448
- "推荐标记":text_lang("推荐标记","Recommend")},inplace=True)
2448
+ "推荐标记":text_lang("推荐标记","Recommendation")},inplace=True)
2449
2449
 
2450
2450
  df_display_CSS(dst6,titletxt=titletxt,footnote=footnote,facecolor=facecolor, \
2451
2451
  titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
@@ -1250,7 +1250,7 @@ def compare_mrar(tickers,rar_name,start,end, \
1250
1250
 
1251
1251
  import pandas as pd
1252
1252
  df=pd.DataFrame()
1253
- print(" Starting to retrive and calculate",rar_name,"ratio, please wait ......")
1253
+ print(" Starting to retrieve and calculate",rar_name,"ratio, please wait ......")
1254
1254
  for t in tickers:
1255
1255
 
1256
1256
  pf={'Market':(market,market_index),t:1.0}
@@ -598,7 +598,7 @@ def compare_1ticker_mrar(ticker,start,end,rar=['sharpe','sortino','treynor','alp
598
598
  regression_period=regression_period[0]
599
599
 
600
600
  tname=ticker_name(ticker,ticker_type)
601
- print(" Starting to retrive and calculate different rar for",tname,"\b, please wait ......\n")
601
+ print(" Starting to retrieve and calculate different rar for",tname,"\b, please wait ......\n")
602
602
 
603
603
  #预处理ticker_type
604
604
  ticker_type=ticker_type_preprocess_mticker_mixed(ticker,ticker_type)
@@ -679,10 +679,10 @@ def compare_1ticker_mrar(ticker,start,end,rar=['sharpe','sortino','treynor','alp
679
679
  sortby_txt=text_lang('按推荐标记+短期均值走势降序排列',"by Recommend + Recent Trend, Descending")
680
680
 
681
681
  #title_txt='***** 风险调整收益评估:'+tname+','+sortby_txt+' *****'
682
- title_txt=text_lang('风险调整收益评估:基于',"RAR Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
682
+ title_txt=text_lang('风险调整收益评估:基于',"Risk-adjusted Return Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
683
683
 
684
- footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent uses ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " trading days. Trend change threshhold ")+str(trend_threshhold)
685
- footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recent trend rated by multiple factors, Recommend max 5 stars. RWA=Recent Weighted Average")
684
+ footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent = ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " days. Trend threshhold ")+str(trend_threshold)
685
+ footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recommend max 5 stars. RWA = Recent Weighted Average")
686
686
  footnotey=footnote6+footnote7+'\n'+footnotex
687
687
 
688
688
  recommenddf=descriptive_statistics2(df1,title_txt,footnotey,decimals=4, \
@@ -749,7 +749,7 @@ def compare_mticker_1rar(ticker,start,end,rar='sharpe', \
749
749
  RF=RF[0]
750
750
  if isinstance(regression_period,list):
751
751
  regression_period=regression_period[0]
752
- print(" Starting to retrive and calculate",rar,"\b, please wait ......\n")
752
+ print(" Starting to retrieve and calculate",rar,"\b, please wait ......\n")
753
753
 
754
754
  #预处理ticker_type
755
755
  ticker_type_list=ticker_type_preprocess_mticker_mixed(ticker,ticker_type)
@@ -792,8 +792,16 @@ def compare_mticker_1rar(ticker,start,end,rar='sharpe', \
792
792
  axhline_label='零线' #显示零线,但不标注图例
793
793
  #df1.rename(columns={c:ticker_name(c)},inplace=True)
794
794
 
795
- #共同脚注
796
- footnote1=text_lang("注:","Notes: ")+ectranslate(rar)+text_lang("基于"," is based on ")+ectranslate(ret_type)+text_lang("。",", ")
795
+ #共同脚注
796
+ rar_text=ectranslate(rar)
797
+ if check_language()=="English":
798
+ if rar != "alpha":
799
+ rar_text=rar_text.title()+" Ratio"
800
+ else:
801
+ #rar_text=rar_text.title()
802
+ rar_text="Jensen Alpha"
803
+
804
+ footnote1=text_lang("注:","")+rar_text.capitalize()+text_lang("基于"," is based on ")+ectranslate(ret_type)+text_lang("。",", ")
797
805
  if RF !=0:
798
806
  footnote2=text_lang("年化无风险利率","annual RF = ")+str(round(RF*100,4))+text_lang('%。','%')
799
807
  else:
@@ -801,7 +809,15 @@ def compare_mticker_1rar(ticker,start,end,rar='sharpe', \
801
809
 
802
810
  footnote3=''
803
811
  if rar.lower() in ['treynor','alpha']:
804
- footnote3="贝塔系数回归期间"+str(regression_period)+"个自然日"
812
+ mktidx_text=''
813
+ if mktidx != 'auto':
814
+ mktidx_text=ticker_name(mktidx)
815
+
816
+ if mktidx != 'auto':
817
+ footnote3=text_lang("CAPM回归期间","\nCAPM regression period ")+str(regression_period)+text_lang("个自然日,"," days, ")+ \
818
+ text_lang("市场指数基于","using ")+mktidx_text
819
+ else:
820
+ footnote3=text_lang("CAPM回归期间","\nCAPM regression period ")+str(regression_period)+text_lang("个自然日"," days")
805
821
 
806
822
  import datetime; todaydt = datetime.date.today()
807
823
  footnote4=text_lang("数据来源: 综合新浪/Stooq/Yahoo,","Data source: Sina/Stooq/Yahoo, ")+str(todaydt)
@@ -812,8 +828,9 @@ def compare_mticker_1rar(ticker,start,end,rar='sharpe', \
812
828
 
813
829
  #绘图
814
830
  if graph:
815
- title_txt=text_lang("风险调整收益:","Risk-adjusted Return: ")+ectranslate(rar)
816
- y_label=ectranslate(rar)
831
+
832
+ title_txt=text_lang("风险调整收益:","Risk-adjusted Return: ")+rar_text
833
+ y_label=rar_text
817
834
 
818
835
  draw_lines(df1,y_label,x_label=footnotex, \
819
836
  axhline_value=axhline_value,axhline_label=axhline_label, \
@@ -837,10 +854,10 @@ def compare_mticker_1rar(ticker,start,end,rar='sharpe', \
837
854
  sortby_txt=text_lang('按推荐标记+短期均值走势降序排列',"by Recommend + Recent Trend, Descending")
838
855
 
839
856
  #title_txt='***** 风险调整收益评估:基于'+ectranslate(rar)+','+sortby_txt+' *****'
840
- title_txt=text_lang('风险调整收益评估:基于',"RAR Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
857
+ title_txt=text_lang('风险调整收益评估:基于',"Risk-adjusted Return Evaluation: Based on ")+rar_text+text_lang(',',', ')+sortby_txt
841
858
 
842
- footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent uses ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " trading days. Trend change threshhold ")+str(trend_threshhold)
843
- footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recent trend rated by multiple factors, Recommend max 5 stars. RWA=Recent Weighted Average")
859
+ footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent = ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " days. Trend threshhold ")+str(trend_threshhold)
860
+ footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recommend max 5 stars. RWA = Recent Weighted Average")
844
861
  footnotey=footnote6+'\n'+footnote7+'\n'+footnotex
845
862
 
846
863
  #不能简单删除含有Nan的行,否则导致清空df1,应该进行填充
@@ -934,15 +951,15 @@ def compare_mticker_mrar(ticker,start,end,rar=['sharpe','alpha','sortino','treyn
934
951
  pd.set_option('display.width', 180) #设置打印宽度(**重要**)
935
952
 
936
953
  if sortby=='tpw_mean':
937
- sortby_txt='近期优先加权平均值优先'
954
+ sortby_txt=text_lang('按推荐标记+近期优先加权平均值降序排列',"by Recommend + RWA, Descending")
938
955
  elif sortby=='min':
939
- sortby_txt='最小值优先'
956
+ sortby_txt=text_lang('按推荐标记+最小值降序排列',"by Recommend + Min, Descending")
940
957
  elif sortby=='mean':
941
- sortby_txt='平均值优先'
958
+ sortby_txt=text_lang('按推荐标记+平均值降序排列',"by Recommend + Mean, Descending")
942
959
  elif sortby=='median':
943
- sortby_txt='中位数值优先'
960
+ sortby_txt=text_lang('按推荐标记+中位数值降序排列',"by Recommend + Median, Descending")
944
961
  elif sortby=='trailing':
945
- sortby_txt='短期均值走势优先'
962
+ sortby_txt=text_lang('按推荐标记+短期均值走势降序排列',"by Recommend + Recent Trend, Descending")
946
963
 
947
964
  df1=df.copy()
948
965
  df1.reset_index(drop=True,inplace=True)
@@ -950,7 +967,7 @@ def compare_mticker_mrar(ticker,start,end,rar=['sharpe','alpha','sortino','treyn
950
967
 
951
968
  # 处理表格标题
952
969
  #titletxt='===风险调整收益综合对比:'+sortby_txt+'==='
953
- titletxt='风险调整收益综合对比:'+sortby_txt
970
+ titletxt=text_lang('风险调整收益综合对比:',"Risk-adjusted Return Overall Evaluation: ")+sortby_txt
954
971
  """
955
972
  #print("\n"+titletxt)
956
973
  df2=df1.style.set_caption(titletxt).set_table_styles(
@@ -1020,18 +1037,18 @@ def compare_mticker_mrar(ticker,start,end,rar=['sharpe','alpha','sortino','treyn
1020
1037
  """
1021
1038
 
1022
1039
  #脚注
1023
- footnote1="风险调整收益基于"+ectranslate(ret_type)+","
1040
+ footnote1=text_lang("风险调整收益基于","Based on ")+ectranslate(ret_type)+text_lang(",",', ')
1024
1041
  if RF !=0:
1025
- footnote2="年化无风险利率"+str(round(RF*100,4))+'%'
1042
+ footnote2=text_lang("年化无风险利率","annual RF = ")+str(round(RF*100,4))+'%'
1026
1043
  else:
1027
- footnote2=text_lang("假设年化无风险利率为零","Assume annual RF = 0")
1044
+ footnote2=text_lang("假设年化无风险利率为零","assuming annual RF = 0")
1028
1045
 
1029
1046
  footnote3=''
1030
1047
  if 'treynor' in rar or 'alpha' in rar:
1031
1048
  if mktidx=='auto':
1032
1049
  mktidx=get_market_index_code(ticker[0] if isinstance(ticker,list) else ticker)
1033
1050
  mktidx_name=ticker_name(mktidx)
1034
- footnote3="贝塔系数基于"+mktidx_name+",回归期间"+str(regression_period)+"个自然日"
1051
+ footnote3=text_lang("CAPM基于","CAPM based on ")+mktidx_name+text_lang(",回归期间",", regression in ")+str(regression_period)+text_lang("个自然日"," days")
1035
1052
 
1036
1053
  import datetime; todaydt = datetime.date.today()
1037
1054
  footnote4=text_lang("数据来源: 综合新浪/Stooq/Yahoo,","Data source: Sina/Stooq/Yahoo, ")+str(todaydt)+text_lang("统计",'')
@@ -1042,8 +1059,12 @@ def compare_mticker_mrar(ticker,start,end,rar=['sharpe','alpha','sortino','treyn
1042
1059
 
1043
1060
  #print("\n"+footnotex)
1044
1061
  #print(footnotex)
1045
-
1046
- df_display_CSS(df1,titletxt=titletxt,footnote=footnotex,decimals=4)
1062
+ if check_language()=="English":
1063
+ df1.rename(columns={"比较对象":"Securities","sharpe":"Sharpe Ratio","sortino":"Sortino Ratio","alpha":"Jensen Alpha","treynor":"Treynor Ratio","综合推荐":"Overall Recommendation"},inplace=True)
1064
+
1065
+ df_display_CSS(df1,titletxt=titletxt,footnote=footnotex,decimals=4, \
1066
+ first_col_align='left',second_col_align='center', \
1067
+ last_col_align='center',other_col_align='center')
1047
1068
 
1048
1069
  return df
1049
1070
 
@@ -1100,7 +1121,7 @@ def compare_1ticker_1rar_mret(ticker,start,end,rar='sharpe', \
1100
1121
  RF=RF[0]
1101
1122
  if isinstance(regression_period,list):
1102
1123
  regression_period=regression_period[0]
1103
- print(" Starting to retrive and calculate",rar,"for",ticker_name(ticker,ticker_type),"on different types of return, please wait ......\n")
1124
+ print(" Starting to retrieve and calculate",rar,"for",ticker_name(ticker,ticker_type),"on different types of return, please wait ......\n")
1104
1125
 
1105
1126
  df=pd.DataFrame()
1106
1127
  for t in ret_type:
@@ -1178,10 +1199,10 @@ def compare_1ticker_1rar_mret(ticker,start,end,rar='sharpe', \
1178
1199
  sortby_txt=text_lang('按推荐标记+短期均值走势降序排列',"by Recommend + Recent Trend, Descending")
1179
1200
 
1180
1201
  #title_txt='***** 风险调整收益评估:'+'基于'+ectranslate(rar)+','+ticker_name(ticker,ticker_type)+','+sortby_txt+' *****'
1181
- title_txt=text_lang('风险调整收益评估:基于',"RAR Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
1202
+ title_txt=text_lang('风险调整收益评估:基于',"Risk-adjusted Return Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
1182
1203
 
1183
- footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent means ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " trading days. Trend change threshhold is ")+str(trend_threshhold)
1184
- footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recent trend is rated by multiple factors, Recommend max 5 stars. RWA=Recent Weighted Average")
1204
+ footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent = ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " days. Trend threshhold ")+str(trend_threshhold)
1205
+ footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recommend max 5 stars. RWA = Recent Weighted Average")
1185
1206
  footnotey=footnote6+footnote7+'\n'+footnotex
1186
1207
 
1187
1208
  #删除含有Nan的行
@@ -1247,7 +1268,7 @@ def compare_1ticker_1rar_1ret_mRF(ticker,start,end,rar='sharpe', \
1247
1268
  RF=[RF]
1248
1269
  if isinstance(regression_period,list):
1249
1270
  regression_period=regression_period[0]
1250
- print(" Starting to retrive and calculate",rar,"for",ticker_name(ticker,ticker_type),"on different RF, please wait ......\n")
1271
+ print(" Starting to retrieve and calculate",rar,"for",ticker_name(ticker,ticker_type),"on different RF, please wait ......\n")
1251
1272
 
1252
1273
  df=pd.DataFrame()
1253
1274
  for t in RF:
@@ -1280,7 +1301,7 @@ def compare_1ticker_1rar_1ret_mRF(ticker,start,end,rar='sharpe', \
1280
1301
  #df1.rename(columns={c:"基于无风险利率"+c},inplace=True)
1281
1302
 
1282
1303
  #共同脚注
1283
- footnote1=text_lang("注:","Notes: ")+ectranslate(rar)+text_lang("基于"," is based on ")+ectranslate(ret_type)+'。'
1304
+ footnote1=text_lang("注:","")+ectranslate(rar)+text_lang("基于"," is based on ")+ectranslate(ret_type)+'。'
1284
1305
  footnote2=""
1285
1306
 
1286
1307
  footnote3=""
@@ -1322,10 +1343,10 @@ def compare_1ticker_1rar_1ret_mRF(ticker,start,end,rar='sharpe', \
1322
1343
  sortby_txt=text_lang('按推荐标记+短期均值走势降序排列',"by Recommend + Recent Trend, Descending")
1323
1344
 
1324
1345
  #title_txt='***** 风险调整收益评估:'+'基于'+ectranslate(rar)+','+ticker_name(ticker,ticker_type)+','+sortby_txt+' *****'
1325
- title_txt=text_lang('风险调整收益评估:基于',"RAR Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
1346
+ title_txt=text_lang('风险调整收益评估:基于',"Risk-adjusted Return Evaluation: Based on ")+ectranslate(rar)+text_lang(',',', ')+sortby_txt
1326
1347
 
1327
- footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent uses ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " trading days. Trend change threshhold ")+str(trend_threshhold)
1328
- footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recent trend rated by multiple factors, Recommend max 5 stars. RWA=Recent Weighted Average")
1348
+ footnote6=text_lang('期间为',"Period: ")+str(start)+text_lang('至'," to ")+str(end)+text_lang(";近期指近","; Recent = ")+str(trailing)+text_lang("个交易日。趋势变化率阈值:", " days. Trend threshhold ")+str(trend_threshhold)
1349
+ footnote7=text_lang("近期优先趋势和星号为风险调整收益指标加趋势等多项因素综合研判,最多五颗星","Recommend max 5 stars. RWA = Recent Weighted Average")
1329
1350
  footnotey=footnote6+footnote7+'\n'+footnotex
1330
1351
 
1331
1352
  #删除含有Nan的行
siat/stock_technical.py CHANGED
@@ -1193,31 +1193,40 @@ def stock_MACD(ticker,start='default',end='default', \
1193
1193
  #==============================================================================
1194
1194
  #==============================================================================
1195
1195
  #==============================================================================
1196
+ if __name__ =="__main__":
1197
+ talib_install_method()
1198
+
1199
+
1200
+ def is_64bit_os():
1201
+ import platform
1202
+ if platform.machine().endswith('64'):
1203
+ bits='64'
1204
+ else:
1205
+ bits='32'
1206
+
1207
+ return bits+'-bit'
1196
1208
 
1197
1209
  def talib_install_method():
1198
1210
  """
1199
1211
  功能:提示必需的talib安装方法
1200
1212
  """
1201
- print(" Installation method 1: pip install TA_Lib")
1202
- print(" Note: method 1 is subject to fail")
1203
- print(" Installation method 2: conda install -c quantopian ta-lib")
1204
- print(" Note: method 2 may need scientific internet access")
1205
- print(" Installation method 3: recommended")
1206
- print(" Step1. Goto website https://www.lfd.uci.edu/~gohlke/pythonlibs/")
1207
- print(" Step2. On the web page, search for TA_lib")
1208
- print(" Step3. Select the file suitable for the Python version and OS 32/64")
1209
- print(" Your Python version:",check_python_version(),"\b, your operating system:",check_os())
1210
-
1211
- print(" Step4. Download the file")
1212
- print(" Step5. pip install <downloaded file name>")
1213
- print(" Note: method 3 is troublesome, but more likely successful")
1213
+ print(" Warning: the classical method may not work properly:")
1214
+ print(" pip install TA-Lib\n")
1215
+ print(" Installation method: for Windows")
1216
+ print(" Step1. Check your Python version and your OS")
1217
+ print(" Your Python version:",check_python_version(),"\b, your OS:",is_64bit_os(),check_os())
1214
1218
 
1215
- print(" How to check the Python version in your computer? ")
1216
- print(" python --version")
1217
- print(" How to check the win32/win_amd64 in your computer? ")
1218
- print(" On Windows, right click Start, click System")
1219
+ print(" Step2. Search TA_lib whl file for your OS and Python version")
1220
+ print(" e.g. Find the one free of charge from CSDN, ... ...\n")
1221
+ print(" Step3. Download the file to a local folder in your computer")
1222
+ print(" Step4. Directly install the .whl file from the local folder by:")
1223
+ print(" pip install ta_lib_whl_file_name")
1224
+
1225
+ print("\n Installation method: for Mac, not tested for M chip")
1226
+ print(" Step1. brew install ta-lib")
1227
+ print(" Step2. pip install ta-lib")
1219
1228
 
1220
- print(" Important: after installing ta-lib, restart Python environment.")
1229
+ print("\n Important: after installing ta-lib, RESTART your Jupyter.")
1221
1230
 
1222
1231
  return
1223
1232
  #==============================================================================
@@ -1375,11 +1384,11 @@ def stock_RSI(ticker,start='default',end='default', \
1375
1384
 
1376
1385
  # 绘制曲线
1377
1386
  if ('RSI1' in graph) or ('ALL' in graph):
1378
- ax.plot(df4['RSI1'],label=text_lang('快速(周)线RSI1','RSI1(1 week, Fast line)'),linewidth=linewidth*2,color='orange')
1387
+ ax.plot(df4['RSI1'],label=text_lang('快速线RSI1','RSI1(Fast line)'),linewidth=linewidth*2,color='orange')
1379
1388
  if ('RSI2' in graph) or ('ALL' in graph):
1380
- ax.plot(df4['RSI2'],label=text_lang('中速(双周)线RSI2','RSI2(2 weeks, Mid line)'),linewidth=linewidth*2,color='purple')
1389
+ ax.plot(df4['RSI2'],label=text_lang('中速线RSI2','RSI2(Mid line)'),linewidth=linewidth*2,color='purple')
1381
1390
  if ('RSI3' in graph) or ('ALL' in graph):
1382
- ax.plot(df4['RSI3'],label=text_lang('慢速(月)线RSI3','RSI3(1 month, Slow line)'),linewidth=linewidth*2,color='white')
1391
+ ax.plot(df4['RSI3'],label=text_lang('慢速线RSI3','RSI3(Slow line)'),linewidth=linewidth*2,color='white')
1383
1392
 
1384
1393
  # 绘制水平辅助线
1385
1394
  #hl_linestyle_list=['dashed','-.','dotted']
@@ -1645,11 +1654,11 @@ def stock_KDJ(ticker,start='default',end='default', \
1645
1654
 
1646
1655
  # 绘制曲线
1647
1656
  if ('K' in graph) or ('ALL' in graph):
1648
- ax.plot(df4['K'],label=text_lang('快速线K','K line(Fast)'),linewidth=linewidth*2,color='orange')
1657
+ ax.plot(df4['K'],label=text_lang('快速线K','K(Fast line)'),linewidth=linewidth*2,color='orange')
1649
1658
  if ('D' in graph) or ('ALL' in graph):
1650
- ax.plot(df4['D'],label=text_lang('慢速线D','D line(Slow)'),linewidth=linewidth*2,color='green')
1659
+ ax.plot(df4['D'],label=text_lang('慢速线D','D(Slow line)'),linewidth=linewidth*2,color='green')
1651
1660
  if ('J' in graph) or ('ALL' in graph):
1652
- ax.plot(df4['J'],label=text_lang('超快确认线J','J line(Faster, confirm)'),linewidth=linewidth*2,color='purple')
1661
+ ax.plot(df4['J'],label=text_lang('超快线J','J(Faster line)'),linewidth=linewidth*2,color='purple')
1653
1662
 
1654
1663
  # 绘制水平辅助线: 某些情况下不绘制,以便展现KDJ线细节
1655
1664
  maxK=df4['K'].max()
siat/translate.py CHANGED
@@ -1951,6 +1951,12 @@ def codetranslate1(code):
1951
1951
  ['^NDQ','NASDAQ Composite Index'],['^NDX','NASDAQ 100 Index'],
1952
1952
  ['IBM','IBM Corp'],
1953
1953
 
1954
+ ['1155.KL','Maybank'],['5347.KL','Tenaga Nasional Berhad'],
1955
+ ['1295.KL','Public Bank Berhad'],['1066.KL','RHB Bank'],
1956
+ ['5819.KL','Hong Leong Bank'],['5183.KL','Petronas Chemical'],
1957
+ ['7113.KL','Top Glove Bhd'],['3182.KL','Genting Berhad'],
1958
+ ['6888.KL','Axiata Berhad'],['1015.KL','AmBank'],
1959
+
1954
1960
  ['000002.SS','SSE A Index'],['000003.SS','SSE B Index'],
1955
1961
  ['399107.SZ','SZE A Index'],['399108.SZ','SZE B Index'],
1956
1962
  ['399106.SZ','SZE Composite Index'],['399004.SZ','SZE100 Index'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.2.53
3
+ Version: 3.2.55
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -5,7 +5,7 @@ siat/alpha_vantage_test.py,sha256=tKr-vmuFH3CZAqwmISz6jzjPHzV1JJl3sPfZdz8aTfM,74
5
5
  siat/assets_liquidity.py,sha256=o_UZdLs693uNWPEQB2OzxDH0mdWimOmq4qe_vx1pue0,28987
6
6
  siat/assets_liquidity_test.py,sha256=UWk6HIUlizU7LQZ890fGx8LwU1jMMrIZswg8cFUJWZ8,1285
7
7
  siat/barrons_scraping_test.py,sha256=jSRVPxyYylcgG3fAsuqE-9WH3sDfJ3CdZUcU8VBVdoU,10110
8
- siat/beta_adjustment.py,sha256=LZWrEWP-yw7spQjeSldLXpmZu7pFqF5jR3EHym7wNys,37286
8
+ siat/beta_adjustment.py,sha256=viJJE9O82SbA_VYuJtrs3HT0OWYhk4yvmoywskrAhaI,37287
9
9
  siat/beta_adjustment_china.py,sha256=QAVhTQxfV7NSakNPMfQtGMeRzEHVBC8JZQTqD5Owp2I,20802
10
10
  siat/beta_adjustment_test.py,sha256=nBhvQQfqxooCHjy5hL0a8V0ZC58BjuCZVFpqpWpHeF0,2467
11
11
  siat/blockchain.py,sha256=awF3GDtlwaJhku0a2kLuXOS8d3IzkjR_RyzlZWvD3L4,6032
@@ -15,10 +15,10 @@ siat/bond_china.py,sha256=eYv-nMoWSS5fZ4VxnuJ29QFY9GUS6meGiIc0Xjm1fQI,3038
15
15
  siat/bond_test.py,sha256=yUOFw7ddGU-kb1rJdnsjkJWziDNgUR7OLDA7F7Ub91A,5246
16
16
  siat/bond_zh_sina.py,sha256=26BohGcS120utwqg9dJvdGm5OkuNpNu5bco80uOuQpU,4423
17
17
  siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
18
- siat/capm_beta2.py,sha256=07y3q4nJdkM-anpZepj4gK0gvTKj-BB0ppDDI5-TCcY,26904
18
+ siat/capm_beta2.py,sha256=d7lZ-VXVVmBkMVGDPlozL-9gAU3cYpHG23X1WSRCOgY,26907
19
19
  siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
20
20
  siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
21
- siat/common.py,sha256=493MZpsrKnb_RP1myq_uHj0wCdqvDk0kiRBzNF-syQI,151521
21
+ siat/common.py,sha256=ZRf7eq9trFmOSG_JQfWjcpSxn7B6ShB8bQ-kHi1qu9g,151526
22
22
  siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
23
23
  siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
24
24
  siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
@@ -87,8 +87,8 @@ siat/option_pricing_test.py,sha256=eeorV5Ja5vjlRXnP6fWJHetGU5Vb8SnLopkC6RV3GfA,2
87
87
  siat/option_sina_api_test.py,sha256=dn-k_wrQnAaNKHoROvWJEc7lqlU0bwiV2Aa4usWAFGM,5908
88
88
  siat/proxy_test.py,sha256=erQJrmGs2X46z8Gb1h-7GYQ0rTUcaR8dxHExWoBz2eM,2610
89
89
  siat/quandl_test.py,sha256=EcPoXnLuqzPl5dKyVEZi3j3PJZFpsnU_iNPhLWC9p-A,1552
90
- siat/risk_adjusted_return.py,sha256=dWVrCDnoxvMmI6cVtrL_FC18QZFrGb6-k9lOoyy5JGE,55085
91
- siat/risk_adjusted_return2.py,sha256=AkpxKIYv3LL1mvb6Lha4z0sevinsLLmb-ttwiJGHNO0,69083
90
+ siat/risk_adjusted_return.py,sha256=oRUOagpQlGB56R1xIHZoYwAi42RqcZl0R-JCVBCKVe0,55086
91
+ siat/risk_adjusted_return2.py,sha256=_ZJvinGmURdT37vgEtpd0DJIAI23HlC02oEmv_By4mA,70523
92
92
  siat/risk_adjusted_return_test.py,sha256=m_VHL5AtT74cJv5i7taTeTfnkX48y0AFJk5phawyYWg,3416
93
93
  siat/risk_evaluation.py,sha256=I6B3gty-t--AkDCO0tKF-291YfpnF-IkXcFjqNKCt9I,76286
94
94
  siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
@@ -117,7 +117,7 @@ siat/stock_prices_kneighbors.py,sha256=WfZvo5EyeBsm-T37zDj7Sl9dPSRq5Bx4JxIJ9IUum
117
117
  siat/stock_prices_linear.py,sha256=-OUKRr27L2aStQgJSlJOrJ4gay_G7P-m-7t7cU2Yoqk,13991
118
118
  siat/stock_profile.py,sha256=B3eIwzEmiCqiCaxIlhfdEPsQBoW1PFOe1hkiY3mVF6Y,26038
119
119
  siat/stock_technical-20240620.py,sha256=A4x18mZgYSA8SSiDz4u_O3gd5oVRgbI6JIiBfFY0tVw,116013
120
- siat/stock_technical.py,sha256=X0AqtpCih62-4ff8AnsNGEvDUVoo-sY5hTb3igc5yuE,134230
120
+ siat/stock_technical.py,sha256=1pdhk0FwiQ5v252EckmQMlr2RJQIgR3wDtaSeliDyxY,134192
121
121
  siat/stock_test.py,sha256=E9YJAvOw1VEGJSDI4IZuEjl0tGoisOIlN-g9UqA_IZE,19475
122
122
  siat/stooq.py,sha256=dOc_S5HLrYg48YAKTCs1eX8UTJOOkPM8qLL2KupqlLY,2470
123
123
  siat/temp.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
@@ -131,14 +131,14 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
131
131
  siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
132
132
  siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
133
133
  siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
134
- siat/translate.py,sha256=LIS4ybfYAk17lOFKu80ZLkvIXnTquBi90wTKcF8BCo0,216547
134
+ siat/translate.py,sha256=z2l2JKx6cQK-hvPt-hTIiK5SRvuPiL_ehLEIff3FqDQ,216890
135
135
  siat/translate_20240606.py,sha256=63IyHWEU3Uz9mjwyuAX3fqY4nUMdwh0ICQAgmgPXP7Y,215121
136
136
  siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
137
137
  siat/valuation.py,sha256=NKfeZMdDJOW42oLVHob6eSVBXUqlN1OCnnzwyGAst8c,48855
138
138
  siat/valuation_china.py,sha256=EkZQaVkoBjM0c4MCNbaX-bMnlG0e3FXeaWczZDnkptU,67784
139
139
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
140
140
  siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
141
- siat-3.2.53.dist-info/METADATA,sha256=CRsgADyYbTDreJlYNKtVB0p0uZdkKN603MoUoWPCwZo,7310
142
- siat-3.2.53.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
143
- siat-3.2.53.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
144
- siat-3.2.53.dist-info/RECORD,,
141
+ siat-3.2.55.dist-info/METADATA,sha256=zJ-SJEQaVRRrlmNS4L0WZ86GAQfMubiIP286T1U_Qc4,7310
142
+ siat-3.2.55.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
143
+ siat-3.2.55.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
144
+ siat-3.2.55.dist-info/RECORD,,
File without changes