siat 2.14.1__py3-none-any.whl → 3.0.0__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/assets_liquidity.py +16 -16
- siat/beta_adjustment.py +6 -6
- siat/beta_adjustment_china.py +9 -9
- siat/bond.py +71 -67
- siat/capm_beta.py +11 -11
- siat/capm_beta2.py +49 -23
- siat/common.py +451 -76
- siat/compare_cross.py +15 -82
- siat/exchange_bond_china.pickle +0 -0
- siat/fama_french.py +3 -3
- siat/financials.py +15 -15
- siat/financials2.py +8 -8
- siat/financials_china.py +20 -20
- siat/financials_china2.py +25 -25
- siat/fund_china.pickle +0 -0
- siat/fund_china.py +5 -4
- siat/grafix.py +197 -132
- siat/markowitz.py +6 -5
- siat/option_china.py +1 -1
- siat/option_pricing.py +6 -6
- siat/risk_adjusted_return.py +14 -14
- siat/risk_adjusted_return2.py +64 -42
- siat/risk_evaluation.py +32 -32
- siat/risk_free_rate.py +0 -0
- siat/sector_china.py +3 -195
- siat/security_price2.py +616 -0
- siat/security_prices.py +935 -308
- siat/security_trend2.py +28 -47
- siat/stock.py +225 -437
- siat/stock_china.py +19 -19
- siat/stock_info.pickle +0 -0
- siat/stock_technical.py +547 -144
- siat/transaction.py +3 -3
- siat/translate.py +781 -24
- siat/valuation.py +6 -6
- siat/var_model_validation.py +2 -2
- {siat-2.14.1.dist-info → siat-3.0.0.dist-info}/METADATA +1 -1
- {siat-2.14.1.dist-info → siat-3.0.0.dist-info}/RECORD +41 -40
- {siat-2.14.1.dist-info → siat-3.0.0.dist-info}/WHEEL +0 -0
- {siat-2.14.1.dist-info → siat-3.0.0.dist-info}/top_level.txt +0 -0
siat/stock_china.py
CHANGED
@@ -676,7 +676,7 @@ def price_direction_knn(ticker,df,ndays=1,diff=0.01,min_score=0.9,votes=100,max_
|
|
676
676
|
if not printout: return decision,today_close,today
|
677
677
|
|
678
678
|
print(" Model voting for stock price after "+str(ndays)+" trading days: Higher("+str(zhang)+'), Lower('+str(die)+')')
|
679
|
-
print(" "+
|
679
|
+
print(" "+ticker_name(ticker)+': previously closed '+str(known_close)+' @ '+str(known_day))
|
680
680
|
|
681
681
|
ndate=date_adjust(known_day,adjust=ndays)
|
682
682
|
print(" Prediction to close at",decision_text,"price trend ("+decision+') @',ndate)
|
@@ -726,7 +726,7 @@ def forecast_direction_knn(ticker,ndays=1,diff=0.01,min_score=0.9,votes=100,max_
|
|
726
726
|
max_RS=max_RS)
|
727
727
|
decisionlist=decisionlist+[decision]
|
728
728
|
|
729
|
-
print("\nStock information:",
|
729
|
+
print("\nStock information:",ticker_name(ticker),'\b, closed',known_close,'@',known_day)
|
730
730
|
for nd in list(range(1,ndays+1)):
|
731
731
|
ndate=date_adjust(known_day, adjust=nd)
|
732
732
|
print("Forecasting stock close price trend on",ndate,end=': ')
|
@@ -952,7 +952,7 @@ def price_price_knn(ticker,df,ndays=1,max_neighbours=10,max_RS=20,printout=True)
|
|
952
952
|
if not printout: return decision,decision_score,today_close,today
|
953
953
|
|
954
954
|
print(" Model poll for stock price after "+str(ndays)+" trading days:",decision)
|
955
|
-
print(" Last close price: "+
|
955
|
+
print(" Last close price: "+ticker_name(ticker)+', closed '+str(known_close)+', '+str(known_day))
|
956
956
|
|
957
957
|
ndate=date_adjust(known_day,adjust=ndays)
|
958
958
|
|
@@ -1009,7 +1009,7 @@ def forecast_price_knn(ticker,ndays=1,max_neighbours=10,max_RS=20,end='latest'):
|
|
1009
1009
|
decisionlist=decisionlist+[decision]
|
1010
1010
|
confidencelist=confidencelist+[confidence]
|
1011
1011
|
|
1012
|
-
print("\nStock information:",
|
1012
|
+
print("\nStock information:",ticker_name(ticker),'\b, closed',known_close,'@',known_day)
|
1013
1013
|
|
1014
1014
|
for nd in list(range(1,ndays+1)):
|
1015
1015
|
ndate=date_adjust(known_day, adjust=nd)
|
@@ -1228,7 +1228,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1228
1228
|
dftmp15=dftmp14.T
|
1229
1229
|
dftmp15.reset_index(inplace=True)
|
1230
1230
|
|
1231
|
-
titletxt=
|
1231
|
+
titletxt=ticker_name(ticker)+":基本信息"
|
1232
1232
|
if prettytab:
|
1233
1233
|
pandas2prettytable(dftmp15,titletxt,firstColSpecial=False,leftColAlign='l',otherColAlign='l',tabborder=tabborder)
|
1234
1234
|
print(' ','数据来源:巨潮资讯,',str(today))
|
@@ -1296,7 +1296,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1296
1296
|
cols2=['分类方向','分类','营业收入-同比增长','营业成本-同比增长','毛利率','毛利率-同比增长']
|
1297
1297
|
|
1298
1298
|
dftmp1=dftmp[cols1]
|
1299
|
-
titletxt1=
|
1299
|
+
titletxt1=ticker_name(ticker)+':主营业务构成,'+period+'财报'
|
1300
1300
|
if prettytab:
|
1301
1301
|
pandas2prettytable(dftmp1,titletxt1,firstColSpecial=True,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1302
1302
|
print(' ','数据来源:益盟-F10,',str(today))
|
@@ -1306,7 +1306,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1306
1306
|
print('\n数据来源:益盟-F10,',str(today))
|
1307
1307
|
|
1308
1308
|
dftmp2=dftmp[cols2]
|
1309
|
-
titletxt2=
|
1309
|
+
titletxt2=ticker_name(ticker)+':主营业务增长,'+period+'财报'
|
1310
1310
|
if prettytab:
|
1311
1311
|
pandas2prettytable(dftmp2,titletxt2,firstColSpecial=True,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1312
1312
|
print(' ','数据来源:益盟-F10,',str(today))
|
@@ -1348,7 +1348,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1348
1348
|
dftmp2=dftmp1.replace(0,'')
|
1349
1349
|
dftmp3=dftmp2.replace('','--')
|
1350
1350
|
|
1351
|
-
titletxt=
|
1351
|
+
titletxt=ticker_name(ticker)+':股利发放历史'
|
1352
1352
|
if prettytab:
|
1353
1353
|
pandas2prettytable(dftmp3,titletxt,firstColSpecial=False,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1354
1354
|
print(' ','数据来源:巨潮资讯,',str(today))
|
@@ -1359,7 +1359,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1359
1359
|
"""
|
1360
1360
|
if category == 'dividend':
|
1361
1361
|
# 分红
|
1362
|
-
titletxt=
|
1362
|
+
titletxt=ticker_name(ticker)+':分红历史'
|
1363
1363
|
try:
|
1364
1364
|
#df3=ak.stock_dividents_cninfo(symbol=ticker1)
|
1365
1365
|
df3=ak.stock_history_dividend_detail(symbol=ticker1, indicator="分红")
|
@@ -1383,7 +1383,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1383
1383
|
newcols=['公告日期','送股','转增','派息','股权登记日','除权除息日']
|
1384
1384
|
dftmp3=dftmp[newcols]
|
1385
1385
|
|
1386
|
-
titletxt=
|
1386
|
+
titletxt=ticker_name(ticker)+':分红历史'
|
1387
1387
|
if prettytab:
|
1388
1388
|
pandas2prettytable(dftmp3,titletxt,firstColSpecial=False,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1389
1389
|
print('【注】送股/转增:股数/10股,派息:元(税前)/10股,数据来源:新浪财经,',str(today))
|
@@ -1394,7 +1394,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1394
1394
|
print('【注】送股/转增:股数/10股,派息:元(税前)/10股,数据来源:新浪财经,',str(today))
|
1395
1395
|
|
1396
1396
|
# 配股
|
1397
|
-
titletxt=
|
1397
|
+
titletxt=ticker_name(ticker)+':配股历史'
|
1398
1398
|
try:
|
1399
1399
|
df3p=ak.stock_history_dividend_detail(symbol=ticker1, indicator="配股")
|
1400
1400
|
except:
|
@@ -1476,7 +1476,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1476
1476
|
enddate=str(dftmp.head(1)['截至日期'][0])
|
1477
1477
|
shareholder_num=dftmp.head(1)['股东总数'][0]
|
1478
1478
|
avg_shares=dftmp.head(1)['平均持股数'][0]
|
1479
|
-
titletxt=
|
1479
|
+
titletxt=ticker_name(ticker)+':十大股东(截至'+str(enddate)+',股东总数'+str(int(shareholder_num))+',平均持股数'+str(int(avg_shares))+')'
|
1480
1480
|
|
1481
1481
|
dftmp.drop(['截至日期','公告日期','股东说明','股东总数','平均持股数'],axis=1,inplace=True)
|
1482
1482
|
|
@@ -1538,7 +1538,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1538
1538
|
mv_min=round(dftmp2['total_mv(yi)'].min(),1)
|
1539
1539
|
mv_txt="总市值(亿元):"+str(mv_min)+'-'+str(mv_max)+",均值"+str(mv_mean)+",中位数"+str(mv_median)
|
1540
1540
|
|
1541
|
-
titletxt=
|
1541
|
+
titletxt=ticker_name(ticker)+':估值与市值'
|
1542
1542
|
import datetime as dt
|
1543
1543
|
today=dt.date.today()
|
1544
1544
|
footnote3="数据来源:乐咕乐股,"+str(today)
|
@@ -1636,7 +1636,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1636
1636
|
if numOfQ > 8:
|
1637
1637
|
numOfQ=8
|
1638
1638
|
|
1639
|
-
titletxt=
|
1639
|
+
titletxt=ticker_name(ticker)+":主要财务信息,每股指标(元)"
|
1640
1640
|
df7['加权每股收益']=df7['加权每股收益(元)']
|
1641
1641
|
df7['每股收益_调整后']=df7['每股收益_调整后(元)']
|
1642
1642
|
df7['扣非后每股收益']=df7['扣除非经常性损益后的每股收益(元)']
|
@@ -1681,7 +1681,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1681
1681
|
为了准确评估每股收益,就必须用稀释每股收益。
|
1682
1682
|
"""
|
1683
1683
|
|
1684
|
-
titletxt=
|
1684
|
+
titletxt=ticker_name(ticker)+":主要财务信息,利润与成本"
|
1685
1685
|
df7['扣非后净利润(元)']=df7['扣除非经常性损益后的净利润(元)']
|
1686
1686
|
colList=['日期','财报类别','总资产利润率(%)','主营业务利润率(%)','总资产净利润率(%)','成本费用利润率(%)', \
|
1687
1687
|
'营业利润率(%)','主营业务成本率(%)','销售净利率(%)', '销售毛利率(%)','三项费用比重','非主营比重', \
|
@@ -1724,7 +1724,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1724
1724
|
成本费用利润率=利润总额/成本费用总额(即成本总额+费用总额)
|
1725
1725
|
"""
|
1726
1726
|
|
1727
|
-
titletxt=
|
1727
|
+
titletxt=ticker_name(ticker)+":主要财务信息,报酬与收益"
|
1728
1728
|
colList=['日期','财报类别', '股本报酬率(%)','净资产报酬率(%)','资产报酬率(%)', '股息发放率(%)','投资收益率(%)', \
|
1729
1729
|
'净资产收益率(%)','加权净资产收益率(%)']
|
1730
1730
|
dftmp=df7[colList].head(numOfQ)
|
@@ -1762,7 +1762,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1762
1762
|
股本报酬率/回报率=净利润/期初期末总股本的均值。股本是实收资本,而股权是股东权益。
|
1763
1763
|
"""
|
1764
1764
|
|
1765
|
-
titletxt=
|
1765
|
+
titletxt=ticker_name(ticker)+":主要财务信息,增长率"
|
1766
1766
|
colList=['日期','财报类别','主营业务收入增长率(%)','净利润增长率(%)','总资产增长率(%)','净资产增长率(%)']
|
1767
1767
|
dftmp=df7[colList].head(numOfQ)
|
1768
1768
|
|
@@ -1791,7 +1791,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1791
1791
|
"""
|
1792
1792
|
"""
|
1793
1793
|
|
1794
|
-
titletxt=
|
1794
|
+
titletxt=ticker_name(ticker)+":主要财务信息,资产负债分析"
|
1795
1795
|
colList=['日期','财报类别','流动比率','速动比率','现金比率(%)','利息支付倍数','长期债务与营运资金比率(%)', \
|
1796
1796
|
'股东权益比率(%)','长期负债比率(%)','股东权益与固定资产比率(%)','负债与所有者权益比率(%)', \
|
1797
1797
|
'长期资产与长期资金比率(%)','资本化比率(%)','固定资产净值率(%)','资本固定化比率(%)', \
|
@@ -1836,7 +1836,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1836
1836
|
|
1837
1837
|
"""
|
1838
1838
|
|
1839
|
-
titletxt=
|
1839
|
+
titletxt=ticker_name(ticker)+":主要财务信息,现金流量指标(均为%)"
|
1840
1840
|
colList=['日期','财报类别','经营现金净流量对销售收入比率(%)','资产的经营现金流量回报率(%)','经营现金净流量与净利润的比率(%)', \
|
1841
1841
|
'经营现金净流量对负债比率(%)','现金流量比率(%)']
|
1842
1842
|
dftmp=df7[colList].head(numOfQ)
|
siat/stock_info.pickle
CHANGED
Binary file
|