siat 3.10.131__py3-none-any.whl → 3.10.133__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 +136 -3
- siat/grafix.py +1 -1
- siat/market_china.py +1 -1
- siat/markowitz2.py +240 -39
- siat/markowitz2_20250704.py +2969 -0
- siat/markowitz2_20250705.py +3158 -0
- siat/security_prices.py +42 -2
- siat/security_trend2.py +1 -1
- siat/stock.py +4 -2
- siat/translate.py +11 -11
- {siat-3.10.131.dist-info → siat-3.10.133.dist-info}/METADATA +10 -5
- {siat-3.10.131.dist-info → siat-3.10.133.dist-info}/RECORD +15 -13
- siat-3.10.133.dist-info/top_level.txt +3 -0
- siat-3.10.131.dist-info/top_level.txt +0 -1
- {siat-3.10.131.dist-info → siat-3.10.133.dist-info}/LICENSE +0 -0
- {siat-3.10.131.dist-info → siat-3.10.133.dist-info}/WHEEL +0 -0
siat/security_prices.py
CHANGED
@@ -571,7 +571,45 @@ if __name__=='__main__':
|
|
571
571
|
|
572
572
|
#有问题
|
573
573
|
cvt_stooq_ticker('002504.SZ')
|
574
|
-
|
574
|
+
#==============================================================================
|
575
|
+
if __name__=='__main__':
|
576
|
+
ticker='1YCNY.B'
|
577
|
+
|
578
|
+
market_RF("1YCNY.B")
|
579
|
+
|
580
|
+
def market_RF(ticker='1YCNY.B',start='MRW',end='today',printout=True):
|
581
|
+
"""
|
582
|
+
功能:获取一个经济体市场的无风险收益率,以国债收益率替代。
|
583
|
+
默认1年期国债收益率最近一周的均值
|
584
|
+
"""
|
585
|
+
start,end=start_end_preprocess(start,end)
|
586
|
+
|
587
|
+
#屏蔽函数内print信息输出的类
|
588
|
+
import os, sys
|
589
|
+
class HiddenPrints:
|
590
|
+
def __enter__(self):
|
591
|
+
self._original_stdout = sys.stdout
|
592
|
+
sys.stdout = open(os.devnull, 'w')
|
593
|
+
|
594
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
595
|
+
sys.stdout.close()
|
596
|
+
sys.stdout = self._original_stdout
|
597
|
+
|
598
|
+
with HiddenPrints():
|
599
|
+
RFdf=get_price_stooq(ticker,start=start,end=end)
|
600
|
+
|
601
|
+
if RFdf is None:
|
602
|
+
print(f" #Error(market_RF): yield {ticker} not found or unavailable in the period")
|
603
|
+
return None
|
604
|
+
|
605
|
+
RF=round(RFdf['Close'].mean()/100,6)
|
606
|
+
|
607
|
+
if printout:
|
608
|
+
print(f" {round(RF*100,4)}% in average from {start} to {end}")
|
609
|
+
|
610
|
+
return RF
|
611
|
+
|
612
|
+
#==============================================================================
|
575
613
|
|
576
614
|
if __name__=='__main__':
|
577
615
|
ticker='AAPL'
|
@@ -604,10 +642,12 @@ if __name__=='__main__':
|
|
604
642
|
|
605
643
|
p=get_price_stooq(ticker,start,end)
|
606
644
|
|
607
|
-
def get_price_stooq(ticker,start,end):
|
645
|
+
def get_price_stooq(ticker,start='MRM',end='today'):
|
608
646
|
"""
|
609
647
|
从stooq抓取单个股价
|
610
648
|
"""
|
649
|
+
start,end=start_end_preprocess(start,end)
|
650
|
+
|
611
651
|
#转换证券代码
|
612
652
|
ticker2=cvt_stooq_ticker(ticker)
|
613
653
|
|
siat/security_trend2.py
CHANGED
@@ -466,7 +466,7 @@ def security_trend(ticker,indicator='Close',adjust='', \
|
|
466
466
|
facecolor=facecolor)
|
467
467
|
return df
|
468
468
|
|
469
|
-
# 情形2:单个证券,两个普通指标,twinx==True
|
469
|
+
# 情形2:单个证券,两个普通指标,twinx==True/UD/LR ===========================
|
470
470
|
if ticker_num==1 and indicator_num == 2 and indicator_group1 and twinx:
|
471
471
|
if DEBUG:
|
472
472
|
print("Scenario 2: ticker_num==1 and indicator_num == 2 and indicator_group1 and twinx")
|
siat/stock.py
CHANGED
@@ -660,8 +660,8 @@ if __name__ =="__main__":
|
|
660
660
|
|
661
661
|
df=security_indicator(ticker,indicator,fromdate,todate,ticker_type=ticker_type)
|
662
662
|
|
663
|
-
def security_indicator(ticker,indicator, \
|
664
|
-
fromdate,todate,adjust='', \
|
663
|
+
def security_indicator(ticker,indicator='Close', \
|
664
|
+
fromdate='MRM',todate='today',adjust='', \
|
665
665
|
zeroline=False, \
|
666
666
|
attention_value='',attention_value_area='', \
|
667
667
|
attention_point='',attention_point_area='', \
|
@@ -673,6 +673,8 @@ def security_indicator(ticker,indicator, \
|
|
673
673
|
"""
|
674
674
|
功能:单只证券的全部指标
|
675
675
|
"""
|
676
|
+
fromdate,todate=start_end_preprocess(fromdate,todate)
|
677
|
+
|
676
678
|
#判断复权价
|
677
679
|
adjust_list=['','qfq','hfq']
|
678
680
|
if adjust not in adjust_list:
|
siat/translate.py
CHANGED
@@ -1968,7 +1968,7 @@ def codetranslate1(code):
|
|
1968
1968
|
|
1969
1969
|
#股票:指数==============================================================
|
1970
1970
|
['000300.SS','CSI300 Index'],['399300.SS','CSI300 Index'],
|
1971
|
-
['000001.SS','SSE Composite Index'],['399001.SZ','
|
1971
|
+
['000001.SS','SSE Composite Index'],['399001.SZ','SZSE Component Index'],
|
1972
1972
|
['000016.SS','SSE50 Index'],['000132.SS','SSE100 Index'],
|
1973
1973
|
['000133.SS','SSE150 Index'],['000010.SS','SSE180 Index'],
|
1974
1974
|
['000688.SS','STAR50 Index'],['000043.SS','SSE Supercap Index'],
|
@@ -1997,15 +1997,15 @@ def codetranslate1(code):
|
|
1997
1997
|
['S41.SI','Hong Leong Finance(SG)'],
|
1998
1998
|
|
1999
1999
|
['000002.SS','SSE A Index'],['000003.SS','SSE B Index'],
|
2000
|
-
['399107.SZ','
|
2001
|
-
['399106.SZ','
|
2000
|
+
['399107.SZ','SZSE A Index'],['399108.SZ','SZSE B Index'],
|
2001
|
+
['399106.SZ','SZSE Composite Index'],['399004.SZ','SZSE100 Index'],
|
2002
2002
|
['399012.SZ','GEM300 Index'],
|
2003
2003
|
|
2004
|
-
['399232.SZ','
|
2005
|
-
['399234.SZ','
|
2006
|
-
['399237.SZ','
|
2007
|
-
['399241.SZ','
|
2008
|
-
['399991.SZ','
|
2004
|
+
['399232.SZ','SZSE Mining Index'],['399233.SZ','SZSE Manufacturing Index'],
|
2005
|
+
['399234.SZ','SZSE Utility Index'],['399236.SZ','SZSE Commercial Index'],
|
2006
|
+
['399237.SZ','SZSE Logistics Index'],['399240.SZ','SZSE Financial Index'],
|
2007
|
+
['399241.SZ','SZSE Realestate Index'],['399244.SZ','SZSE EP Index'],
|
2008
|
+
['399991.SZ','SZSE BRI Index'],['399997.SZ','CSI China Baijiu Index'],
|
2009
2009
|
|
2010
2010
|
['000903.SS','CSI100 Index'],['399903.SZ','CSI100 Index'],
|
2011
2011
|
['000904.SS','CSI200 Index'],['399904.SZ','CSI200 Index'],
|
@@ -2022,7 +2022,7 @@ def codetranslate1(code):
|
|
2022
2022
|
['002594.SZ','BYD Auto(A)'],['01211.HK','BYD Auto(HK)'],['81211.HK','BYD Auto(HK RMB)'],
|
2023
2023
|
['600941.SS','China Mobile'],['00941.HK','China Mobile (HK)'],['80941.HK','China Mobile (HK RMB)'],
|
2024
2024
|
['ULVR.UK','Unilever (UK)'],['605011.SS','Hangzou Power'],['000723.SZ','Meijin Energy'],
|
2025
|
-
['EL','
|
2025
|
+
['EL','Estée Lauder'],['LOR.DE','L\'Oreal(DE)'],
|
2026
2026
|
|
2027
2027
|
['^GSPC','S&P500 Index'],['^DJI','Dow Jones Index'],
|
2028
2028
|
['WISGP.SI','FTSE Singapore Index'], ['^STI','Straits Times Index'],
|
@@ -2074,8 +2074,8 @@ def codetranslate1(code):
|
|
2074
2074
|
['050111','博时信债C'],['320019','诺安货币B基金'],
|
2075
2075
|
['510580','Yifangda CSI500 ETF'],['510210.SS','SSE Composite Index ETF'],
|
2076
2076
|
["510050.SS",'Huaxia CSI50 ETF'],['510880.SS','SSE Dividend ETF'],
|
2077
|
-
["510180.SS",'SSE180 ETF'],['159901.SZ','
|
2078
|
-
["159902.SZ",'
|
2077
|
+
["510180.SS",'SSE180 ETF'],['159901.SZ','SZSE100 ETF'],
|
2078
|
+
["159902.SZ",'SZSE SMB ETF'],['159901.SZ','SZSE100 ETF'],
|
2079
2079
|
["159919.SZ",'Jiashi CSI300 ETF'],["510300.SS",'Huaxia Borui CSI300 ETF'],
|
2080
2080
|
|
2081
2081
|
["004972",'长城收益宝货币A基金'],["004137",'博时合惠货币B基金'],
|
@@ -1,11 +1,17 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: siat
|
3
|
-
Version: 3.10.
|
3
|
+
Version: 3.10.133
|
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
|
7
|
-
Author-email: wdehong2000@163.com
|
7
|
+
Author-email: "Prof. WANG Dehong" <wdehong2000@163.com>
|
8
|
+
Maintainer-email: "Prof. WANG Dehong" <wdehong2000@163.com>
|
8
9
|
License: Copyright (C) WANG Dehong, 2025. For educational purpose only!
|
10
|
+
Project-URL: Homepage, https://pypi.org/project/siat/
|
11
|
+
Keywords: investment,finance,technical analysis,siat
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Requires-Python: <3.13,>=3.12
|
9
15
|
Description-Content-Type: text/markdown
|
10
16
|
License-File: LICENSE
|
11
17
|
Requires-Dist: pandas-datareader
|
@@ -23,7 +29,6 @@ Requires-Dist: scipy
|
|
23
29
|
Requires-Dist: pandas
|
24
30
|
Requires-Dist: scikit-learn
|
25
31
|
Requires-Dist: baostock
|
26
|
-
Requires-Dist: pyproject.toml
|
27
32
|
Requires-Dist: pathlib
|
28
33
|
Requires-Dist: ruamel-yaml
|
29
34
|
Requires-Dist: prettytable
|
@@ -38,11 +43,11 @@ Requires-Dist: translators
|
|
38
43
|
Requires-Dist: nbconvert
|
39
44
|
Requires-Dist: ipywidgets ==8.1.6
|
40
45
|
Requires-Dist: yahooquery ==2.3.7
|
41
|
-
Requires-Dist: lxml ==4.9.4
|
42
46
|
Requires-Dist: alpha-vantage
|
43
47
|
Requires-Dist: tiingo[pandas]
|
44
48
|
Requires-Dist: numpy <2
|
45
49
|
Requires-Dist: playwright
|
50
|
+
Requires-Dist: lxml ==4.9.4
|
46
51
|
|
47
52
|
|
48
53
|
# What is siat?
|
@@ -116,7 +121,7 @@ apple=security_technical("AAPL",
|
|
116
121
|
|
117
122
|
```python
|
118
123
|
# security_technical2 supports up to 14 popular technical indicators.
|
119
|
-
# security_technical2 uses a simplied drawing method (Dehong graph) to avoid trypophobia [
|
124
|
+
# security_technical2 uses a simplied drawing method (Dehong graph) to avoid trypophobia [ˌtrɪpəu'fəʊbjə]
|
120
125
|
apple=security_technical2("AAPL",
|
121
126
|
technical="CCI",
|
122
127
|
start="MRM",
|
@@ -10,7 +10,7 @@ siat/bond_china.py,sha256=WzUhjYYk8tsr3BDWLQcpuj9DqNxTzBSIi_wuAOZ48kY,3082
|
|
10
10
|
siat/bond_zh_sina.py,sha256=26BohGcS120utwqg9dJvdGm5OkuNpNu5bco80uOuQpU,4423
|
11
11
|
siat/capm_beta.py,sha256=t8-xr90II0JzbjsTOZNpRze_mKTvBRXjwN2o0N0tgD8,30521
|
12
12
|
siat/capm_beta2.py,sha256=4g8pOFCwFrEpLx2NJbhL2nl_nrWaOwgbPCHx1G6P_tI,35949
|
13
|
-
siat/common.py,sha256=
|
13
|
+
siat/common.py,sha256=PctlUcwb7MheTR-Ync-4hYWjPidsT9LufEsZXNJqbjw,193728
|
14
14
|
siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
|
15
15
|
siat/copyrights.py,sha256=YMLjZb328YpFMR-s_GUu0HBgeGce3pV7DgRut8S3I7w,690
|
16
16
|
siat/cryptocurrency.py,sha256=QSc4jK9VFlqBWVu-0th1BIMt8wC-5R5sWky3EaNupy0,27940
|
@@ -32,12 +32,14 @@ siat/fund_china.pickle,sha256=x_nPPdwy7wzIhtZQOplgDyTSyyUdXy9lbNxWysq7N6k,243777
|
|
32
32
|
siat/fund_china.py,sha256=U7bN8mOJ_4RBkxRzrR26LSj4YJyMNpRjBtrZNUH8JI4,138286
|
33
33
|
siat/future_china.py,sha256=LORFv7AaaQHq9QBk9ZSVVOjmxY_YWyPVRdpDxfCJvdo,17828
|
34
34
|
siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
|
35
|
-
siat/grafix.py,sha256=
|
35
|
+
siat/grafix.py,sha256=TvmbEAsdWKOJA5JK8xcwQz0vnoqq67AtGbRWbw-Vosk,145100
|
36
36
|
siat/holding_risk.py,sha256=SCHVxRBEhseUrgMpsnvR9Pt6ns-V-voRl3hCuK1p5y4,31114
|
37
37
|
siat/luchy_draw.py,sha256=8Ue-NKnvSVqINPY1eXat0NJat5MR-gex_K62aOYFdmA,20486
|
38
|
-
siat/market_china.py,sha256=
|
38
|
+
siat/market_china.py,sha256=Ki9Kpq-fwA9F_uI_-0b2KS0ir1gkOwQfB5Yd_hCWSeg,51758
|
39
39
|
siat/markowitz.py,sha256=PtQ_6rLyh5SEXyO7SCDyYChcgXl6ddcdgQ06HETjDVE,97990
|
40
|
-
siat/markowitz2.py,sha256=
|
40
|
+
siat/markowitz2.py,sha256=elpZr1nsALlrdxbMPT7pBREpA6I5P7TL6qpuLmMKPA8,133215
|
41
|
+
siat/markowitz2_20250704.py,sha256=x10MfBaWZ42xcmDAbPU02oOZ4J02QDB1nyVKX8QobiA,126468
|
42
|
+
siat/markowitz2_20250705.py,sha256=jwDhQUvr5fcjA7scYbI8bJo-5zFPE4LyUsnK-hlqz90,133997
|
41
43
|
siat/markowitz_simple.py,sha256=aJVvx669ngcCsqoQtA9kvFOQVjsuipYt2fyTc4yMItE,14286
|
42
44
|
siat/ml_cases.py,sha256=FYDk0O7l9hhHlbrlOVGgbH-h2DA503lhKFi9XugH1f0,86874
|
43
45
|
siat/ml_cases_example.py,sha256=xRGb3YTQEDTOnaWNzZN_myU5umQnA2RdMNiPrxTmn9c,1673
|
@@ -50,10 +52,10 @@ siat/risk_evaluation.py,sha256=xfgLSKlIWYmRJrIL4kn2k2hp9fyOMAzYGIhi9ImvKOw,88917
|
|
50
52
|
siat/risk_free_rate.py,sha256=IBuRqA2kppdZsW4D4fapW7vnM5HMEXOn95A5r9Pkwlo,12384
|
51
53
|
siat/sector_china.py,sha256=uLsDXdRBDVfgG6tnXWnQOTyDmyZfglVO9DRUYU2e3pk,157914
|
52
54
|
siat/security_price2.py,sha256=DDiZ2dlv_TYPLhA8-gGb9i9xrl88r4rgSMEcxqQ6aU0,28065
|
53
|
-
siat/security_prices.py,sha256=
|
55
|
+
siat/security_prices.py,sha256=vbz85xjxMBFfipTcmF4ZnpOODnOKuEm4NfTKMi1C3OY,124171
|
54
56
|
siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
|
55
|
-
siat/security_trend2.py,sha256=
|
56
|
-
siat/stock.py,sha256=
|
57
|
+
siat/security_trend2.py,sha256=czagiFIU3A3ow_dMn_-xQYnzgSTOP5Ds38PtHC1uyP0,31762
|
58
|
+
siat/stock.py,sha256=ufhC3CWfx6KEDgCSTSwplf1EAi8AIlKmy6kdkoBAkbE,161426
|
57
59
|
siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
|
58
60
|
siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
|
59
61
|
siat/stock_china.py,sha256=vHIc2UuXIGRkRvyL4fjTaNAoyFaq022p9FxPah6dscI,96399
|
@@ -64,13 +66,13 @@ siat/stock_profile.py,sha256=BuvdrQ3bqIAUCaM2GxPR6_rUhigQQa_YMeUov2zY6Y0,26084
|
|
64
66
|
siat/stock_technical.py,sha256=1P4FkOTPknG2m18NTgwMxN-NgwIAdW3qR09VoFz00Hc,140928
|
65
67
|
siat/stooq.py,sha256=TTLjAAp-TcoEezgCPu6eM_5naI4yCshp1S7V3pyc-og,2519
|
66
68
|
siat/transaction.py,sha256=nZTYYkx1BVBLDovSlZCtcviRuFxrYe9YFXOMZgo6QXo,14563
|
67
|
-
siat/translate.py,sha256=
|
69
|
+
siat/translate.py,sha256=6mHTT6sWo12TNYJMo7CYF9ysFa_tCAQd5ePci9Xv3YI,263531
|
68
70
|
siat/valuation.py,sha256=xGizcKJZ3ADLWWHm2TFQub18FxiDv2doQwBwbEqyqz0,51980
|
69
71
|
siat/valuation_china.py,sha256=eSKIDckyjG8QkENlW_OKkqbQHno8pzDcomBO9iGNJVM,83079
|
70
72
|
siat/var_model_validation.py,sha256=loqziBYO2p0xkeWm3Rb1rJsDhbcgAZ5aR9rBLRwLU5E,17624
|
71
73
|
siat/yf_name.py,sha256=laNKMTZ9hdenGX3IZ7G0a2RLBKEWtUQJFY9CWuk_fp8,24058
|
72
|
-
siat-3.10.
|
73
|
-
siat-3.10.
|
74
|
-
siat-3.10.
|
75
|
-
siat-3.10.
|
76
|
-
siat-3.10.
|
74
|
+
siat-3.10.133.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
|
75
|
+
siat-3.10.133.dist-info/METADATA,sha256=9y4HQxe8Jl1vjMqwkIDruTWGU6GMpHI49LDTHSeUW50,8538
|
76
|
+
siat-3.10.133.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
77
|
+
siat-3.10.133.dist-info/top_level.txt,sha256=X5R8wrVviq8agwJFVRVDsufkuOJuit-1qAT_kXeptrY,17
|
78
|
+
siat-3.10.133.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
siat
|
File without changes
|
File without changes
|