siat 3.0.1__py3-none-any.whl → 3.0.2__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.
@@ -20,6 +20,7 @@ import warnings; warnings.filterwarnings('ignore')
20
20
  from siat.common import *
21
21
  from siat.translate import *
22
22
  from siat.security_prices import *
23
+ from siat.security_price2 import *
23
24
  from siat.capm_beta2 import *
24
25
  #from siat.fama_french import *
25
26
  from siat.risk_adjusted_return import *
siat/security_prices.py CHANGED
@@ -344,7 +344,7 @@ if __name__=='__main__':
344
344
 
345
345
  #在common中定义SUFFIX_LIST_CN
346
346
 
347
- def get_price_ak_em(ticker,fromdate,todate,adjust=''):
347
+ def get_price_ak_em(ticker,fromdate,todate,adjust='',ticker_type='auto'):
348
348
  """
349
349
  功能:基于东方财富从akshare获得中国国内的股票和指数历史行情,只能处理单个股票,处理指数有时出错
350
350
  ticker:雅虎格式,沪市股票为.SS,深市为.SZ,北交所为.BJ,其他的不处理,直接返回None
@@ -415,10 +415,13 @@ def get_price_ak_em(ticker,fromdate,todate,adjust=''):
415
415
  df1['footnote']=adjust
416
416
 
417
417
  num=len(df1)
418
+ ptname=ticker_name(ticker,ticker_type)
419
+ if ptname == ticker: ptname=''
420
+
418
421
  if num > 0:
419
- print(" Successfully retrieved",num,"records for",ticker,ticker_name(ticker,ticker_type))
422
+ print(" Successfully retrieved",num,"records for",ticker,ptname)
420
423
  else:
421
- print(" Sorry, no records retrieved for",ticker,ticker_name(ticker,ticker_type))
424
+ print(" Sorry, no records retrieved for",ticker,ptname)
422
425
 
423
426
  return df1
424
427
 
@@ -603,11 +606,14 @@ def get_price_stooq(ticker,start,end):
603
606
  _,start1,end1=check_period(start,end)
604
607
  prices2=prices[(prices.index >= start1) & (prices.index <= end1)]
605
608
  num=len(prices2)
609
+ ptname=ticker_name(ticker,'stock')
610
+ if ptname == ticker: ptname=''
611
+
606
612
  if num > 0:
607
- print(" Successfully retrieved",num,"records for",ticker,ticker_name(ticker,'stock'))
613
+ print(" Successfully retrieved",num,"records for",ticker,ptname)
608
614
  return prices2
609
615
  else:
610
- print(" Sorry, no records found from stooq for",ticker,ticker_name(ticker,'stock'),"from",start,'to',end)
616
+ print(" Sorry, no records found from stooq for",ticker,ptname,"from",start,'to',end)
611
617
  return None
612
618
  else:
613
619
  return None
@@ -890,9 +896,12 @@ def get_price_ak_cn(ticker,fromdate,todate,adjust='',ticker_type='auto'):
890
896
  if 'Adj Close' not in list(df2):
891
897
  df2['Adj Close']=df2['Close']
892
898
  df2['footnote']=adjust
899
+
900
+ ptname=ticker_name(ticker,ticker_type)
901
+ if ptname == ticker: ptname=''
893
902
 
894
903
  if len(df2) > 0:
895
- print(" Successfully retrieved",len(df2),"records for",ticker,ticker_name(ticker,ticker_type))
904
+ print(" Successfully retrieved",len(df2),"records for",ticker,ptname)
896
905
 
897
906
  return df2
898
907
 
@@ -955,8 +964,12 @@ def get_price_ak_us(symbol, fromdate, todate, adjust=""):
955
964
  df2['ticker']=symbol
956
965
  df2['Adj Close']=df2['Close']
957
966
  df2['source']='新浪'
958
- df2['footnote']=adjust
959
- print(" Successfully retrieved",num,"records for",symbol,ticker_name(symbol,ticker_type))
967
+ df2['footnote']=adjust
968
+
969
+ ptname=ticker_name(symbol,'stock')
970
+ if ptname == symbol: ptname=''
971
+
972
+ print(" Successfully retrieved",num,"records for",symbol,ptname)
960
973
 
961
974
  return df2
962
975
 
@@ -1025,7 +1038,11 @@ def get_price_ak_hk(symbol, fromdate, todate, adjust=""):
1025
1038
  df2['ticker']=symbol
1026
1039
  df2['Adj Close']=df2['Close']
1027
1040
  df2['source']='新浪'
1028
- print(" Successfully retrieved",num,"records for",symbol,ticker_name(symbol,ticker_type))
1041
+
1042
+ ptname=ticker_name(symbol,'stock')
1043
+ if ptname == symbol: ptname=''
1044
+
1045
+ print(" Successfully retrieved",num,"records for",symbol,ptname)
1029
1046
 
1030
1047
  return df2
1031
1048
 
@@ -1217,7 +1234,10 @@ def get_prices_yahoo(ticker,start,end,retry_count=3,pause=1):
1217
1234
  #p['Adj Close']=p['Close']
1218
1235
  p['source']='雅虎'
1219
1236
 
1220
- print(" Successfully retrieved",len(p),"records for",ticker,ticker_name(ticker,ticker_type))
1237
+ ptname=ticker_name(ticker,'stock')
1238
+ if ptname == ticker: ptname=''
1239
+
1240
+ print(" Successfully retrieved",len(p),"records for",ticker,ptname)
1221
1241
 
1222
1242
  return p
1223
1243
 
@@ -1299,7 +1319,10 @@ def get_prices_yf(ticker,start,end,threads=False):
1299
1319
  p['source']='雅虎'
1300
1320
 
1301
1321
  if len(p) > 0:
1302
- print(" Successfully retrieved",len(p),"records for",ticker1,ticker_name(ticker1,ticker_type))
1322
+ ptname=ticker_name(ticker1,'stock')
1323
+ if ptname == ticker: ptname=''
1324
+
1325
+ print(" Successfully retrieved",len(p),"records for",ticker1,ptname)
1303
1326
  else:
1304
1327
  pass
1305
1328
  #print(" #Error(get_prices_yf):",ticker1,"not found or no prices in the period or inaccessible to yahoo")
@@ -1362,7 +1385,10 @@ def get_index_fred(ticker,start,end):
1362
1385
 
1363
1386
  num=len(df)
1364
1387
  if num > 0:
1365
- print(" Successfully retrieved",num,"records for",ticker,ticker_name(ticker,ticker_type))
1388
+ ptname=ticker_name(ticker,'stock')
1389
+ if ptname == ticker: ptname=''
1390
+
1391
+ print(" Successfully retrieved",num,"records for",ticker,ptname)
1366
1392
  else:
1367
1393
  print(" Sorry, no records retrieved for",ticker)
1368
1394
 
siat/security_trend2.py CHANGED
@@ -97,7 +97,7 @@ def security_trend(ticker,indicator='Close', \
97
97
  preprocess='none',scaling_option='start', \
98
98
  annotate=False,annotate_value=False, \
99
99
  printout=False,source='auto', \
100
- mark_top=True,mark_bottom=True,mark_end=False, \
100
+ mark_top=False,mark_bottom=False,mark_end=False, \
101
101
  ticker_type='auto'):
102
102
 
103
103
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.0.1
3
+ Version: 3.0.2
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
@@ -84,7 +84,7 @@ siat/option_sina_api_test.py,sha256=dn-k_wrQnAaNKHoROvWJEc7lqlU0bwiV2Aa4usWAFGM,
84
84
  siat/proxy_test.py,sha256=erQJrmGs2X46z8Gb1h-7GYQ0rTUcaR8dxHExWoBz2eM,2610
85
85
  siat/quandl_test.py,sha256=EcPoXnLuqzPl5dKyVEZi3j3PJZFpsnU_iNPhLWC9p-A,1552
86
86
  siat/risk_adjusted_return.py,sha256=dtuetKL5Vu38SdH_hqV93eN851uZ-1hOvf1drKel92w,54740
87
- siat/risk_adjusted_return2.py,sha256=byHgnRTPw781-CuUqCKw9O9U8qTLdTrDsHrFv0Q0BNA,56955
87
+ siat/risk_adjusted_return2.py,sha256=MdNrqDaw2IbjitkZrjrqbOQJJkfI2sLvce6gmAAKmrc,56991
88
88
  siat/risk_adjusted_return_test.py,sha256=m_VHL5AtT74cJv5i7taTeTfnkX48y0AFJk5phawyYWg,3416
89
89
  siat/risk_evaluation.py,sha256=tNobb3FoP7rdqC_KHwgU0VhZvSwfeg2Rp3NkaSndqIY,75969
90
90
  siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
@@ -94,10 +94,10 @@ siat/sector_china.py,sha256=r4w7o9PEiZjMRB4pkKVbA9afk7A7Wh8toudocN8mN5I,104413
94
94
  siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
95
95
  siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
96
96
  siat/security_price2.py,sha256=kuYh0V5cqclkM6MjZUd-N361fv3oxGVVerYINuTzZrE,24622
97
- siat/security_prices.py,sha256=bJXm2lf3r0w40GXx2V90UkfCDOwRgz5PagQQLhY6HoE,101129
97
+ siat/security_prices.py,sha256=gSmnXt3EtTxUvETwUVzIC95j8U4Tivr1AU5RwzmKQzo,101601
98
98
  siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
99
99
  siat/security_trend.py,sha256=BNZm0Yujs3V6tlOirtcKqsKAegy36shWXGen_c4KwBo,17204
100
- siat/security_trend2.py,sha256=EDeUC9g9F4aeezsGUsOcW6o_JuuCMx6VbUr_sRKD-JY,23617
100
+ siat/security_trend2.py,sha256=hQ-cIOL-XXjBaEEEuo4m-3GPKp5of_G4zDI9tR0H2uU,23619
101
101
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
102
102
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
103
103
  siat/stock.py,sha256=aMpmvcMyAfl2hbH3AjCLO5mGAUsEFlbYUbXYWDGrC3w,134797
@@ -131,7 +131,7 @@ siat/valuation.py,sha256=3SopU5yomIXg6zH6oVFiBJyZosndFxOo1AINnbwW0lo,47334
131
131
  siat/valuation_china.py,sha256=oEQRrktJNHiOG1mJSQN1aSSQAQrwrg-ppIHyNVjMjNg,67603
132
132
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
133
133
  siat/var_model_validation.py,sha256=3LY2JLvVpPNZLomHMUZvD2-nbL64ACtD7LKrNTk6JmU,14862
134
- siat-3.0.1.dist-info/METADATA,sha256=Sl93-sUYX7PcXXu2fmmw8P7nGvYa509r4_rBvHpkmr4,1447
135
- siat-3.0.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
136
- siat-3.0.1.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
137
- siat-3.0.1.dist-info/RECORD,,
134
+ siat-3.0.2.dist-info/METADATA,sha256=4-3GqcuZz9CTk0KYbzJcicp_8JaTwMZ6eIZNv1fTO3E,1447
135
+ siat-3.0.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
136
+ siat-3.0.2.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
137
+ siat-3.0.2.dist-info/RECORD,,
File without changes